feat: add xAI handling and response processing

This commit is contained in:
CaIon
2025-04-10 17:20:59 +08:00
parent 8efa12b941
commit 8723e3f239
6 changed files with 137 additions and 9 deletions

14
relay/channel/xai/dto.go Normal file
View File

@@ -0,0 +1,14 @@
package xai
import "one-api/dto"
// ChatCompletionResponse represents the response from XAI chat completion API
type ChatCompletionResponse struct {
Id string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Choices []dto.ChatCompletionsStreamResponseChoice
Usage *dto.Usage `json:"usage"`
SystemFingerprint string `json:"system_fingerprint"`
}