Explorar o código

fix: openrouter require_parameters

adamdottv hai 1 ano
pai
achega
e387b1f16c
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      internal/llm/provider/openai.go

+ 8 - 0
internal/llm/provider/openai.go

@@ -182,6 +182,14 @@ func (o *openaiClient) preparedParams(messages []openai.ChatCompletionMessagePar
 		params.MaxTokens = openai.Int(o.providerOptions.maxTokens)
 	}
 
+	if o.providerOptions.model.Provider == models.ProviderOpenRouter {
+		params.WithExtraFields(map[string]any{
+			"provider": map[string]any{
+				"require_parameters": true,
+			},
+		})
+	}
+
 	return params
 }