mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-17 13:43:42 +08:00
🐛 fix: function call error (#190)
This commit is contained in:
@@ -111,6 +111,21 @@ func (m ChatCompletionMessage) ParseContent() []ChatMessagePart {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ChatCompletionMessage) FuncToToolCalls() {
|
||||
if m.ToolCalls != nil {
|
||||
return
|
||||
}
|
||||
if m.FunctionCall != nil {
|
||||
m.ToolCalls = []*ChatCompletionToolCalls{
|
||||
{
|
||||
Type: ChatMessageRoleFunction,
|
||||
Function: m.FunctionCall,
|
||||
},
|
||||
}
|
||||
m.FunctionCall = nil
|
||||
}
|
||||
}
|
||||
|
||||
type ChatMessageImageURL struct {
|
||||
URL string `json:"url,omitempty"`
|
||||
Detail string `json:"detail,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user