diff --git a/agent_chat/chat_put.png b/agent_chat/chat_put.png index f2ed4ac..c0ab3af 100644 Binary files a/agent_chat/chat_put.png and b/agent_chat/chat_put.png differ diff --git a/agent_chat/eventWorkflow.ts b/agent_chat/eventWorkflow.ts index 6e7540b..0465493 100644 --- a/agent_chat/eventWorkflow.ts +++ b/agent_chat/eventWorkflow.ts @@ -10,7 +10,7 @@ async function eventWorkflow(input: EventInput) { await client.sendWorkflowEvent({ event: { name: "message", - input: { content: "Telle ma another one" }, + input: { content: "Tell me a joke" }, }, workflow: { workflowId: input.workflowId, diff --git a/agent_chat/package.json b/agent_chat/package.json index 8116f35..65cc1c7 100644 --- a/agent_chat/package.json +++ b/agent_chat/package.json @@ -10,7 +10,7 @@ "event-workflow": "tsx eventWorkflow.ts" }, "dependencies": { - "@restackio/ai": "^0.0.97", + "@restackio/ai": "^0.0.99", "@temporalio/workflow": "1.11.3", "openai": "^4.80.1" }, diff --git a/agent_chat/pnpm-lock.yaml b/agent_chat/pnpm-lock.yaml index 5735177..8dbdeb9 100644 --- a/agent_chat/pnpm-lock.yaml +++ b/agent_chat/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@restackio/ai': - specifier: ^0.0.97 - version: 0.0.97 + specifier: ^0.0.99 + version: 0.0.99 '@temporalio/workflow': specifier: 1.11.3 version: 1.11.3 @@ -264,8 +264,8 @@ packages: '@protobufjs/utf8@1.1.0': resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} - '@restackio/ai@0.0.97': - resolution: {integrity: sha512-mTRACMM7gWd2DFdvywbkU0jf2dFH6ArZB+DblAckktivFtlfGmZYspz0W+F+Llmk0EPb9fxo9kBrtHWR1CfGBg==} + '@restackio/ai@0.0.99': + resolution: {integrity: sha512-qxLidh2blqUgBiAeR7DnsFclSIX1I7JPmKzgWRue7RuXTw9AypzOx9QTOogLx7bpOGTlooTAWLpRngvBsiF3dA==} engines: {node: '>=20'} '@swc/core-darwin-arm64@1.10.11': @@ -1251,7 +1251,7 @@ snapshots: '@protobufjs/utf8@1.1.0': {} - '@restackio/ai@0.0.97': + '@restackio/ai@0.0.99': dependencies: '@temporalio/activity': 1.11.6 '@temporalio/client': 1.11.6 diff --git a/agent_chat/src/workflows/workflow.ts b/agent_chat/src/workflows/workflow.ts index 469aef5..399361a 100644 --- a/agent_chat/src/workflows/workflow.ts +++ b/agent_chat/src/workflows/workflow.ts @@ -6,21 +6,14 @@ export type EndEvent = { end: boolean; }; -export const messageEvent = defineEvent("message"); - +export const messageEvent = defineEvent("message"); export const endEvent = defineEvent("end"); -type AgentChatInput = { - message: string; -}; - type AgentChatOutput = { messages: functions.Message[]; }; -export async function agentChat({ - message = "Hello, can you tell me a joke?", -}: AgentChatInput): Promise { +export async function agentChat(): Promise { let endReceived = false; let messages: functions.Message[] = []; @@ -30,18 +23,13 @@ export async function agentChat({ messages, }); messages.push(result); - return result; + return messages; }); onEvent(endEvent, async () => { endReceived = true; }); - const result = await step({}).llmChat({ - messages: [{ role: "user", content: message }], - }); - messages.push(result); - // We use the `condition` function to wait for the event goodbyeReceived to return `True`. await condition(() => endReceived);