mirror of
https://gitee.com/zhangsken/opencode.git
synced 2026-10-16 02:24:10 +08:00
fix(ai): classify DeepInfra input length rejections as context overflow
This commit is contained in:
@@ -26,6 +26,8 @@ const patterns = [
|
|||||||
/tokens in request more than max tokens allowed/i,
|
/tokens in request more than max tokens allowed/i,
|
||||||
/maximum prompt length is \d+/i,
|
/maximum prompt length is \d+/i,
|
||||||
/reduce the length of the messages/i,
|
/reduce the length of the messages/i,
|
||||||
|
// DeepInfra
|
||||||
|
/requested input length \d+ exceeds maximum input length/i,
|
||||||
/maximum context length is \d+ tokens/i,
|
/maximum context length is \d+ tokens/i,
|
||||||
/exceeds (?:the )?maximum allowed input length of [\d,]+ tokens?/i,
|
/exceeds (?:the )?maximum allowed input length of [\d,]+ tokens?/i,
|
||||||
/input \(\d+ tokens\) is longer than the model'?s context length \(\d+ tokens\)/i,
|
/input \(\d+ tokens\) is longer than the model'?s context length \(\d+ tokens\)/i,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ describe("provider error classification", () => {
|
|||||||
const messages = [
|
const messages = [
|
||||||
"tokens in request more than max tokens allowed",
|
"tokens in request more than max tokens allowed",
|
||||||
"Requested token count exceeds the model's maximum context length of 131072 tokens.",
|
"Requested token count exceeds the model's maximum context length of 131072 tokens.",
|
||||||
|
"Requested input length 600010 exceeds maximum input length 131071",
|
||||||
"Input length (265330) exceeds model's maximum context length (262144).",
|
"Input length (265330) exceeds model's maximum context length (262144).",
|
||||||
"Input length 131393 exceeds the maximum allowed input length of 131040 tokens.",
|
"Input length 131393 exceeds the maximum allowed input length of 131040 tokens.",
|
||||||
"The input (516368 tokens) is longer than the model's context length (262144 tokens).",
|
"The input (516368 tokens) is longer than the model's context length (262144 tokens).",
|
||||||
|
|||||||
Reference in New Issue
Block a user