mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
Using module level client
This commit is contained in:
parent
e981476ffe
commit
d5215d428f
1 changed files with 1 additions and 6 deletions
|
@ -403,10 +403,8 @@ class AnthropicChatCompletion(BaseLLM):
|
|||
)
|
||||
|
||||
else:
|
||||
_close_client = False
|
||||
if client is None or not isinstance(client, HTTPHandler):
|
||||
client = HTTPHandler(timeout=timeout) # type: ignore
|
||||
_close_client = True
|
||||
client = client = litellm.module_level_client
|
||||
|
||||
try:
|
||||
response = client.post(
|
||||
|
@ -429,9 +427,6 @@ class AnthropicChatCompletion(BaseLLM):
|
|||
status_code=status_code,
|
||||
headers=error_headers,
|
||||
)
|
||||
finally:
|
||||
if _close_client:
|
||||
client.close()
|
||||
|
||||
return config.transform_response(
|
||||
model=model,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue