forked from phoenix/litellm-mirror
use api_version for azure completion call
This commit is contained in:
parent
0c6999885c
commit
0f89636b47
1 changed files with 8 additions and 7 deletions
|
@ -178,10 +178,10 @@ def completion(
|
||||||
or get_secret("AZURE_API_BASE")
|
or get_secret("AZURE_API_BASE")
|
||||||
)
|
)
|
||||||
|
|
||||||
openai.api_version = (
|
api_version = (
|
||||||
litellm.api_version
|
api_version or
|
||||||
if litellm.api_version is not None
|
litellm.api_version or
|
||||||
else get_secret("AZURE_API_VERSION")
|
get_secret("AZURE_API_VERSION")
|
||||||
)
|
)
|
||||||
|
|
||||||
api_key = (
|
api_key = (
|
||||||
|
@ -194,11 +194,11 @@ def completion(
|
||||||
## LOGGING
|
## LOGGING
|
||||||
logging.pre_call(
|
logging.pre_call(
|
||||||
input=messages,
|
input=messages,
|
||||||
api_key=openai.api_key,
|
api_key=api_key,
|
||||||
additional_args={
|
additional_args={
|
||||||
"headers": litellm.headers,
|
"headers": litellm.headers,
|
||||||
"api_version": openai.api_version,
|
"api_version": api_version,
|
||||||
"api_base": openai.api_base,
|
"api_base": api_base,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
## COMPLETION CALL
|
## COMPLETION CALL
|
||||||
|
@ -208,6 +208,7 @@ def completion(
|
||||||
headers=litellm.headers,
|
headers=litellm.headers,
|
||||||
api_key=api_key,
|
api_key=api_key,
|
||||||
api_base=api_base,
|
api_base=api_base,
|
||||||
|
api_version=api_version,
|
||||||
**optional_params,
|
**optional_params,
|
||||||
)
|
)
|
||||||
if "stream" in optional_params and optional_params["stream"] == True:
|
if "stream" in optional_params and optional_params["stream"] == True:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue