Open ZCQ0628 opened 1 year ago
@ZCQ0628 您好,您可以通过更改底层 LLM 模型来支持 Azure OpenAI,如下所示:
# from langchain.chat_models import ChatOpenAI # replace this from langchain.chat_models import AzureChatOpenAI # new BASE_URL = "https://${TODO}.openai.azure.com" API_KEY = "..." DEPLOYMENT_NAME = "chat" llm = AzureChatOpenAI( openai_api_base=BASE_URL, openai_api_version="2023-05-15", deployment_name=DEPLOYMENT_NAME, openai_api_key=API_KEY, openai_api_type="azure", ) ... rest of code
@ZCQ0628 see here https://python.langchain.com/docs/integrations/chat/azure_chat_openai
@ZCQ0628 您好,您可以通过更改底层 LLM 模型来支持 Azure OpenAI,如下所示: