@neuledge/graph 0.3.1 → 0.3.2
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 +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ const { text } = await agent.generate({
|
|
|
69
69
|
| `What is the weather in San Francisco?` | `San Francisco is sunny, about 68°F.` |
|
|
70
70
|
| `What time is it in Tokyo?` | `It's 3:42 PM JST.` |
|
|
71
71
|
| `When is the next Monday?` | `The next Monday is on February 10, 2025.` |
|
|
72
|
-
| `When is
|
|
72
|
+
| `When is next Thanksgiving?` | `Thanksgiving in 2026 falls on November 26.` |
|
|
73
73
|
| `How much is $250 in euros?` | `$250 equals €215.` |
|
|
74
74
|
| `Price of Apple stock?` | `Apple (AAPL) is trading at $175.20` |
|
|
75
75
|
| `Latest headlines about AI` | *Coming soon…* |
|
|
@@ -113,11 +113,11 @@ yarn add @neuledge/graph zod
|
|
|
113
113
|
```typescript
|
|
114
114
|
import { anthropic } from "@ai-sdk/anthropic";
|
|
115
115
|
import { NeuledgeGraph } from "@neuledge/graph";
|
|
116
|
-
import {
|
|
116
|
+
import { stepCountIs, ToolLoopAgent, tool } from "ai";
|
|
117
117
|
|
|
118
118
|
const graph = new NeuledgeGraph();
|
|
119
119
|
|
|
120
|
-
const agent = new
|
|
120
|
+
const agent = new ToolLoopAgent({
|
|
121
121
|
model: anthropic("claude-sonnet-4-5"),
|
|
122
122
|
tools: {
|
|
123
123
|
lookup: tool(graph.lookup),
|
|
@@ -125,7 +125,7 @@ const agent = new Agent({
|
|
|
125
125
|
stopWhen: stepCountIs(20),
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
const { textStream } = agent.stream({
|
|
128
|
+
const { textStream } = await agent.stream({
|
|
129
129
|
prompt: "Compare Apple and Microsoft stock prices",
|
|
130
130
|
});
|
|
131
131
|
|