digitalocean / digitalocean/langchain-gradient

Enhance Timeout and Retry Handling with Better Error Management

Open
#7 6 comments 0 reactions 1 assignee Claimed by @mathurojus View on GitHub
good-first-issue hacktoberfest
Dominant language
Python
Stars
15
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Improve timeout and retry handling with better error management and configuration options.

**Acceptance Criteria:**

- Add APITimeoutError exception handling
- Improve retry logic with exponential backoff
- Add configurable retry attempts
- Add timeout configuration per request
- Add comprehensive tests for timeout and retry scenarios
- Update documentation with timeout and retry examples

**Technical Requirements:**

- Implement proper timeout error handling
- Support configurable retry strategies
- Add exponential backoff for retries
- Maintain performance with retries

**Example Usage:**

llm = ChatGradient(
model="llama3.3-70b-instruct",
timeout=30.0,
max_retries=3
)

try:
response = llm.invoke("Hello world!")
except APITimeoutError:
print("Request timed out")

**References:**

[Gradient SDK Timeout Documentation](https://github.com/digitalocean/gradient-python#timeouts)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.