mirror of
https://github.com/aljazceru/goose.git
synced 2026-02-16 20:14:26 +01:00
fix: new models have different messages for context length exceeded (#2763)
This commit is contained in:
@@ -138,6 +138,8 @@ impl DatabricksProvider {
|
||||
"reduce the length",
|
||||
"token count",
|
||||
"exceeds",
|
||||
"exceed context limit",
|
||||
"max_tokens",
|
||||
];
|
||||
if check_phrases.iter().any(|c| payload_str.contains(c)) {
|
||||
return Err(ProviderError::ContextLengthExceeded(payload_str));
|
||||
|
||||
@@ -211,6 +211,8 @@ impl DatabricksProvider {
|
||||
"reduce the length",
|
||||
"token count",
|
||||
"exceeds",
|
||||
"exceed context limit",
|
||||
"max_tokens",
|
||||
];
|
||||
if check_phrases.iter().any(|c| payload_str.contains(c)) {
|
||||
return Err(ProviderError::ContextLengthExceeded(payload_str));
|
||||
|
||||
@@ -333,6 +333,8 @@ impl SnowflakeProvider {
|
||||
"reduce the length",
|
||||
"token count",
|
||||
"exceeds",
|
||||
"exceed context limit",
|
||||
"max_tokens",
|
||||
];
|
||||
if check_phrases.iter().any(|c| payload_str.contains(c)) {
|
||||
return Err(ProviderError::ContextLengthExceeded("Request exceeds maximum context length. Please reduce the number of messages or content size.".to_string()));
|
||||
|
||||
Reference in New Issue
Block a user