change
This commit is contained in:
+9
-2
@@ -41,7 +41,14 @@ async def config() -> dict[str, Any]:
|
||||
providers.append({
|
||||
"id": provider.id,
|
||||
"label": provider.label,
|
||||
"models": [{"id": model.id, "vision": model.vision} for model in provider.models],
|
||||
"models": [
|
||||
{
|
||||
"id": model.id,
|
||||
"vision": model.vision,
|
||||
"strict_tool_schema": model.strict_tool_schema,
|
||||
}
|
||||
for model in provider.models
|
||||
],
|
||||
})
|
||||
return {
|
||||
"default_provider": settings.default_provider_id,
|
||||
@@ -56,7 +63,7 @@ async def config() -> dict[str, Any]:
|
||||
@app.post("/v1/chat/stream")
|
||||
async def chat_stream(payload: ChatRequest) -> StreamingResponse:
|
||||
return StreamingResponse(
|
||||
agent.stream(payload.messages, payload.conversation_id, payload.selected_task_id, payload.provider_id, payload.model_id),
|
||||
agent.stream(payload.messages, payload.conversation_id, payload.selected_task_id, payload.provider_id, payload.model_id, payload.viewer_context),
|
||||
media_type="text/event-stream",
|
||||
headers={"Cache-Control": "no-cache", "X-Accel-Buffering": "no"},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user