Skip to content

feat: add stream field to UserInput for body-controlled SSE streaming#226

Closed
hillhack wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
hillhack:jyoti_dev
Closed

feat: add stream field to UserInput for body-controlled SSE streaming#226
hillhack wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
hillhack:jyoti_dev

Conversation

@hillhack
Copy link

@hillhack hillhack commented Feb 28, 2026

Summary of Changes

File Change
response_model.py Added stream: bool = False to UserInput.
conversations.py Introduced a unified POST /conversations/agent-retriever endpoint. Returns StreamingResponse when stream=true and ChatResponse when stream=false. Set response_model=None to skip FastAPI schema inference for union responses. Kept /agent-retriever/stream as a backward-compatible alias.
ui.py Updated proxy logic to inspect stream in the request body. Uses httpx streaming context manager (timeout=None) for SSE passthrough when stream=true; falls back to standard buffered response otherwise.
test_api_conversations_streaming.py Updated all existing UserInput(...) calls to explicitly set stream=False. Added two tests in TestUnifiedEndpointStreamBranching: one verifies stream=true returns StreamingResponse, the other verifies stream=false returns ChatResponse.

Usage

Non-Streaming (default behavior)

{ "query": "How do I install OpenROAD?", "stream": false }```

###Streaming (SSE)

```POST /conversations/agent-retriever
{ "query": "How do I install OpenROAD?", "stream": true }```
https://github.com/The-OpenROAD-Project/ORAssistant/issues/157

Signed-off-by: hillhack <2jyotihill@gmail.com>
@hillhack hillhack mentioned this pull request Feb 28, 2026
2 tasks
@hillhack hillhack closed this by deleting the head repository Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant