과거 세션을 사용하여 메모리 저장소의 재구성된 버전을 생성하는 비동기 작업을 시작하고, 결과를 폴링할 수 있는 드림을 반환받습니다.
기본적으로 드림은 결과를 새 메모리 저장소에 기록하며 입력 메모리 저장소는 변경하지 않습니다. 응답의 status는 pending으로 설정되고 outputs 배열은 비어 있습니다. status가 completed, failed 또는 canceled가 될 때까지 드림을 폴링하세요.
드림 생성에 대한 자세한 내용은 Dreams 가이드를 참조하세요.
Parameters
Returns
Dream 생성
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});
const betaDream = await client.beta.dreams.create({
inputs: [{ memory_store_id: "x", type: "memory_store" }],
model: "string"
});
console.log(betaDream.id);Response 200
{
"id": "id",
"archived_at": "2019-12-27T18:11:19.117Z",
"created_at": "2019-12-27T18:11:19.117Z",
"ended_at": "2019-12-27T18:11:19.117Z",
"error": {
"message": "message",
"type": "type"
},
"inputs": [
{
"memory_store_id": "x",
"type": "memory_store"
}
],
"instructions": "instructions",
"model": {
"id": "x",
"speed": "standard"
},
"output_behavior": {
"type": "create_new"
},
"outputs": [
{
"memory_store_id": "memory_store_id",
"type": "memory_store"
}
],
"session_id": "session_id",
"status": "pending",
"type": "dream",
"usage": {
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"input_tokens": 0,
"output_tokens": 0
}
}Returns Examples
Response 200
{
"id": "id",
"archived_at": "2019-12-27T18:11:19.117Z",
"created_at": "2019-12-27T18:11:19.117Z",
"ended_at": "2019-12-27T18:11:19.117Z",
"error": {
"message": "message",
"type": "type"
},
"inputs": [
{
"memory_store_id": "x",
"type": "memory_store"
}
],
"instructions": "instructions",
"model": {
"id": "x",
"speed": "standard"
},
"output_behavior": {
"type": "create_new"
},
"outputs": [
{
"memory_store_id": "memory_store_id",
"type": "memory_store"
}
],
"session_id": "session_id",
"status": "pending",
"type": "dream",
"usage": {
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"input_tokens": 0,
"output_tokens": 0
}
}