Fix goal recovery
This commit is contained in:
parent
3846556035
commit
996f586bc1
1 changed files with 783 additions and 145 deletions
|
|
@ -57,16 +57,6 @@ func (e *errorInfo) UnmarshalJSON(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (e errorInfo) retryable() bool {
|
||||
switch e.Kind {
|
||||
case "serverOverloaded", "rateLimitExceeded", "internalServerError", "flexUnavailable":
|
||||
return true
|
||||
case "httpConnectionFailed", "responseStreamConnectionFailed", "responseStreamDisconnected", "responseTooManyFailedAttempts":
|
||||
return e.HTTP == nil || *e.HTTP == 408 || *e.HTTP == 429 || *e.HTTP >= 500 && *e.HTTP <= 599
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type turn struct {
|
||||
ID string `json:"id"`
|
||||
Status string `json:"status"`
|
||||
|
|
@ -85,6 +75,9 @@ type params struct {
|
|||
type goalResult struct {
|
||||
Goal *goal `json:"goal"`
|
||||
}
|
||||
type usageResult struct {
|
||||
Allowed *bool `json:"ordinaryUsageAllowed"`
|
||||
}
|
||||
type turnsResult struct {
|
||||
Data []turn `json:"data"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue