Map missing model settings to OpenAI API params
FrequencyPenalty, PresencePenalty, and ParallelToolCalls were present on ChatCompletionRequest but never forwarded in buildParams, so agent-level settings configured via functional options were silently ignored for the OpenAI provider. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -140,6 +140,12 @@ func buildParams(req *llm.ChatCompletionRequest) openai.ChatCompletionNewParams
|
|||||||
if req.TopP != nil {
|
if req.TopP != nil {
|
||||||
params.TopP = param.NewOpt(*req.TopP)
|
params.TopP = param.NewOpt(*req.TopP)
|
||||||
}
|
}
|
||||||
|
if req.FrequencyPenalty != nil {
|
||||||
|
params.FrequencyPenalty = param.NewOpt(*req.FrequencyPenalty)
|
||||||
|
}
|
||||||
|
if req.PresencePenalty != nil {
|
||||||
|
params.PresencePenalty = param.NewOpt(*req.PresencePenalty)
|
||||||
|
}
|
||||||
if len(req.StopSequences) > 0 {
|
if len(req.StopSequences) > 0 {
|
||||||
params.Stop = openai.ChatCompletionNewParamsStopUnion{
|
params.Stop = openai.ChatCompletionNewParamsStopUnion{
|
||||||
OfStringArray: req.StopSequences,
|
OfStringArray: req.StopSequences,
|
||||||
@@ -151,6 +157,9 @@ func buildParams(req *llm.ChatCompletionRequest) openai.ChatCompletionNewParams
|
|||||||
if req.ToolChoice != nil {
|
if req.ToolChoice != nil {
|
||||||
params.ToolChoice = buildToolChoice(req.ToolChoice)
|
params.ToolChoice = buildToolChoice(req.ToolChoice)
|
||||||
}
|
}
|
||||||
|
if req.ParallelToolCalls != nil {
|
||||||
|
params.ParallelToolCalls = param.NewOpt(*req.ParallelToolCalls)
|
||||||
|
}
|
||||||
if req.ResponseFormat != nil {
|
if req.ResponseFormat != nil {
|
||||||
params.ResponseFormat = buildResponseFormat(req.ResponseFormat)
|
params.ResponseFormat = buildResponseFormat(req.ResponseFormat)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user