hjjjj 8b87c3d404
Some checks failed
CI / Unit tests (push) Has been cancelled
CI / commit_lint (push) Has been cancelled
feat: enhance strict compatibility for OpenAI requests
- Implement sanitization for `tool_choice` and removal of `disable_parallel_tool_use` in request payloads.
- Introduce logging for tool choice changes in `DoRequestHelper`.
- Update `ConvertRequest` to handle tool-call compatibility and maintain structured tool history.
- Add `ThoughtSignature` to `Part` struct for better tracking of reasoning content.
- Refactor request handling in `getRequestBody` to ensure strict compliance with OpenAI API requirements.
2026-03-31 16:37:53 +08:00

24 lines
820 B
Go

package model
type Tool struct {
Id string `json:"id,omitempty"`
Type string `json:"type,omitempty"` // when splicing claude tools stream messages, it is empty
Function Function `json:"function"`
ExtraContent *ToolExtraContent `json:"extra_content,omitempty"`
}
type Function struct {
Description string `json:"description,omitempty"`
Name string `json:"name,omitempty"` // when splicing claude tools stream messages, it is empty
Parameters any `json:"parameters,omitempty"` // request
Arguments any `json:"arguments,omitempty"` // response
}
type ToolExtraContent struct {
Google *GoogleToolExtraContent `json:"google,omitempty"`
}
type GoogleToolExtraContent struct {
ThoughtSignature string `json:"thought_signature,omitempty"`
}