dto.go 943 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package palm
  2. import "one-api/dto"
  3. type PaLMChatMessage struct {
  4. Author string `json:"author"`
  5. Content string `json:"content"`
  6. }
  7. type PaLMFilter struct {
  8. Reason string `json:"reason"`
  9. Message string `json:"message"`
  10. }
  11. type PaLMPrompt struct {
  12. Messages []PaLMChatMessage `json:"messages"`
  13. }
  14. type PaLMChatRequest struct {
  15. Prompt PaLMPrompt `json:"prompt"`
  16. Temperature *float64 `json:"temperature,omitempty"`
  17. CandidateCount int `json:"candidateCount,omitempty"`
  18. TopP float64 `json:"topP,omitempty"`
  19. TopK uint `json:"topK,omitempty"`
  20. }
  21. type PaLMError struct {
  22. Code int `json:"code"`
  23. Message string `json:"message"`
  24. Status string `json:"status"`
  25. }
  26. type PaLMChatResponse struct {
  27. Candidates []PaLMChatMessage `json:"candidates"`
  28. Messages []dto.Message `json:"messages"`
  29. Filters []PaLMFilter `json:"filters"`
  30. Error PaLMError `json:"error"`
  31. }