Skip to content

Commit 2db91dd

Browse files
docs: Update docs (#88)
Signed-off-by: Luis Valdes <[email protected]>
1 parent 7b485a4 commit 2db91dd

File tree

2 files changed

+79
-20
lines changed

2 files changed

+79
-20
lines changed

docs/quickstart/middleware.mdx

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ Finally, introduce your integration to the dojo by adding it to
9191
export const menuIntegrations: MenuIntegrationConfig[] = [
9292
// ...
9393

94-
configureIntegration({
94+
{
9595
id: "openai",
9696
name: "OpenAI",
9797
features: ["agentic_chat"],
98-
}),
98+
},
9999
]
100100
```
101101

@@ -119,7 +119,36 @@ export const agentsIntegrations: AgentIntegrationConfig[] = [
119119
]
120120
```
121121

122-
## Step 2 – Start the dojo
122+
## Step 2 – Add package to dojo dependencies
123+
124+
Open `apps/dojo/package.json` and add the package `@ag-ui/openai`:
125+
126+
```json
127+
{
128+
"name": "demo-viewer",
129+
"version": "0.1.0",
130+
"private": true,
131+
"scripts": {
132+
"dev": "next dev",
133+
"build": "next build",
134+
"start": "next start",
135+
"lint": "next lint"
136+
},
137+
"dependencies": {
138+
"@ag-ui/agno": "workspace:*",
139+
"@ag-ui/langgraph": "workspace:*",
140+
"@ag-ui/mastra": "workspace:*",
141+
"@ag-ui/middleware-starter": "workspace:*",
142+
"@ag-ui/server-starter": "workspace:*",
143+
"@ag-ui/server-starter-all-features": "workspace:*",
144+
"@ag-ui/vercel-ai-sdk": "workspace:*",
145+
"@ag-ui/openai": "workspace:*", <- Add this line
146+
147+
... rest of package.json
148+
}
149+
```
150+
151+
## Step 3 – Start the dojo
123152

124153
Now let's see your work in action:
125154

@@ -185,7 +214,7 @@ export class OpenAIAgent extends AbstractAgent {
185214
}
186215
```
187216

188-
## Step 3 – Bridge OpenAI with AG-UI
217+
## Step 4 – Bridge OpenAI with AG-UI
189218

190219
Let's transform our stub into a real agent that streams completions from OpenAI.
191220

docs/quickstart/server.mdx

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,29 +58,30 @@ cd ag-ui/typescript-sdk
5858
Copy the server-starter template to create your OpenAI server:
5959

6060
```bash
61-
cp -r integrations/server-starter integrations/openai
61+
cp -r integrations/server-starter integrations/openai-server
6262
```
6363

6464
### Update metadata
6565

66-
Open `integrations/openai/package.json` and update the fields to match your new
66+
Open `integrations/openai-server/package.json` and update the fields to match your new
6767
folder:
6868

6969
```json
7070
{
71-
"name": "@ag-ui/openai",
71+
"name": "@ag-ui/openai-server",
7272
"author": "Your Name <[email protected]>",
7373
"version": "0.0.1",
7474

7575
... rest of package.json
7676
}
7777
```
7878

79-
Next, update the class name inside `integrations/openai/src/index.ts`:
79+
Next, update the class name inside `integrations/openai-server/src/index.ts`:
8080

8181
```ts
82-
// change the name to OpenAIAgent
83-
export class OpenAIAgent extends AbstractAgent {}
82+
// change the name to OpenAIServerAgent
83+
export class ServerStarterAgent extends HttpAgent { }
84+
8485
```
8586

8687
Finally, introduce your integration to the dojo by adding it to
@@ -91,35 +92,64 @@ Finally, introduce your integration to the dojo by adding it to
9192
export const menuIntegrations: MenuIntegrationConfig[] = [
9293
// ...
9394

94-
configureIntegration({
95-
id: "openai",
96-
name: "OpenAI",
95+
{
96+
id: "openai-server",
97+
name: "OpenAI Server",
9798
features: ["agentic_chat"],
98-
}),
99+
},
99100
]
100101
```
101102

102103
And `apps/dojo/src/agents.ts`:
103104

104105
```ts
105106
// ...
106-
import { OpenAIAgent } from "@ag-ui/openai"
107+
import { OpenAIServerAgent } from "@ag-ui/openai-server"
107108

108109
export const agentsIntegrations: AgentIntegrationConfig[] = [
109110
// ...
110111

111112
{
112-
id: "openai",
113+
id: "openai-server",
113114
agents: async () => {
114115
return {
115-
agentic_chat: new OpenAIAgent(),
116+
agentic_chat: new OpenAIServerAgent(),
116117
}
117118
},
118119
},
119120
]
120121
```
121122

122-
## Step 2 – Start the dojo and server
123+
## Step 2 – Add package to dojo dependencies
124+
125+
Open `apps/dojo/package.json` and add the package `@ag-ui/openai-server`:
126+
127+
```json
128+
{
129+
"name": "demo-viewer",
130+
"version": "0.1.0",
131+
"private": true,
132+
"scripts": {
133+
"dev": "next dev",
134+
"build": "next build",
135+
"start": "next start",
136+
"lint": "next lint"
137+
},
138+
"dependencies": {
139+
"@ag-ui/agno": "workspace:*",
140+
"@ag-ui/langgraph": "workspace:*",
141+
"@ag-ui/mastra": "workspace:*",
142+
"@ag-ui/middleware-starter": "workspace:*",
143+
"@ag-ui/server-starter": "workspace:*",
144+
"@ag-ui/server-starter-all-features": "workspace:*",
145+
"@ag-ui/vercel-ai-sdk": "workspace:*",
146+
"@ag-ui/openai-server": "workspace:*", <- Add this line
147+
148+
... rest of package.json
149+
}
150+
```
151+
152+
## Step 3 – Start the dojo and server
123153

124154
Now let's see your work in action. First, start your Python server:
125155

@@ -208,7 +238,7 @@ async def agentic_chat_endpoint(input_data: RunAgentInput, request: Request):
208238
)
209239
```
210240

211-
## Step 3 – Bridge OpenAI with AG-UI
241+
## Step 4 – Bridge OpenAI with AG-UI
212242

213243
Let's transform our stub into a real server that streams completions from
214244
OpenAI.
@@ -383,7 +413,7 @@ Let's break down what your server is doing:
383413
`TOOL_CALL_CHUNK`
384414
4. **Finish** – We emit `RUN_FINISHED` (or `RUN_ERROR` if something goes wrong)
385415

386-
## Step 4 – Chat with your server
416+
## Step 5 – Chat with your server
387417

388418
Reload the dojo page and start typing. You'll see GPT-4o streaming its answer in
389419
real-time, word by word.

0 commit comments

Comments
 (0)