response.go 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package dto
  2. type TextResponse struct {
  3. Choices []OpenAITextResponseChoice `json:"choices"`
  4. Usage `json:"usage"`
  5. Error OpenAIError `json:"error"`
  6. }
  7. type OpenAITextResponseChoice struct {
  8. Index int `json:"index"`
  9. Message `json:"message"`
  10. FinishReason string `json:"finish_reason"`
  11. }
  12. type OpenAITextResponse struct {
  13. Id string `json:"id"`
  14. Object string `json:"object"`
  15. Created int64 `json:"created"`
  16. Choices []OpenAITextResponseChoice `json:"choices"`
  17. Usage `json:"usage"`
  18. }
  19. type OpenAIEmbeddingResponseItem struct {
  20. Object string `json:"object"`
  21. Index int `json:"index"`
  22. Embedding []float64 `json:"embedding"`
  23. }
  24. type OpenAIEmbeddingResponse struct {
  25. Object string `json:"object"`
  26. Data []OpenAIEmbeddingResponseItem `json:"data"`
  27. Model string `json:"model"`
  28. Usage `json:"usage"`
  29. }
  30. type ImageResponse struct {
  31. Created int `json:"created"`
  32. Data []struct {
  33. Url string `json:"url"`
  34. B64Json string `json:"b64_json"`
  35. }
  36. }
  37. type ChatCompletionsStreamResponseChoice struct {
  38. Delta struct {
  39. Content string `json:"content"`
  40. } `json:"delta"`
  41. FinishReason *string `json:"finish_reason,omitempty"`
  42. }
  43. type ChatCompletionsStreamResponse struct {
  44. Id string `json:"id"`
  45. Object string `json:"object"`
  46. Created int64 `json:"created"`
  47. Model string `json:"model"`
  48. Choices []ChatCompletionsStreamResponseChoice `json:"choices"`
  49. }
  50. type ChatCompletionsStreamResponseSimple struct {
  51. Choices []ChatCompletionsStreamResponseChoice `json:"choices"`
  52. }
  53. type CompletionsStreamResponse struct {
  54. Choices []struct {
  55. Text string `json:"text"`
  56. FinishReason string `json:"finish_reason"`
  57. } `json:"choices"`
  58. }
  59. type MidjourneyRequest struct {
  60. Prompt string `json:"prompt"`
  61. NotifyHook string `json:"notifyHook"`
  62. Action string `json:"action"`
  63. Index int `json:"index"`
  64. State string `json:"state"`
  65. TaskId string `json:"taskId"`
  66. Base64Array []string `json:"base64Array"`
  67. Content string `json:"content"`
  68. }
  69. type MidjourneyResponse struct {
  70. Code int `json:"code"`
  71. Description string `json:"description"`
  72. Properties interface{} `json:"properties"`
  73. Result string `json:"result"`
  74. }