String returns the human-readable name.
()
| 29 | |
| 30 | // String returns the human-readable name. |
| 31 | func (ec ErrorClass) String() string { |
| 32 | switch ec { |
| 33 | case ErrorClassRateLimit: |
| 34 | return "rate_limit" |
| 35 | case ErrorClassTimeout: |
| 36 | return "timeout" |
| 37 | case ErrorClassAuth: |
| 38 | return "auth_error" |
| 39 | case ErrorClassServerError: |
| 40 | return "server_error" |
| 41 | case ErrorClassModelNotFound: |
| 42 | return "model_not_found" |
| 43 | case ErrorClassContextTooLong: |
| 44 | return "context_too_long" |
| 45 | default: |
| 46 | return "unknown" |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // ProviderHealth tracks the health of a provider. |
| 51 | type ProviderHealth struct { |
no outgoing calls