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
|`GET`|`/api/chatbot/getuserthreads`| Returns latest 10 threads for authenticated user |Falls back to query `user_id` only if `ALLOW_FALLBACK_OLD_AUTH`|
93
-
|`GET`|`/api/chatbot/streamresponse`| Starts an SSE stream of `StreamVariant` JSON payloads | Query params: `thread_id`, `input` (required), `chatbot`|
94
-
|`GET/POST`|`/api/chatbot/stop`| Initiates stopping of an active conversation |Requires auth |
|`POST`|`/api/chatbot/getuserthreads`| Returns recent threads for authenticated user |JSON body: `num_threads`, `page`|
93
+
|`POST`|`/api/chatbot/streamresponse`| Starts an SSE stream of `StreamVariant` JSON payloads | Query params: `thread_id`, `input` (required), `chatbot`|
94
+
|`POST`|`/api/chatbot/stop`| Initiates stopping of an active conversation |JSON body: `thread_id`; requires auth |
95
95
96
96
### Streaming contract
97
97
- Response type: `application/x-ndjson`
98
98
- Each `data:` line is a JSON object with `variant` discriminators (`Assistant`, `Code`, `CodeOutput`, `CodeError`, `Image`, `ServerHint`, `StreamEnd`, etc.).
99
99
- Code tool calls stream incremental chunks while LiteLLM emits `tool_calls`. When the MCP tool resolves, results are converted back into JSON events and appended to Mongo/disk storage.
100
100
- The first chunk is a `ServerHint` carrying the `thread_id`; conversation variants are stored in-memory during streaming and flushed to MongoDB at the end, ensuring replay safety.
101
-
- Clients can call `/api/chatbot/stop?thread_id=...` to move a conversation into `STOPPING`; the streaming loop exits and cancels in-flight MCP requests (code, rag, web-search) via the shared `ActiveRequest` registry.
101
+
- Clients can call `POST /api/chatbot/stop` with `{"thread_id": "..."}` to move a conversation into `STOPPING`; the streaming loop exits and cancels in-flight MCP requests (code, rag, web-search) via the shared `ActiveRequest` registry.
102
102
103
103
## Persistence, Prompts, and Assets
104
104
-**MongoDB (`mongodb_storage.py`)**: canonical record for threads. Each document stores `user_id`, `thread_id`, ISO timestamp, topic (summarized via LiteLLM), and serialized `StreamVariant` list.
0 commit comments