agentitive / agentitive/spellbound

Spellbound spams the endpoint when context length is exceeded.

Offen
#44 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
22
Forks
2
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Right now, we don't detect the context length error properly:

```
Unexpected chunk: {
"error": {
"message": "This model's maximum context length is 8192 tokens. However, your messages resulted in 9074 tokens. Please reduce the length of the messages.",
"type": "invalid_request_error",
"param": "messages",
"code": "context_length_exceeded"
}
}
```

Since we retry this error, we end up accidentally causing a rate limit problem:

```
Unexpected chunk: {
"error": {
"message": "Rate limit reached for default-gpt-4 in organization org-XXXXX on tokens per min. Limit: 40000 / min. Please try again in 1ms. Contact us through our help center at help.openai.com if you continue to have issues.",
"type": "tokens",
"param": null,
"code": null
}
}
```

This error is not handled correctly either.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.