agents 0.0.41 → 0.0.42
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 +2 -6
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -316,18 +316,14 @@ Create meaningful conversations with intelligence:
|
|
|
316
316
|
|
|
317
317
|
```ts
|
|
318
318
|
import { AIChatAgent } from "agents/ai-chat-agent";
|
|
319
|
-
import {
|
|
319
|
+
import { openai } 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
|
-
|
|
329
325
|
const stream = streamText({
|
|
330
|
-
model:
|
|
326
|
+
model: openai("gpt-4o"),
|
|
331
327
|
messages: this.messages,
|
|
332
328
|
onFinish, // call onFinish so that messages get saved
|
|
333
329
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agents",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.42",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -64,11 +64,10 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"cron-schedule": "^5.0.4",
|
|
66
66
|
"nanoid": "^5.1.5",
|
|
67
|
-
"partyserver": "^0.0.
|
|
67
|
+
"partyserver": "^0.0.66",
|
|
68
68
|
"partysocket": "0.0.0-548c226"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@modelcontextprotocol/sdk": "^1.7.0"
|
|
72
|
-
"hono": "^4.7.5"
|
|
71
|
+
"@modelcontextprotocol/sdk": "^1.7.0"
|
|
73
72
|
}
|
|
74
73
|
}
|