feat(chat): add response_format passthrough for structured output #60
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_aibroker!60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_json_schema"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #59.
Forwards an OpenAI-style
response_formatfield through the broker to upstream providers. Pass-through only — no broker-side schema validation.ChatRequest.response_format: Option<Value>(forwarded unchanged via existing.json(&request)serialisation)OpenAIChatRequest.response_format(REST POST /v1/chat/completions)ai.chatJSON-RPC accepts the new optional paramopenrpc.jsonupdatedUnblocks hero_memory Phases 4 (Q&A) and 5 (ontology) — see hero_memory#1.
Ready to merge once reviewed.
Forwards an OpenAI-style response_format field through the broker to the upstream provider. Enables JSON-schema-constrained completions, which hero_memory's Q&A and ontology extractors depend on (see hero_aibroker#59). - providers/types.rs: ChatRequest gains optional response_format: Option<serde_json::Value>. The OpenAIProvider already serialises ChatRequest directly to the upstream HTTP body, so the field is forwarded unchanged. - server/src/api/chat.rs: OpenAIChatRequest gains response_format and the From<OpenAIChatRequest> for ChatRequest impl carries it across. - server/src/api/mod.rs: handle_ai_chat reads response_format from params. - openrpc.json: ai.chat documents the optional response_format parameter. Pass-through only — no aibroker-side schema validation. Callers send either { "type": "json_schema", "json_schema": {...} } or { "type": "json_object" } according to the upstream provider's spec. Refs hero_aibroker#59 Refs hero_memory#1 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>Closing as redundant. Upstream
developmentalready implementsresponse_formatonai.chat(with a typedResponseFormat { kind, json_schema }struct inproviders/types.rsplus the openrpc.json param), as part of the cascade-multi-broker work that landed after I branched. hero_memory will pin todevelopmentdirectly.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.