Add candidate count parameter to OpenAI request

This commit is contained in:
extremk
2026-01-10 18:50:13 +08:00
committed by GitHub
parent 0b5bbe9234
commit 5bb9c2a2bd

View File

@@ -77,6 +77,11 @@ func ConvertGeminiRequestToOpenAI(modelName string, inputRawJSON []byte, stream
}
}
// Candidate count (OpenAI 'n' parameter)
if candidateCount := genConfig.Get("candidateCount"); candidateCount.Exists() {
out, _ = sjson.Set(out, "n", candidateCount.Int())
}
// Convert thinkingBudget to reasoning_effort
// Always perform conversion to support allowCompat models that may not be in registry
if thinkingConfig := genConfig.Get("thinkingConfig"); thinkingConfig.Exists() && thinkingConfig.IsObject() {