File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
learn-pr/wwl-data-ai/ai-foundry-sdk/includes Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ The following Python code sample uses a **ChatCompletionsClient** object to chat
23
23
``` python
24
24
from azure.ai.projects import AIProjectClient
25
25
from azure.identity import DefaultAzureCredential
26
+ from azure.ai.inference.models import SystemMessage, UserMessage
26
27
27
28
try :
28
29
42
43
response = chat.complete(
43
44
model = " phi-4-model" ,
44
45
messages = [
45
- { " role " : " system " , " content " : " You are a helpful AI assistant that answers questions." } ,
46
- { " role " : " user " , " content " : user_prompt},
46
+ SystemMessage( " You are a helpful AI assistant that answers questions." ) ,
47
+ UserMessage( user_prompt)
47
48
],
48
49
)
49
50
print (response.choices[0 ].message.content)
@@ -131,6 +132,8 @@ The following Python code sample uses the Azure AI Foundry and Azure OpenAI SDKs
131
132
``` python
132
133
from azure.ai.projects import AIProjectClient
133
134
from azure.identity import DefaultAzureCredential
135
+ import openai
136
+
134
137
135
138
try :
136
139
# Initialize the project client
You can’t perform that action at this time.
0 commit comments