fix: fix sparkdesk function call
This commit is contained in:
parent
279caf82dc
commit
ff196b75a7
@ -45,8 +45,12 @@ func requestOpenAI2Xunfei(request model.GeneralOpenAIRequest, xunfeiAppId string
|
||||
xunfeiRequest.Payload.Message.Text = messages
|
||||
|
||||
if strings.HasPrefix(domain, "generalv3") {
|
||||
functions := make([]model.Function, len(request.Tools))
|
||||
for i, tool := range request.Tools {
|
||||
functions[i] = tool.Function
|
||||
}
|
||||
xunfeiRequest.Payload.Functions = &Functions{
|
||||
Text: request.Tools,
|
||||
Text: functions,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ type Message struct {
|
||||
}
|
||||
|
||||
type Functions struct {
|
||||
Text []model.Tool `json:"text,omitempty"`
|
||||
Text []model.Function `json:"text,omitempty"`
|
||||
}
|
||||
|
||||
type ChatRequest struct {
|
||||
|
Loading…
Reference in New Issue
Block a user