mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix(init.py): expose complete client session
This commit is contained in:
parent
d43160ab8a
commit
70bfa022a4
2 changed files with 4 additions and 9 deletions
|
@ -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
|
_current_cost = 0 # private variable, used if max budget is set
|
||||||
error_logs: Dict = {}
|
error_logs: Dict = {}
|
||||||
add_function_to_prompt: bool = False # if function calling not supported by api, append function call details to system prompt
|
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.
|
client_session: Optional[requests.Session] = None
|
||||||
ca_bundle_path: Optional[str] = None # custom certificates
|
|
||||||
timeout: int = 600 # max time a request should go on for
|
|
||||||
#############################################
|
#############################################
|
||||||
|
|
||||||
def get_model_cost_map():
|
def get_model_cost_map():
|
||||||
|
|
|
@ -4,13 +4,10 @@ import requests, certifi, ssl
|
||||||
|
|
||||||
class BaseLLM:
|
class BaseLLM:
|
||||||
def create_client_session(self):
|
def create_client_session(self):
|
||||||
if litellm.verify_ssl is False:
|
if litellm.client_session:
|
||||||
|
session = litellm.client_session
|
||||||
|
else:
|
||||||
session = requests.Session()
|
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
|
return session
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue