1+ using System . Text . Json . Serialization ;
2+
3+ namespace ClaudeCodeProxy . Abstraction . Anthropic ;
4+
5+ public class AnthropicStreamDto
6+ {
7+ [ JsonPropertyName ( "type" ) ] public string ? Type { get ; set ; }
8+
9+ [ JsonPropertyName ( "index" ) ] public int ? Index { get ; set ; }
10+
11+ [ JsonPropertyName ( "content_block" ) ] public AnthropicChatCompletionDtoContentBlock ? ContentBlock { get ; set ; }
12+
13+ [ JsonPropertyName ( "delta" ) ] public AnthropicChatCompletionDtoDelta ? Delta { get ; set ; }
14+
15+ [ JsonPropertyName ( "message" ) ] public AnthropicChatCompletionDto ? Message { get ; set ; }
16+
17+ [ JsonPropertyName ( "usage" ) ] public AnthropicCompletionDtoUsage ? Usage { get ; set ; }
18+
19+ [ JsonPropertyName ( "error" ) ] public AnthropicStreamErrorDto ? Error { get ; set ; }
20+ }
21+
22+ public class AnthropicStreamErrorDto
23+ {
24+ [ JsonPropertyName ( "type" ) ] public string ? Type { get ; set ; }
25+
26+ [ JsonPropertyName ( "message" ) ] public string ? Message { get ; set ; }
27+ }
28+
29+ public class AnthropicChatCompletionDtoDelta
30+ {
31+ [ JsonPropertyName ( "type" ) ] public string ? Type { get ; set ; }
32+
33+ [ JsonPropertyName ( "text" ) ] public string ? Text { get ; set ; }
34+
35+ [ JsonPropertyName ( "thinking" ) ] public string ? Thinking { get ; set ; }
36+
37+ [ JsonPropertyName ( "partial_json" ) ] public string ? PartialJson { get ; set ; }
38+
39+ [ JsonPropertyName ( "stop_reason" ) ] public string ? StopReason { get ; set ; }
40+ }
41+
42+ public class AnthropicChatCompletionDtoContentBlock
43+ {
44+ [ JsonPropertyName ( "type" ) ] public string ? Type { get ; set ; }
45+
46+ [ JsonPropertyName ( "thinking" ) ] public string ? Thinking { get ; set ; }
47+
48+ [ JsonPropertyName ( "signature" ) ] public string ? Signature { get ; set ; }
49+
50+ [ JsonPropertyName ( "id" ) ] public string ? Id { get ; set ; }
51+
52+ [ JsonPropertyName ( "name" ) ] public string ? Name { get ; set ; }
53+
54+ [ JsonPropertyName ( "input" ) ] public object ? Input { get ; set ; }
55+
56+ [ JsonPropertyName ( "server_name" ) ] public string ? ServerName { get ; set ; }
57+
58+ [ JsonPropertyName ( "is_error" ) ] public bool ? IsError { get ; set ; }
59+
60+ [ JsonPropertyName ( "tool_use_id" ) ] public string ? ToolUseId { get ; set ; }
61+
62+ [ JsonPropertyName ( "content" ) ] public object ? Content { get ; set ; }
63+ }
64+
65+ public class AnthropicChatCompletionDto
66+ {
67+ public string id { get ; set ; }
68+
69+ public string type { get ; set ; }
70+
71+ public string role { get ; set ; }
72+
73+ public AnthropicChatCompletionDtoContent [ ] content { get ; set ; }
74+
75+ public string model { get ; set ; }
76+
77+ public string stop_reason { get ; set ; }
78+
79+ public object stop_sequence { get ; set ; }
80+
81+ public AnthropicCompletionDtoUsage Usage { get ; set ; }
82+ }
83+
84+ public class AnthropicChatCompletionDtoContent
85+ {
86+ public string type { get ; set ; }
87+
88+ public string ? text { get ; set ; }
89+
90+ public string ? id { get ; set ; }
91+
92+ public string ? name { get ; set ; }
93+
94+ public object ? input { get ; set ; }
95+
96+ [ JsonPropertyName ( "thinking" ) ] public string ? Thinking { get ; set ; }
97+
98+ public string ? signature { get ; set ; }
99+ }
100+
101+ public class AnthropicCompletionDtoUsage
102+ {
103+ [ JsonPropertyName ( "input_tokens" ) ] public int ? InputTokens { get ; set ; }
104+
105+ [ JsonPropertyName ( "cache_creation_input_tokens" ) ]
106+ public int ? CacheCreationInputTokens { get ; set ; }
107+
108+ [ JsonPropertyName ( "cache_read_input_tokens" ) ]
109+ public int ? CacheReadInputTokens { get ; set ; }
110+
111+ [ JsonPropertyName ( "output_tokens" ) ] public int ? OutputTokens { get ; set ; }
112+
113+ [ JsonPropertyName ( "server_tool_use" ) ] public AnthropicServerToolUse ? ServerToolUse { get ; set ; }
114+ }
115+
116+ public class AnthropicServerToolUse
117+ {
118+ [ JsonPropertyName ( "web_search_requests" ) ]
119+ public int ? WebSearchRequests { get ; set ; }
120+ }
0 commit comments