mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-01 06:42:26 +00:00
fix(core): consider code: context_length_exceeded as context overflow in API call errors (#17748)
This commit is contained in:
@@ -167,7 +167,8 @@ export namespace ProviderError {
|
||||
|
||||
export function parseAPICallError(input: { providerID: ProviderID; error: APICallError }): ParsedAPICallError {
|
||||
const m = message(input.providerID, input.error)
|
||||
if (isOverflow(m) || input.error.statusCode === 413) {
|
||||
const body = json(input.error.responseBody)
|
||||
if (isOverflow(m) || input.error.statusCode === 413 || body?.error?.code === "context_length_exceeded") {
|
||||
return {
|
||||
type: "context_overflow",
|
||||
message: m,
|
||||
|
||||
Reference in New Issue
Block a user