Is lets errors.Is(err, ErrMaxTokensExceeded) match the budget refusal without the caller inspecting the status code or the body.
(target error)
| 126 | // Is lets errors.Is(err, ErrMaxTokensExceeded) match the budget refusal |
| 127 | // without the caller inspecting the status code or the body. |
| 128 | func (e *APIError) Is(target error) bool { |
| 129 | return target == ErrMaxTokensExceeded && e.ErrorType == "max_tokens_exceeded" |
| 130 | } |
| 131 | |
| 132 | // typesafeProvider is the typesafe.ai Jev backend. |
| 133 | type typesafeProvider struct { |
no outgoing calls