fix: Pass deployment name as param for azure api (#406)

This commit is contained in:
Taranjeet Singh
2023-08-08 23:55:26 -07:00
committed by GitHub
parent 030e3521a9
commit 1f0f0c93b7
4 changed files with 20 additions and 5 deletions

View File

@@ -118,9 +118,13 @@ class CustomApp(EmbedChain):
def _get_azure_openai_answer(prompt: str, config: ChatConfig) -> str:
from langchain.chat_models import AzureChatOpenAI
if not config.deployment_name:
raise ValueError("Deployment name must be provided for Azure OpenAI")
chat = AzureChatOpenAI(
deployment_name="td2",
model_name=config.model or "text-davinci-002",
deployment_name=config.deployment_name,
openai_api_version="2023-05-15",
model_name=config.model or "gpt-3.5-turbo",
temperature=config.temperature,
max_tokens=config.max_tokens,
streaming=config.stream,