return tool calls finish reason for openai (#5995)
* hot fix * backend stream support * clean up * finish reason * move to openai
This commit is contained in:
parent
161e12cecf
commit
365431d406
1 changed files with 3 additions and 0 deletions
|
@ -218,6 +218,9 @@ func toChatCompletion(id string, r api.ChatResponse) ChatCompletion {
|
||||||
Index: 0,
|
Index: 0,
|
||||||
Message: Message{Role: r.Message.Role, Content: r.Message.Content, ToolCalls: toolCalls},
|
Message: Message{Role: r.Message.Role, Content: r.Message.Content, ToolCalls: toolCalls},
|
||||||
FinishReason: func(reason string) *string {
|
FinishReason: func(reason string) *string {
|
||||||
|
if len(toolCalls) > 0 {
|
||||||
|
reason = "tool_calls"
|
||||||
|
}
|
||||||
if len(reason) > 0 {
|
if len(reason) > 0 {
|
||||||
return &reason
|
return &reason
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue