mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
refactor(openai.py): moving openai text completion calls to http
This commit is contained in:
parent
db0e032d53
commit
c2cbdb23fd
6 changed files with 211 additions and 66 deletions
|
@ -62,7 +62,7 @@ def test_context_window_with_fallbacks(model):
|
|||
|
||||
# for model in litellm.models_by_provider["bedrock"]:
|
||||
# test_context_window(model=model)
|
||||
# test_context_window(model="gpt-3.5-turbo")
|
||||
# test_context_window(model="gpt-3.5-turbo-instruct")
|
||||
# test_context_window_with_fallbacks(model="command-nightly")
|
||||
# Test 2: InvalidAuth Errors
|
||||
@pytest.mark.parametrize("model", models)
|
||||
|
@ -70,7 +70,7 @@ def invalid_auth(model): # set the model key to an invalid key, depending on th
|
|||
messages = [{"content": "Hello, how are you?", "role": "user"}]
|
||||
temporary_key = None
|
||||
try:
|
||||
if model == "gpt-3.5-turbo":
|
||||
if model == "gpt-3.5-turbo" or model == "gpt-3.5-turbo-instruct":
|
||||
temporary_key = os.environ["OPENAI_API_KEY"]
|
||||
os.environ["OPENAI_API_KEY"] = "bad-key"
|
||||
elif model == "bedrock/anthropic.claude-v2":
|
||||
|
@ -158,7 +158,7 @@ def invalid_auth(model): # set the model key to an invalid key, depending on th
|
|||
|
||||
# for model in litellm.models_by_provider["bedrock"]:
|
||||
# invalid_auth(model=model)
|
||||
# invalid_auth(model="gpt-3.5-turbo")
|
||||
# invalid_auth(model="gpt-3.5-turbo-instruct")
|
||||
|
||||
# Test 3: Invalid Request Error
|
||||
@pytest.mark.parametrize("model", models)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue