dto.go 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. package claude
  2. //
  3. //type ClaudeMetadata struct {
  4. // UserId string `json:"user_id"`
  5. //}
  6. //
  7. //type ClaudeMediaMessage struct {
  8. // Type string `json:"type"`
  9. // Text string `json:"text,omitempty"`
  10. // Source *ClaudeMessageSource `json:"source,omitempty"`
  11. // Usage *ClaudeUsage `json:"usage,omitempty"`
  12. // StopReason *string `json:"stop_reason,omitempty"`
  13. // PartialJson string `json:"partial_json,omitempty"`
  14. // Thinking string `json:"thinking,omitempty"`
  15. // Signature string `json:"signature,omitempty"`
  16. // Delta string `json:"delta,omitempty"`
  17. // // tool_calls
  18. // Id string `json:"id,omitempty"`
  19. // Name string `json:"name,omitempty"`
  20. // Input any `json:"input,omitempty"`
  21. // Content string `json:"content,omitempty"`
  22. // ToolUseId string `json:"tool_use_id,omitempty"`
  23. //}
  24. //
  25. //type ClaudeMessageSource struct {
  26. // Type string `json:"type"`
  27. // MediaType string `json:"media_type"`
  28. // Data string `json:"data"`
  29. //}
  30. //
  31. //type ClaudeMessage struct {
  32. // Role string `json:"role"`
  33. // Content any `json:"content"`
  34. //}
  35. //
  36. //type Tool struct {
  37. // Name string `json:"name"`
  38. // Description string `json:"description,omitempty"`
  39. // InputSchema map[string]interface{} `json:"input_schema"`
  40. //}
  41. //
  42. //type InputSchema struct {
  43. // Type string `json:"type"`
  44. // Properties any `json:"properties,omitempty"`
  45. // Required any `json:"required,omitempty"`
  46. //}
  47. //
  48. //type ClaudeRequest struct {
  49. // Model string `json:"model"`
  50. // Prompt string `json:"prompt,omitempty"`
  51. // System string `json:"system,omitempty"`
  52. // Messages []ClaudeMessage `json:"messages,omitempty"`
  53. // MaxTokens uint `json:"max_tokens,omitempty"`
  54. // MaxTokensToSample uint `json:"max_tokens_to_sample,omitempty"`
  55. // StopSequences []string `json:"stop_sequences,omitempty"`
  56. // Temperature *float64 `json:"temperature,omitempty"`
  57. // TopP float64 `json:"top_p,omitempty"`
  58. // TopK int `json:"top_k,omitempty"`
  59. // //ClaudeMetadata `json:"metadata,omitempty"`
  60. // Stream bool `json:"stream,omitempty"`
  61. // Tools any `json:"tools,omitempty"`
  62. // ToolChoice any `json:"tool_choice,omitempty"`
  63. // Thinking *Thinking `json:"thinking,omitempty"`
  64. //}
  65. //
  66. //type Thinking struct {
  67. // Type string `json:"type"`
  68. // BudgetTokens int `json:"budget_tokens"`
  69. //}
  70. //
  71. //type ClaudeError struct {
  72. // Type string `json:"type"`
  73. // Message string `json:"message"`
  74. //}
  75. //
  76. //type ClaudeResponse struct {
  77. // Id string `json:"id"`
  78. // Type string `json:"type"`
  79. // Content []ClaudeMediaMessage `json:"content"`
  80. // Completion string `json:"completion"`
  81. // StopReason string `json:"stop_reason"`
  82. // Model string `json:"model"`
  83. // Error ClaudeError `json:"error"`
  84. // Usage ClaudeUsage `json:"usage"`
  85. // Index int `json:"index"` // stream only
  86. // ContentBlock *ClaudeMediaMessage `json:"content_block"`
  87. // Delta *ClaudeMediaMessage `json:"delta"` // stream only
  88. // Message *ClaudeResponse `json:"message"` // stream only: message_start
  89. //}
  90. //
  91. //type ClaudeUsage struct {
  92. // InputTokens int `json:"input_tokens"`
  93. // OutputTokens int `json:"output_tokens"`
  94. //}