filip-michalsky / SalesGPT

Context-aware AI Sales Agent to automate sales outreach.
https://salesgpt.vercel.app
MIT License
2.03k stars 449 forks source link

怎样才能支持Azure Openai?? #23

Open ZCQ0628 opened 1 year ago

filip-michalsky commented 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
filip-michalsky commented 1 year ago

@ZCQ0628 see here https://python.langchain.com/docs/integrations/chat/azure_chat_openai