forked from phoenix/litellm-mirror
fixing azure bug
This commit is contained in:
parent
fab537fee9
commit
c8884e21e7
7 changed files with 7 additions and 7 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -75,7 +75,7 @@ def completion(
|
||||||
else:
|
else:
|
||||||
openai.api_key = get_secret("AZURE_API_KEY")
|
openai.api_key = get_secret("AZURE_API_KEY")
|
||||||
## LOGGING
|
## LOGGING
|
||||||
logging(model=model, input=messages, azure=azure, logger_fn=logger_fn)
|
logging(model=model, input=messages, additional_args=optional_params, azure=azure, logger_fn=logger_fn)
|
||||||
## COMPLETION CALL
|
## COMPLETION CALL
|
||||||
if litellm.headers:
|
if litellm.headers:
|
||||||
response = openai.ChatCompletion.create(
|
response = openai.ChatCompletion.create(
|
||||||
|
@ -86,7 +86,7 @@ def completion(
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
response = openai.ChatCompletion.create(
|
response = openai.ChatCompletion.create(
|
||||||
engine=model,
|
model=model,
|
||||||
messages = messages,
|
messages = messages,
|
||||||
**optional_params
|
**optional_params
|
||||||
)
|
)
|
||||||
|
@ -103,7 +103,7 @@ def completion(
|
||||||
else:
|
else:
|
||||||
openai.api_key = get_secret("OPENAI_API_KEY")
|
openai.api_key = get_secret("OPENAI_API_KEY")
|
||||||
## LOGGING
|
## LOGGING
|
||||||
logging(model=model, input=messages, azure=azure, logger_fn=logger_fn)
|
logging(model=model, input=messages, additional_args=optional_params, azure=azure, logger_fn=logger_fn)
|
||||||
## COMPLETION CALL
|
## COMPLETION CALL
|
||||||
if litellm.headers:
|
if litellm.headers:
|
||||||
response = openai.ChatCompletion.create(
|
response = openai.ChatCompletion.create(
|
||||||
|
@ -132,7 +132,7 @@ def completion(
|
||||||
openai.organization = litellm.organization
|
openai.organization = litellm.organization
|
||||||
prompt = " ".join([message["content"] for message in messages])
|
prompt = " ".join([message["content"] for message in messages])
|
||||||
## LOGGING
|
## LOGGING
|
||||||
logging(model=model, input=prompt, azure=azure, logger_fn=logger_fn)
|
logging(model=model, input=prompt, additional_args=optional_params, azure=azure, logger_fn=logger_fn)
|
||||||
## COMPLETION CALL
|
## COMPLETION CALL
|
||||||
if litellm.headers:
|
if litellm.headers:
|
||||||
response = openai.Completion.create(
|
response = openai.Completion.create(
|
||||||
|
|
|
@ -78,7 +78,7 @@ def test_completion_openai_with_functions():
|
||||||
|
|
||||||
def test_completion_azure():
|
def test_completion_azure():
|
||||||
try:
|
try:
|
||||||
response = completion(model="chatgpt-test", messages=messages, azure=True)
|
response = completion(model="gpt-3.5-turbo", deployment_id="chatgpt-test", messages=messages, azure=True)
|
||||||
# Add any assertions here to check the response
|
# Add any assertions here to check the response
|
||||||
print(response)
|
print(response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -161,7 +161,7 @@ def get_optional_params(
|
||||||
if user != "":
|
if user != "":
|
||||||
optional_params["user"] = user
|
optional_params["user"] = user
|
||||||
if deployment_id != None:
|
if deployment_id != None:
|
||||||
optional_params["deployment_id"] = user
|
optional_params["deployment_id"] = deployment_id
|
||||||
return optional_params
|
return optional_params
|
||||||
|
|
||||||
def set_callbacks(callback_list):
|
def set_callbacks(callback_list):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "litellm"
|
name = "litellm"
|
||||||
version = "0.1.349"
|
version = "0.1.350"
|
||||||
description = "Library to easily interface with LLM API providers"
|
description = "Library to easily interface with LLM API providers"
|
||||||
authors = ["BerriAI"]
|
authors = ["BerriAI"]
|
||||||
license = "MIT License"
|
license = "MIT License"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue