fix(translator): allow passthrough of custom generationConfig for all Gemini-like providers
This commit is contained in:
@@ -34,6 +34,11 @@ func ConvertOpenAIRequestToAntigravity(modelName string, inputRawJSON []byte, _
|
|||||||
// Model
|
// Model
|
||||||
out, _ = sjson.SetBytes(out, "model", modelName)
|
out, _ = sjson.SetBytes(out, "model", modelName)
|
||||||
|
|
||||||
|
// Let user-provided generationConfig pass through
|
||||||
|
if genConfig := gjson.GetBytes(rawJSON, "generationConfig"); genConfig.Exists() {
|
||||||
|
out, _ = sjson.SetRawBytes(out, "request.generationConfig", []byte(genConfig.Raw))
|
||||||
|
}
|
||||||
|
|
||||||
// Apply thinking configuration: convert OpenAI reasoning_effort to Gemini CLI thinkingConfig.
|
// Apply thinking configuration: convert OpenAI reasoning_effort to Gemini CLI thinkingConfig.
|
||||||
// Inline translation-only mapping; capability checks happen later in ApplyThinking.
|
// Inline translation-only mapping; capability checks happen later in ApplyThinking.
|
||||||
re := gjson.GetBytes(rawJSON, "reasoning_effort")
|
re := gjson.GetBytes(rawJSON, "reasoning_effort")
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ func ConvertOpenAIRequestToGeminiCLI(modelName string, inputRawJSON []byte, _ bo
|
|||||||
// Model
|
// Model
|
||||||
out, _ = sjson.SetBytes(out, "model", modelName)
|
out, _ = sjson.SetBytes(out, "model", modelName)
|
||||||
|
|
||||||
|
// Let user-provided generationConfig pass through
|
||||||
|
if genConfig := gjson.GetBytes(rawJSON, "generationConfig"); genConfig.Exists() {
|
||||||
|
out, _ = sjson.SetRawBytes(out, "request.generationConfig", []byte(genConfig.Raw))
|
||||||
|
}
|
||||||
|
|
||||||
// Apply thinking configuration: convert OpenAI reasoning_effort to Gemini CLI thinkingConfig.
|
// Apply thinking configuration: convert OpenAI reasoning_effort to Gemini CLI thinkingConfig.
|
||||||
// Inline translation-only mapping; capability checks happen later in ApplyThinking.
|
// Inline translation-only mapping; capability checks happen later in ApplyThinking.
|
||||||
re := gjson.GetBytes(rawJSON, "reasoning_effort")
|
re := gjson.GetBytes(rawJSON, "reasoning_effort")
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ func ConvertOpenAIRequestToGemini(modelName string, inputRawJSON []byte, _ bool)
|
|||||||
// Model
|
// Model
|
||||||
out, _ = sjson.SetBytes(out, "model", modelName)
|
out, _ = sjson.SetBytes(out, "model", modelName)
|
||||||
|
|
||||||
|
// Let user-provided generationConfig pass through
|
||||||
|
if genConfig := gjson.GetBytes(rawJSON, "generationConfig"); genConfig.Exists() {
|
||||||
|
out, _ = sjson.SetRawBytes(out, "generationConfig", []byte(genConfig.Raw))
|
||||||
|
}
|
||||||
|
|
||||||
// Apply thinking configuration: convert OpenAI reasoning_effort to Gemini thinkingConfig.
|
// Apply thinking configuration: convert OpenAI reasoning_effort to Gemini thinkingConfig.
|
||||||
// Inline translation-only mapping; capability checks happen later in ApplyThinking.
|
// Inline translation-only mapping; capability checks happen later in ApplyThinking.
|
||||||
re := gjson.GetBytes(rawJSON, "reasoning_effort")
|
re := gjson.GetBytes(rawJSON, "reasoning_effort")
|
||||||
|
|||||||
Reference in New Issue
Block a user