Skip to content

Improve OpenAI compatibility for tool calls, Responses output, and errors#113

Open
robberphex wants to merge 2 commits into
RayBytes:mainfrom
robberphex:fix/openai-api-compat
Open

Improve OpenAI compatibility for tool calls, Responses output, and errors#113
robberphex wants to merge 2 commits into
RayBytes:mainfrom
robberphex:fix/openai-api-compat

Conversation

@robberphex

Copy link
Copy Markdown

Summary

  • Normalize official OpenAI function tool_choice format for Chat Completions and Responses API.
  • Return cleaner non-streaming /v1/responses objects by avoiding internal fields like instructions.
  • Add OpenAI-style error fields: message, type, param, and code.
  • Preserve reasoning summaries and final output in /v1/responses.
  • Add regression tests for tool calling, compact Responses output, error shape, and reasoning summary behavior.

Tests

  • uv run python -m unittest tests.test_routes tests.test_models tests.test_fast_mode

摘要

  • 兼容 OpenAI 官方的 function tool_choice 格式,覆盖 Chat Completions 和 Responses API。
  • 清理非流式 /v1/responses 返回,避免暴露 instructions 等内部字段。
  • 补齐 OpenAI 风格错误字段:messagetypeparamcode
  • 保留 /v1/responses 中可展示的 reasoning summary 和最终输出。
  • 增加回归测试,覆盖工具调用、Responses 输出裁剪、错误结构和 reasoning summary 行为。

测试

  • uv run python -m unittest tests.test_routes tests.test_models tests.test_fast_mode

Robert Lu and others added 2 commits June 23, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant