dto.go 1.2 KB

123456789101112131415161718192021222324252627
  1. package xai
  2. import "one-api/dto"
  3. // ChatCompletionResponse represents the response from XAI chat completion API
  4. type ChatCompletionResponse struct {
  5. Id string `json:"id"`
  6. Object string `json:"object"`
  7. Created int64 `json:"created"`
  8. Model string `json:"model"`
  9. Choices []dto.OpenAITextResponseChoice `json:"choices"`
  10. Usage *dto.Usage `json:"usage"`
  11. SystemFingerprint string `json:"system_fingerprint"`
  12. }
  13. // quality, size or style are not supported by xAI API at the moment.
  14. type ImageRequest struct {
  15. Model string `json:"model"`
  16. Prompt string `json:"prompt" binding:"required"`
  17. N int `json:"n,omitempty"`
  18. // Size string `json:"size,omitempty"`
  19. // Quality string `json:"quality,omitempty"`
  20. ResponseFormat string `json:"response_format,omitempty"`
  21. // Style string `json:"style,omitempty"`
  22. // User string `json:"user,omitempty"`
  23. // ExtraFields json.RawMessage `json:"extra_fields,omitempty"`
  24. }