fix(anthropic_text.py): add support for async text completion calls

This commit is contained in:
Krrish Dholakia 2024-04-15 08:15:00 -07:00
parent bdf7f6d13c
commit 26286a54b8
6 changed files with 324 additions and 98 deletions

View file

@ -58,13 +58,16 @@ class AsyncHTTPHandler:
class HTTPHandler:
def __init__(self, concurrent_limit=1000):
def __init__(
self, timeout: httpx.Timeout = _DEFAULT_TIMEOUT, concurrent_limit=1000
):
# Create a client with a connection pool
self.client = httpx.Client(
timeout=timeout,
limits=httpx.Limits(
max_connections=concurrent_limit,
max_keepalive_connections=concurrent_limit,
)
),
)
def close(self):