Skip to content

feat: chat to responses convert filds#600

Merged
zijiren233 merged 1 commit into
labring:mainfrom
zijiren233:chat2responses
Jun 13, 2026
Merged

feat: chat to responses convert filds#600
zijiren233 merged 1 commit into
labring:mainfrom
zijiren233:chat2responses

Conversation

@zijiren233

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Chat Completions → Responses API conversion to cover additional request fields (tools/function-call compatibility, response_format/json_schema, logprobs, parallel tool calls, and multimodal image content), and updates the stream-fake plugin to correctly preserve multiple streamed choices when converting back to a non-streaming Chat Completions response.

Changes:

  • Update stream-fake streaming aggregation to track per-choice state (by choice.index) and emit multiple final choices in the non-stream response.
  • Enhance OpenAI chat→responses request conversion to support legacy functions/function_call, named tool choices, response_formattext.format, logprobs include flags, and image content parts.
  • Extend relay model structs to represent the newly supported request/response fields (schema text format and input_image fields, plus n, modalities, parallel_tool_calls).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
core/relay/plugin/streamfake/fake.go Track streaming deltas per choice.index and rebuild non-stream responses with multiple choices plus prompt-level filter fields.
core/relay/plugin/streamfake/fake_test.go Add/adjust tests for multi-choice preservation and updated choice-state handling in streamfake.
core/relay/model/response.go Expand Responses API structs (text format schema fields; input_image fields on input content).
core/relay/model/completions.go Add Chat Completions request fields needed for conversion (modalities, n, parallel_tool_calls).
core/relay/adaptor/openai/chat.go Convert more Chat Completions fields into Responses API shape (legacy functions/tool_choice flattening, image parts, response_format, logprobs, parallel tool calls).
core/relay/adaptor/openai/chat_test.go Add coverage for new conversions (named tool choice, legacy functions, images, response_format flattening, logprobs include, parallel_tool_calls, and n handling).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zijiren233 zijiren233 merged commit 50f617c into labring:main Jun 13, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants