Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chat & embeddings maxRetries parameter not honored in general, critical for timeouts / rate limit error handling #392

Open
krodyrobi opened this issue Dec 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@krodyrobi
Copy link

krodyrobi commented Dec 20, 2024

Describe the Bug

The retry parameter is ignored by the underlying ai-sdk and the cloud-sdk executeRequest, consider adding a retry middleware.

Steps to Reproduce

const chatClient = new AzureOpenAIChatClient({
  modelName: "gpt-4o-mini",
  maxRetries: 1,
  maxTokens: 1
})

// force ai core rate limit quota exceeded somehow
await chatClient.invoke("hello")

Expected Behavior

If encountering rate-limit / timeout errors, the client should honor maxRetries parameter

Screenshots

No response

Used Versions

  • Node: 20.16.0
  • NPM: 10.8.1
  • npm ls --all
dependency tree ``` ├─┬ @langchain/[email protected] │ ├── @cfworker/[email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] deduped │ ├─┬ [email protected] │ │ ├── @types/[email protected] │ │ ├── [email protected] │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] │ │ └── [email protected] deduped │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ ├── @types/[email protected] │ │ └── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] deduped │ └── [email protected] ├─┬ @langchain/[email protected] │ ├── @langchain/[email protected] deduped │ ├── [email protected] deduped │ ├─┬ [email protected] │ │ ├─┬ @types/[email protected] │ │ │ ├── @types/[email protected] deduped │ │ │ └── [email protected] deduped │ │ ├─┬ @types/[email protected] │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ └─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ ├── [email protected] │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY encoding@^0.1.0 │ │ │ └─┬ [email protected] │ │ │ ├── [email protected] │ │ │ └── [email protected] │ │ └── [email protected] deduped │ ├── [email protected] deduped │ └── [email protected] deduped ├─┬ @sap-ai-sdk/[email protected] │ ├─┬ @langchain/[email protected] │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ └── [email protected] deduped │ ├─┬ @sap-ai-sdk/[email protected] │ │ ├── @sap-ai-sdk/[email protected] deduped │ │ └─┬ @sap-cloud-sdk/[email protected] │ │ ├─┬ @sap-cloud-sdk/[email protected] │ │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ │ ├── [email protected] deduped │ │ │ ├── [email protected] deduped │ │ │ └── [email protected] │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ ├─┬ @sap/[email protected] │ │ │ ├─┬ [email protected] │ │ │ │ └── [email protected] deduped │ │ │ ├─┬ [email protected] │ │ │ │ └── [email protected] │ │ │ └─┬ [email protected] │ │ │ ├── [email protected] │ │ │ ├── [email protected] │ │ │ └── [email protected] │ │ ├─┬ @sap/[email protected] │ │ │ ├── [email protected] deduped │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] deduped │ │ ├── [email protected] deduped │ │ └─┬ [email protected] │ │ ├─┬ [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ ├── [email protected] │ │ │ │ ├─┬ [email protected] │ │ │ │ │ └── [email protected] deduped │ │ │ │ └── [email protected] deduped │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] deduped │ │ └── [email protected] deduped │ ├─┬ @sap-ai-sdk/[email protected] │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ ├─┬ @sap-cloud-sdk/[email protected] │ │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ │ └── [email protected] deduped │ │ ├─┬ @sap-cloud-sdk/[email protected] │ │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ │ └── [email protected] deduped │ │ └─┬ @sap-cloud-sdk/[email protected] │ │ ├── [email protected] deduped │ │ ├─┬ [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ └─┬ [email protected] │ │ │ │ └── [email protected] │ │ │ └─┬ [email protected] │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ ├── @colors/[email protected] │ │ │ ├── @types/[email protected] │ │ │ ├── [email protected] │ │ │ ├── [email protected] deduped │ │ │ ├── [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ ├── [email protected] deduped │ │ │ ├─┬ [email protected] │ │ │ │ ├── [email protected] │ │ │ │ ├─┬ [email protected] │ │ │ │ │ └── [email protected] deduped │ │ │ │ └── [email protected] │ │ │ └── [email protected] deduped │ │ └─┬ [email protected] │ │ ├── @colors/[email protected] deduped │ │ ├─┬ @dabh/[email protected] │ │ │ ├─┬ [email protected] │ │ │ │ ├─┬ [email protected] │ │ │ │ │ ├─┬ [email protected] │ │ │ │ │ │ └── [email protected] │ │ │ │ │ └─┬ [email protected] │ │ │ │ │ ├── [email protected] deduped │ │ │ │ │ └─┬ [email protected] │ │ │ │ │ └── [email protected] │ │ │ │ └── [email protected] │ │ │ ├── [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] deduped │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] deduped │ │ ├── [email protected] deduped │ │ ├── [email protected] │ │ ├── [email protected] deduped │ │ └── [email protected] deduped │ ├─┬ @sap-ai-sdk/[email protected] │ │ ├── @sap-ai-sdk/[email protected] deduped │ │ ├── @sap-ai-sdk/[email protected] deduped │ │ ├── @sap-cloud-sdk/[email protected] deduped │ │ └── @sap-cloud-sdk/[email protected] deduped │ └── [email protected] deduped ├── [email protected] ├─┬ [email protected] │ └── [email protected] └─┬ [email protected] ├── UNMET OPTIONAL DEPENDENCY @langchain/anthropic@* ├── UNMET OPTIONAL DEPENDENCY @langchain/aws@* ├── UNMET OPTIONAL DEPENDENCY @langchain/cohere@* ├── @langchain/[email protected] deduped ├── UNMET OPTIONAL DEPENDENCY @langchain/google-genai@* ├── UNMET OPTIONAL DEPENDENCY @langchain/google-vertexai@* ├── UNMET OPTIONAL DEPENDENCY @langchain/groq@* ├── UNMET OPTIONAL DEPENDENCY @langchain/mistralai@* ├── UNMET OPTIONAL DEPENDENCY @langchain/ollama@* ├── @langchain/[email protected] deduped ├─┬ @langchain/[email protected] │ ├── @langchain/[email protected] deduped │ └── [email protected] deduped ├─┬ [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ └── [email protected] ├── UNMET OPTIONAL DEPENDENCY cheerio@* ├── UNMET OPTIONAL DEPENDENCY handlebars@^4.7.8 ├── [email protected] deduped ├─┬ [email protected] │ └── [email protected] ├── [email protected] ├── [email protected] deduped ├── [email protected] ├── [email protected] deduped ├── UNMET OPTIONAL DEPENDENCY peggy@^3.0.2 ├── UNMET OPTIONAL DEPENDENCY typeorm@* ├── [email protected] deduped ├── [email protected] ├── [email protected] deduped └── [email protected] deduped ```
Code Examples

No response

Log File

No response

Affected Development Phase

Release

Impact

Impaired

Timeline

No response

Additional Context

No response

@krodyrobi krodyrobi added the bug Something isn't working label Dec 20, 2024
@krodyrobi krodyrobi changed the title maxRetries not honored in general, critical for timeouts / rate limit error handling chat & embeddings maxRetries paramter not honored in general, critical for timeouts / rate limit error handling Dec 20, 2024
@krodyrobi krodyrobi changed the title chat & embeddings maxRetries paramter not honored in general, critical for timeouts / rate limit error handling chat & embeddings maxRetries parameter not honored in general, critical for timeouts / rate limit error handling Dec 20, 2024
@ZhongpinWang
Copy link
Contributor

@tomfrenken Langchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants