Skip to content

Conversation

@bbbugg
Copy link
Collaborator

@bbbugg bbbugg commented Jan 7, 2026

  • 支持Openai 接口的工具调用
  • 支持Gemini 3系列的模型工具调用,补全thoughtSignature
  • 启用日志等级,默认INFO,可以通过UI和环境变量设为DEBUG

相关文档:https://ai.google.dev/gemini-api/docs/thought-signatures?hl=zh-cn

Copy link

Copilot AI left a comment

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 adds comprehensive support for OpenAI tools/function calling by implementing bidirectional conversion between OpenAI and Gemini API formats. The implementation handles tool call requests, tool responses, and ensures compatibility with Gemini's thoughtSignature requirements.

  • Converts OpenAI tool_calls and tool role messages to Gemini functionCall/functionResponse format
  • Converts Gemini functionCall responses back to OpenAI tool_calls format for both streaming and non-streaming responses
  • Adds thoughtSignature placeholder handling to bypass Gemini API validation requirements

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 25 comments.

File Description
src/core/FormatConverter.js Implements core translation logic for OpenAI tools ↔ Gemini function calling, including tool definition conversion, message buffering for consecutive tool messages, and bidirectional response translation for both streaming and non-streaming modes
src/core/RequestHandler.js Integrates thoughtSignature validation bypass by calling ensureThoughtSignature for native Google requests with function calls/responses

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

@bbbugg bbbugg force-pushed the feat/openai-tools branch from 78c3069 to b7f5432 Compare January 8, 2026 15:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 14 comments.


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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@iBenzene iBenzene merged commit e645eb8 into main Jan 10, 2026
@bbbugg bbbugg deleted the feat/openai-tools branch January 10, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants