fix(init.py): expose complete client session

This commit is contained in:
Krrish Dholakia 2023-10-10 15:16:10 -07:00
parent d43160ab8a
commit 70bfa022a4
2 changed files with 4 additions and 9 deletions

View file

@ -42,9 +42,7 @@ max_budget: float = 0.0 # set the max budget across all providers
_current_cost = 0 # private variable, used if max budget is set
error_logs: Dict = {}
add_function_to_prompt: bool = False # if function calling not supported by api, append function call details to system prompt
verify_ssl: bool = True # verify ssl certificates. openai does this by default.
ca_bundle_path: Optional[str] = None # custom certificates
timeout: int = 600 # max time a request should go on for
client_session: Optional[requests.Session] = None
#############################################
def get_model_cost_map():

View file

@ -4,13 +4,10 @@ import requests, certifi, ssl
class BaseLLM:
def create_client_session(self):
if litellm.verify_ssl is False:
if litellm.client_session:
session = litellm.client_session
else:
session = requests.Session()
session.verify = False
else:
ca_bundle_path = certifi.where() if litellm.ca_bundle_path is None else litellm.ca_bundle_path
session = requests.Session()
session.verify = ca_bundle_path
return session