feat(router): add OpenAI Responses API and Home Assistant model support (#374) - #383
Conversation
…one event injection for HA Assist
- Set supports_reasoning to false in litellm/config.yaml for non-thinking hass aliases (local-qwen-3.6-hass, gpt-4o-mini, gpt-4o) - Support input_text and text content parts, traverse input in reverse to extract the latest user turn for triage, and join multi-part text with space separators - Validate upstream status_code in streaming branch before returning StreamingResponse and close stream on exit - Expand pytest suite to cover input_text parsing and streaming error status propagation
- Parameterize test_responses_api_with_tools and test_responses_api_streaming_tool_calls across local-qwen-3.6-hass, gpt-4o-mini, and gpt-4o - Add test_ha_tool_calling function to scripts/verification/verify_canonical_endpoints.py to replicate Home Assistant Assist tool call execution via /v1/responses and /v1/chat/completions
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
🧙 Sourcery is reviewing your pull request! Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Warning Review limit reached
Next review available in:50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Uh oh!
There was an error while loading. Please reload this page.
Summary
This PR addresses issue #374 by implementing OpenAI Responses API support, streaming SSE tool call argument event synthesis, and Home Assistant model aliases required by Home Assistant's
openai_conversationintegration.Changes Included
Responses API Endpoints:
POST /v1/responsesandPOST /responseshandlers inrouter/main.pyproxying requests to LiteLLM's/v1/responsesendpoint.llm-routing-auto-free,llm-routing-ollama) are requested.input_textandtextcontent part types, extracts the latest user turn in reverse order, and joins multi-part strings with space separators.response.function_call_arguments.deltaandresponse.function_call_arguments.doneSSE events during streaming for Home Assistant compatibility.Model Aliases & Configuration:
local-qwen-3.6-hass,gpt-4o-mini, andgpt-4omodel definitions tolitellm/config.yamlwithenable_thinking: falseandsupports_reasoning: false.public_model_groupssoGET /v1/modelslists them.DIRECT_TIERSinrouter/main.pyto bypass classifier overhead when specified directly.Tool Support & E2E Validation:
functiontool type returningfunction_calloutput),code_interpreter, andweb_search.test_ha_tool_callingtoscripts/verification/verify_canonical_endpoints.pytesting E2E tool calling acrosslocal-qwen-3.6-hass,gpt-4o-mini, andgpt-4ofor both/v1/responsesand/v1/chat/completions.Testing & Documentation:
router/tests/test_responses_api.pycovering model routing, Responses API requests, parameterized tool calls, streaming SSE deltas, input extraction, and error handling (372/372 tests passing).README.mddetailing Home Assistant configuration and capability requirements.Closes#374
Supersedes #382
Summary by Sourcery
Add OpenAI-compatible Responses and audio proxy endpoints and extend model support and testing for Home Assistant integration.
New Features:
Enhancements:
Documentation:
Tests: