mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
parent
1ba4297d09
commit
50a3c9768b
2 changed files with 4 additions and 3 deletions
|
@ -46,8 +46,9 @@ client_session: Optional[requests.Session] = None
|
|||
model_fallbacks: Optional[List] = None
|
||||
#############################################
|
||||
|
||||
def get_model_cost_map():
|
||||
url = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"
|
||||
def get_model_cost_map(url: Optional[str]=None):
|
||||
if url is None:
|
||||
url = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"
|
||||
try:
|
||||
response = requests.get(url)
|
||||
response.raise_for_status() # Raise an exception if request is unsuccessful
|
||||
|
|
|
@ -7,6 +7,6 @@ import litellm
|
|||
import pytest
|
||||
|
||||
try:
|
||||
print(litellm.get_model_cost_map())
|
||||
print(litellm.get_model_cost_map(url="fake-url"))
|
||||
except Exception as e:
|
||||
pytest.fail(f"An exception occurred: {e}")
|
Loading…
Add table
Add a link
Reference in a new issue