fix: gemini request -> openai tool call

This commit is contained in:
Seefs
2025-12-31 18:09:21 +08:00
parent b808b96cce
commit ddb40b1a6e
2 changed files with 15 additions and 14 deletions

View File

@@ -126,7 +126,7 @@ func (r *GeminiChatRequest) SetModelName(modelName string) {
func (r *GeminiChatRequest) GetTools() []GeminiChatTool {
var tools []GeminiChatTool
if strings.HasSuffix(string(r.Tools), "[") {
if strings.HasPrefix(string(r.Tools), "[") {
// is array
if err := common.Unmarshal(r.Tools, &tools); err != nil {
logger.LogError(nil, "error_unmarshalling_tools: "+err.Error())