Files
DocsGPT/application
Alex 472918f577 feat(v1): support response_format / response_schema on /v1/chat/completions
Make the OpenAI-compatible Chat Completions endpoint honor per-request
Structured Outputs and keep it OpenAI-compatible.

- translate_request now forwards the request's `response_format` (json_schema)
  or a `response_schema` convenience field to the agent as its json_schema,
  overriding the agent-configured schema for that request.
- Honor `response_format.json_schema.strict` (default true); strict:false
  passes the schema through without forcing additionalProperties:false /
  all-required (OpenAI's lenient mode).
- Support `response_format {"type":"json_object"}` via the provider's native
  JSON mode.
- Keep `content` clean: some models echo their reasoning into content as
  stringified `{'type': 'thought', ...}` reprs when response_format is set.
  Strip those from content and reroute them to `reasoning_content` (OpenAI
  never puts reasoning in content), for both streaming and non-streaming.

Flow: translate_request -> StreamProcessor._configure_agent ->
Agent.json_schema / json_schema_strict / json_object -> _llm_gen ->
prepare_structured_output_format(schema, strict).
2026-06-04 11:51:13 +01:00
..
2026-06-03 14:03:15 +01:00
2026-05-15 12:23:31 +01:00
2026-05-26 15:48:04 +01:00
2026-03-25 22:34:25 +00:00
2026-04-18 13:13:57 +01:00
2026-03-17 14:27:48 +00:00
2026-03-25 00:03:42 +00:00
2026-04-25 14:57:37 +01:00
2026-05-05 01:55:23 +01:00
2026-04-12 00:07:24 +01:00
2025-12-24 18:35:57 +02:00
2026-05-15 12:23:31 +01:00
2026-04-28 02:27:02 +01:00
2026-05-22 16:05:03 +01:00
2026-05-31 18:00:51 +02:00
2026-04-27 22:09:33 +01:00
2026-05-23 02:39:20 +01:00
2026-05-22 16:05:03 +01:00