| 38 | func (e StreamIdleTimeoutError) Error() string { |
| 39 | seconds := int(e.Timeout.Round(time.Second) / time.Second) |
| 40 | if seconds <= 0 { |
| 41 | return "API stream idle timeout waiting for SSE data" |
| 42 | } |
| 43 | return fmt.Sprintf("API stream idle timeout after %ds waiting for SSE data", seconds) |
| 44 | } |
| 45 | |
| 46 | type CacheEdit struct { |
| 47 | ToolUseID string `json:"tool_use_id"` |
| 48 | Action string `json:"action"` |
| 49 | } |
| 50 | |
| 51 | type Response struct { |
| 52 | Text string `json:"text"` |
| 53 | ToolCalls []map[string]any `json:"tool_calls"` |
| 54 | StopReason string `json:"stop_reason"` |
| 55 | InputTokens int `json:"input_tokens"` |
| 56 | OutputTokens int `json:"output_tokens"` |
| 57 | } |
| 58 |
no outgoing calls
no test coverage detected