mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-17 21:53:42 +08:00
✨ feat: xunfei support functions
This commit is contained in:
@@ -7,30 +7,45 @@ type XunfeiMessage struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type XunfeiChatPayloadMessage struct {
|
||||
Text []XunfeiMessage `json:"text"`
|
||||
}
|
||||
|
||||
type XunfeiChatPayloadFunctions struct {
|
||||
Text []*types.ChatCompletionFunction `json:"text"`
|
||||
}
|
||||
|
||||
type XunfeiChatPayload struct {
|
||||
Message XunfeiChatPayloadMessage `json:"message"`
|
||||
Functions *XunfeiChatPayloadFunctions `json:"functions,omitempty"`
|
||||
}
|
||||
|
||||
type XunfeiParameterChat struct {
|
||||
Domain string `json:"domain,omitempty"`
|
||||
Temperature float64 `json:"temperature,omitempty"`
|
||||
TopK int `json:"top_k,omitempty"`
|
||||
MaxTokens int `json:"max_tokens,omitempty"`
|
||||
Auditing bool `json:"auditing,omitempty"`
|
||||
}
|
||||
|
||||
type XunfeiChatRequestParameter struct {
|
||||
Chat XunfeiParameterChat `json:"chat"`
|
||||
}
|
||||
|
||||
type XunfeiChatRequest struct {
|
||||
Header struct {
|
||||
AppId string `json:"app_id"`
|
||||
} `json:"header"`
|
||||
Parameter struct {
|
||||
Chat struct {
|
||||
Domain string `json:"domain,omitempty"`
|
||||
Temperature float64 `json:"temperature,omitempty"`
|
||||
TopK int `json:"top_k,omitempty"`
|
||||
MaxTokens int `json:"max_tokens,omitempty"`
|
||||
Auditing bool `json:"auditing,omitempty"`
|
||||
} `json:"chat"`
|
||||
} `json:"parameter"`
|
||||
Payload struct {
|
||||
Message struct {
|
||||
Text []XunfeiMessage `json:"text"`
|
||||
} `json:"message"`
|
||||
} `json:"payload"`
|
||||
Parameter XunfeiChatRequestParameter `json:"parameter"`
|
||||
Payload XunfeiChatPayload `json:"payload"`
|
||||
}
|
||||
|
||||
type XunfeiChatResponseTextItem struct {
|
||||
Content string `json:"content"`
|
||||
Role string `json:"role"`
|
||||
Index int `json:"index"`
|
||||
Content string `json:"content"`
|
||||
Role string `json:"role"`
|
||||
Index int `json:"index"`
|
||||
ContentType string `json:"content_type,omitempty"`
|
||||
FunctionCall *types.ChatCompletionToolCallsFunction `json:"function_call,omitempty"`
|
||||
}
|
||||
|
||||
type XunfeiChatResponse struct {
|
||||
|
||||
Reference in New Issue
Block a user