ITADN

Please tell me how to change OpenAI's AzureOpenAI() to ChatAzureOpenAI() in Chatlas.

#271Openjnhyeon 创建于 2026-02-28
J
jnhyeoncommented
I received the sample code below from my company. Please tell me how to use it in Chatlas' ChatAzureOpenAI(). I've asked chatgpt, claude, gemini, perplexity, and others, but haven't been able to resolve the issue. ## code import os from dotenv import load_dotenv from openai import AzureOpenAI load_dotenv() client = AzureOpenAI( api_version="2023-05-15", api_key=os.getenv("AZURE_OPENAI_API_KEY"), azure_endpoint=os.getenv("AZURE_OPENAI_ENDPOINT") ) response = client.chat.completions.create( model=os.getenv("OPENAI_MODEL"), messages=[ {"role": "system", "content": "You are an expert chatbot about everything."}, {"role": "user", "content": "Who are you?"} ] ) response.choices[0].message.content
0 条评论