You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: agents/autogen/mcp_agent/README.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ uv pip install -e .
105
105
uv run uvicorn main:app --host 0.0.0.0 --port 8080
106
106
```
107
107
108
-
3. Test: `curl -X POST http://localhost:8080/chat/completions -H "Content-Type: application/json" -d '{"message": "What is 2+2? Use a tool if needed."}'`
108
+
3. Test: `curl -X POST http://localhost:8080/chat/completions -H "Content-Type: application/json" -d '{"message": "What is 2+7? Use a tool!"}'`
109
109
110
110
---
111
111
@@ -119,9 +119,19 @@ Test the `/chat` endpoint:
119
119
```bash
120
120
curl -X POST http://localhost:8080/chat/completions \
121
121
-H "Content-Type: application/json" \
122
-
-d '{"message": "What is 2+2? Use a tool if needed."}'
122
+
-d '{"message": "What is 2+7? Use a tool!"}'
123
123
```
124
124
125
+
**Streaming** (OpenAI-style SSE: `chat.completion.chunk` lines, then `data: [DONE]`):
126
+
127
+
```bash
128
+
curl -sN -X POST http://localhost:8080/chat/completions \
129
+
-H "Content-Type: application/json" \
130
+
-d '{"messages": [{"role": "user", "content": "What is 2+2? Use a tool if needed."}], "stream": true}'
131
+
```
132
+
133
+
You can use either `"message": "..."` or `"messages": [...]`; set `"stream": true` for token-by-token chunks.
134
+
125
135
Optional: interactive chat with MCP tools (LangGraph) — from the `mcp_automl_template` directory:
126
136
127
137
```bash
@@ -186,6 +196,14 @@ curl -X POST https://<YOUR_ROUTE_URL>/chat/completions \
186
196
-d '{"message": "Predict churn for this customer: Male, 12 months tenure, fiber optic, month-to-month contract, electronic check, monthly 70.35, total 800.40."}'
187
197
```
188
198
199
+
**Streaming** (`stream: true`): response is Server-Sent Events (`chat.completion.chunk` per line, then `data: [DONE]`). Use `curl -N` or `-sN` so chunks print live:
200
+
201
+
```bash
202
+
curl -sN -X POST https://<YOUR_ROUTE_URL>/chat/completions \
203
+
-H "Content-Type: application/json" \
204
+
-d '{"messages": [{"role": "user", "content": "What is 17 + 25? Use your tools."}], "stream": true}'
0 commit comments