2025-04-14 18:01:50 +08:00
|
|
|
# SSE Integration Test
|
|
|
|
|
|
|
|
|
|
## Auto Accepted Case
|
|
|
|
|
```
|
|
|
|
|
curl --location 'http://localhost:8000/api/chat/stream' \
|
|
|
|
|
--header 'Accept: */*' \
|
|
|
|
|
--header 'Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \
|
|
|
|
|
--header 'Cache-Control: no-cache' \
|
|
|
|
|
--header 'Connection: keep-alive' \
|
|
|
|
|
--header 'Content-Type: application/json' \
|
|
|
|
|
--data '{
|
|
|
|
|
"messages": [
|
|
|
|
|
{
|
|
|
|
|
"role": "user",
|
|
|
|
|
"content": "what is mcp?"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"thread_id": "test_thread_1",
|
|
|
|
|
"auto_accepted_plan": true
|
|
|
|
|
}'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Human in the Loop Case
|
|
|
|
|
|
|
|
|
|
### Initial Plan
|
|
|
|
|
```
|
|
|
|
|
curl --location 'http://localhost:8000/api/chat/stream' \
|
|
|
|
|
--header 'Accept: */*' \
|
|
|
|
|
--header 'Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \
|
|
|
|
|
--header 'Cache-Control: no-cache' \
|
|
|
|
|
--header 'Connection: keep-alive' \
|
|
|
|
|
--header 'Content-Type: application/json' \
|
|
|
|
|
--data '{
|
|
|
|
|
"messages": [
|
|
|
|
|
{
|
|
|
|
|
"role": "user",
|
|
|
|
|
"content": "what is mcp?"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"thread_id": "test_thread_2",
|
|
|
|
|
"auto_accepted_plan": false
|
|
|
|
|
}'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Edit the plan
|
|
|
|
|
```
|
|
|
|
|
{
|
|
|
|
|
"messages": [
|
|
|
|
|
{
|
|
|
|
|
"role": "user",
|
2025-04-15 16:36:02 +08:00
|
|
|
"content": "make the last step be comprehensive"
|
2025-04-14 18:01:50 +08:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"thread_id": "test_thread_2",
|
|
|
|
|
"auto_accepted_plan": false,
|
2025-04-15 16:36:02 +08:00
|
|
|
"interrupt_feedback": "edit_plan"
|
2025-04-14 18:01:50 +08:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2025-04-15 16:36:02 +08:00
|
|
|
### Accept the plan
|
2025-04-14 18:01:50 +08:00
|
|
|
```
|
|
|
|
|
{
|
|
|
|
|
"thread_id": "test_thread_2",
|
|
|
|
|
"auto_accepted_plan": false,
|
2025-04-15 16:36:02 +08:00
|
|
|
"interrupt_feedback": "accepted"
|
2025-04-14 18:01:50 +08:00
|
|
|
}
|
|
|
|
|
```
|