agents 0.0.0-eb6827a → 0.0.0-f641104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -316,14 +316,18 @@ Create meaningful conversations with intelligence:
|
|
|
316
316
|
|
|
317
317
|
```ts
|
|
318
318
|
import { AIChatAgent } from "agents/ai-chat-agent";
|
|
319
|
-
import {
|
|
319
|
+
import { createOpenAI } from "@ai-sdk/openai";
|
|
320
320
|
|
|
321
321
|
export class DialogueAgent extends AIChatAgent {
|
|
322
322
|
async onChatMessage(onFinish) {
|
|
323
323
|
return createDataStreamResponse({
|
|
324
324
|
execute: async (dataStream) => {
|
|
325
|
+
const ai = createOpenAI({
|
|
326
|
+
apiKey: this.env.OPENAI_API_KEY,
|
|
327
|
+
});
|
|
328
|
+
|
|
325
329
|
const stream = streamText({
|
|
326
|
-
model:
|
|
330
|
+
model: ai("gpt-4o"),
|
|
327
331
|
messages: this.messages,
|
|
328
332
|
onFinish, // call onFinish so that messages get saved
|
|
329
333
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agents",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-f641104",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -64,10 +64,11 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"cron-schedule": "^5.0.4",
|
|
66
66
|
"nanoid": "^5.1.5",
|
|
67
|
-
"partyserver": "^0.0.
|
|
68
|
-
"partysocket": "
|
|
67
|
+
"partyserver": "^0.0.65",
|
|
68
|
+
"partysocket": "0.0.0-548c226"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@modelcontextprotocol/sdk": "^1.7.0"
|
|
71
|
+
"@modelcontextprotocol/sdk": "^1.7.0",
|
|
72
|
+
"hono": "^4.7.5"
|
|
72
73
|
}
|
|
73
74
|
}
|