mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +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:
|
else:
|
||||||
_close_client = False
|
|
||||||
if client is None or not isinstance(client, HTTPHandler):
|
if client is None or not isinstance(client, HTTPHandler):
|
||||||
client = HTTPHandler(timeout=timeout) # type: ignore
|
client = client = litellm.module_level_client
|
||||||
_close_client = True
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = client.post(
|
response = client.post(
|
||||||
|
@ -429,9 +427,6 @@ class AnthropicChatCompletion(BaseLLM):
|
||||||
status_code=status_code,
|
status_code=status_code,
|
||||||
headers=error_headers,
|
headers=error_headers,
|
||||||
)
|
)
|
||||||
finally:
|
|
||||||
if _close_client:
|
|
||||||
client.close()
|
|
||||||
|
|
||||||
return config.transform_response(
|
return config.transform_response(
|
||||||
model=model,
|
model=model,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue