Skip to content

Commit f0655c2

Browse files
committed
docs(feat): context example readme
1 parent 3df8ebc commit f0655c2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ pnpm add ai zod
4040
Here's a basic example of how to use the library:
4141

4242
```typescript
43-
4443
import { z } from 'zod';
4544
import { generateId } from 'ai';
4645
import { openai } from '@ai-sdk/openai';
@@ -78,11 +77,18 @@ const { result } = await chat.run(context);
7877
const { messages } = await result.response;
7978

8079
console.log(messages);
81-
8280
```
8381

8482
This example demonstrates how to build a streaming chat API where the assistant agent can automatically use the math agent as a tool to solve math problems in user queries. The response is streamed in real time to the client.
8583

84+
### Other examples
85+
86+
- [**examples/contexts**](examples/contexts)
87+
_Demonstrates how to extend the agent context with custom values (like dates) and inject them into system prompts. Shows how to use both regular tools and other agents as tools within your assistant, enabling dynamic, context-aware behavior and multi-step reasoning._
88+
89+
- [**examples/express**](examples/express)
90+
_Shows how to build a streaming chat API using Express, powered by two agents: a main assistant and a math expert agent (used as a tool). Features real-time streaming responses, conversation history, and a `/chat` endpoint for interactive queries._
91+
8692
## Project Structure
8793

8894
```

0 commit comments

Comments
 (0)