Skip to content

Commit 271e206

Browse files
authored
[fix][model] Verified fix of openai error (#209)
Verified fix of openai error
1 parent e4b7973 commit 271e206

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • backend/modules/llm/domain/service/llmimpl/eino

backend/modules/llm/domain/service/llmimpl/eino/init.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ func openAIBuilder(ctx context.Context, model *entity.Model, opts ...entity.Opti
135135
if err := sonic.UnmarshalString(pc.ResponseFormatJsonSchema, &js); err != nil {
136136
return nil, err
137137
}
138-
cfg.ResponseFormat = &acl_openai.ChatCompletionResponseFormat{
139-
Type: acl_openai.ChatCompletionResponseFormatType(pc.ResponseFormatType),
140-
JSONSchema: &js,
138+
if pc.ResponseFormatType != "" {
139+
cfg.ResponseFormat = &acl_openai.ChatCompletionResponseFormat{
140+
Type: acl_openai.ChatCompletionResponseFormatType(pc.ResponseFormatType),
141+
JSONSchema: &js,
142+
}
141143
}
142144
}
143145
}

0 commit comments

Comments
 (0)