Skip to content

Commit

Permalink
πŸ”„ Refactored Azure API configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Nov 8, 2023
1 parent e9f567a commit e613ff7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions funcchain/utils/model_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,16 @@ def create_long_llm() -> RunnableWithFallbacks:
"""
settings.MAX_TOKENS = 8192
if settings.AZURE_API_KEY:
config = {
"openai_api_type": "azure",
"openai_api_key": settings.AZURE_API_KEY,
"openai_api_base": settings.AZURE_API_BASE,
"openai_api_version": settings.AZURE_API_VERSION,
}
config.update(settings.model_kwargs())
# remove OPENAI_API_KEY from the env variables
config = settings.model_kwargs()
config.update(
{
"openai_api_type": "azure",
"openai_api_key": settings.AZURE_API_KEY,
"openai_api_base": settings.AZURE_API_BASE,
"openai_api_version": settings.AZURE_API_VERSION,
}
)
print("Model: AZURE")
return AzureChatOpenAI(
deployment_name=settings.AZURE_DEPLOYMENT_NAME,
Expand Down

0 comments on commit e613ff7

Please sign in to comment.