agentitive / agentitive/spellbound

Spellbound spams the endpoint when context length is exceeded.

未關閉
#44 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
22
分支
2
PR 合併指標
30 天內沒有已合併 PR

描述

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.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。