File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
sdk/ai/azure-ai-agents/samples/agents_tools Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 4949 MessageInputTextBlock ,
5050 MessageInputImageUrlBlock ,
5151 RequiredComputerUseToolCall ,
52+ ScreenshotAction ,
5253 SubmitToolOutputsAction ,
54+ ListSortOrder ,
5355)
5456from azure .identity import DefaultAzureCredential
5557
@@ -152,7 +154,7 @@ def image_to_base64(image_path: str) -> str:
152154 tool_outputs .append (
153155 ComputerToolOutput (tool_call_id = tool_call .id , output = computer_screenshot )
154156 )
155- if isinstance (action , ComputerScreenshot ):
157+ if isinstance (action , ScreenshotAction ):
156158 print (f" Screenshot requested" )
157159 # (add hook to take screenshot in managed environment API here)
158160
@@ -194,6 +196,12 @@ def image_to_base64(image_path: str) -> str:
194196
195197 print () # extra newline between run steps
196198
199+ messages = agents_client .messages .list (thread_id = thread .id , order = ListSortOrder .ASCENDING )
200+ for msg in messages :
201+ if msg .text_messages :
202+ last_text = msg .text_messages [- 1 ]
203+ print (f"{ msg .role } : { last_text .text .value } " )
204+
197205 # Optional: Delete the agent once the run is finished.
198206 agents_client .delete_agent (agent .id )
199207 print ("Deleted agent" )
You can’t perform that action at this time.
0 commit comments