Video upload date:  · Duration: PT1H46M27S  · Language: EN

Below is the Python code for developing the chat azure video

ai-102-ai-engineer-assoc video for below is the Python code for developing the chat application. import os from openai import AzureOpenAI client = AzureOpenAI(

This is a dedicated watch page for a single video.

Full Certification Question

Below is the Python code for developing the chat application. import os from openai import AzureOpenAI client = AzureOpenAI( api_key = os.getenv("AZURE_OPENAI_API_KEY"), api_version = "2024-02-01", azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT") ) response = client.chat.completions.create( model="gpt-35-turbo", # model = "deployment_name". messages=[ {"role": "system", "content": "Assistant is a large language model trained by OpenAI."}, {"role": "user", "content": "Who were the founders of Microsoft?"} ] ) all = response['choices'][0]['message']['content'] usage = all['usage'] Usage variable contains token for both prompt and completion.