diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..de3f2c83 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,50 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Original", + "request": "launch", + "runtimeArgs": [ + "run-script", + "start:js" + ], + "runtimeExecutable": "npm", + "skipFiles": [ + "/**" + ], + "cwd": "${workspaceFolder}/quickstarts/ai-agents/ts", + "type": "node" + }, + { + "name": "Code interp", + "request": "launch", + "runtimeArgs": [ + "run-script", + "start:js" + ], + "runtimeExecutable": "npm", + "skipFiles": [ + "/**" + ], + "cwd": "${workspaceFolder}/quickstarts/ai-agents/ts", + "type": "node" + }, + { + "name": "Launch TS", + "request": "launch", + "runtimeArgs": [ + "run-script", + "start" + ], + "runtimeExecutable": "npm", + "skipFiles": [ + "/**" + ], + "cwd": "${workspaceFolder}/quickstarts/ai-agents/ts", + "type": "node" + } + ] +} \ No newline at end of file diff --git a/agent-message-2.json b/agent-message-2.json new file mode 100644 index 00000000..a5f48877 --- /dev/null +++ b/agent-message-2.json @@ -0,0 +1,44 @@ +{ + "data": { + "id": "run_h1AAJ25FuI0sXKEpqfKwJC6K", + "object": "thread.run", + "created_at": 1749046155, + "assistant_id": "asst_VHRy7r1EEu11x4jbkNlD9BZ6", + "thread_id": "thread_oLHxCoMn8WG6JwYWC6NkEkWt", + "status": "queued", + "started_at": null, + "expires_at": 1749046755, + "cancelled_at": null, + "failed_at": null, + "completed_at": null, + "required_action": null, + "last_error": null, + "model": "gpt-4o", + "instructions": "You are a helpful agent", + "tools": [ + { + "type": "code_interpreter" + } + ], + "tool_resources": { + "code_interpreter": { + "file_ids": [] + } + }, + "metadata": {}, + "temperature": 1, + "top_p": 1, + "max_completion_tokens": null, + "max_prompt_tokens": null, + "truncation_strategy": { + "type": "auto", + "last_messages": null + }, + "incomplete_details": null, + "usage": null, + "response_format": "auto", + "tool_choice": "auto", + "parallel_tool_calls": true + }, + "event": "thread.run.queued" +} \ No newline at end of file diff --git a/agent-message-rate-limit-error.json b/agent-message-rate-limit-error.json new file mode 100644 index 00000000..b622925b --- /dev/null +++ b/agent-message-rate-limit-error.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "step_3jvJW2ljvo9BiGrjI7dWLnTD", + "object": "thread.run.step", + "created_at": 1749049871, + "run_id": "run_2JDnauXAoaz9zUO3po6dDQVo", + "assistant_id": "asst_T7EVn6EY9SffNjBSWfPquRCl", + "thread_id": "thread_m9EbMt50BauuWS1U73onUcEa", + "type": "message_creation", + "status": "failed", + "cancelled_at": null, + "completed_at": null, + "expires_at": 1749050464, + "failed_at": 1749049876, + "last_error": { + "code": "rate_limit_exceeded", + "message": "Rate limit is exceeded. Try again in 50 seconds." + }, + "step_details": { + "type": "message_creation", + "message_creation": { + "message_id": "msg_GbuHVL7n2sK2ynWy6pcovMP8" + } + }, + "usage": { + "prompt_tokens": 1490, + "completion_tokens": 37, + "total_tokens": 1527, + "prompt_token_details": { + "cached_tokens": 0 + } + } + }, + "event": "thread.run.step.failed" +} \ No newline at end of file diff --git a/agent-message.json b/agent-message.json new file mode 100644 index 00000000..2e761c59 --- /dev/null +++ b/agent-message.json @@ -0,0 +1,27 @@ +{ + "data": { + "id": "msg_h52NoePFcWOOjIm4iKqdlh1O", + "object": "thread.message", + "created_at": 1749046163, + "assistant_id": "asst_VHRy7r1EEu11x4jbkNlD9BZ6", + "thread_id": "thread_oLHxCoMn8WG6JwYWC6NkEkWt", + "run_id": "run_h1AAJ25FuI0sXKEpqfKwJC6K", + "status": "completed", + "incomplete_details": null, + "incomplete_at": null, + "completed_at": 1749046164, + "role": "assistant", + "content": [ + { + "type": "text", + "text": { + "value": "The data has been filtered for companies in the transportation industry. Four companies were found:\n\n1. Consolidated Messenger: Operating profit = 290.7\n2. Northwind Traders: Operating profit = 9166.0\n3. Tailwind Traders: Operating profit = 164.9\n4. Wide World Importers: Operating profit = 473.6\n\nNow, I'll proceed to generate the bar chart illustrating this data.", + "annotations": [] + } + } + ], + "attachments": [], + "metadata": {} + }, + "event": "thread.message.completed" +} \ No newline at end of file diff --git a/output.txt b/output.txt new file mode 100644 index 00000000..f04c6ba4 --- /dev/null +++ b/output.txt @@ -0,0 +1,319 @@ +Uploaded local file, file ID : assistant-WAdosJ3wdQQvWUP8cAVu12 +Created agent, agent ID: asst_T7EVn6EY9SffNjBSWfPquRCl +Created thread, thread ID: thread_m9EbMt50BauuWS1U73onUcEa +Created message, message ID: msg_LMHJFScuHeFOzueNyFYRdSOx +ThreadRun status: queued +Unhandled event type: {"data":{"id":"run_2JDnauXAoaz9zUO3po6dDQVo","object":"thread.run","created_at":1749049864,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","status":"queued","started_at":null,"expires_at":1749050464,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":"You are a helpful agent","tools":[{"type":"code_interpreter"}],"tool_resources":{"code_interpreter":{"file_ids":[]}},"metadata":{},"temperature":1,"top_p":1,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true},"event":"thread.run.queued"} +Unhandled event type: {"data":{"id":"run_2JDnauXAoaz9zUO3po6dDQVo","object":"thread.run","created_at":1749049864,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","status":"in_progress","started_at":1749049865,"expires_at":1749050464,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":"You are a helpful agent","tools":[{"type":"code_interpreter"}],"tool_resources":{"code_interpreter":{"file_ids":[]}},"metadata":{},"temperature":1,"top_p":1,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true},"event":"thread.run.in_progress"} +Unhandled event type: {"data":{"id":"step_zo7gHUjhYhzaGCUNbTDg0Qmn","object":"thread.run.step","created_at":1749049865,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_ipl6xdpkJhI6J92nSwiSxFYK"}},"usage":null},"event":"thread.run.step.created"} +Unhandled event type: {"data":{"id":"step_zo7gHUjhYhzaGCUNbTDg0Qmn","object":"thread.run.step","created_at":1749049865,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_ipl6xdpkJhI6J92nSwiSxFYK"}},"usage":null},"event":"thread.run.step.in_progress"} +Unhandled event type: {"data":{"id":"msg_ipl6xdpkJhI6J92nSwiSxFYK","object":"thread.message","created_at":1749049865,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"attachments":[],"metadata":{}},"event":"thread.message.created"} +thread.message.created received:: thread.message.created +Unhandled event type: {"data":{"id":"msg_ipl6xdpkJhI6J92nSwiSxFYK","object":"thread.message","created_at":1749049865,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"attachments":[],"metadata":{}},"event":"thread.message.in_progress"} +thread.message.in_progress received:: thread.message.in_progress +Text delta received:: I'll +Text delta received:: start +Text delta received:: by +Text delta received:: examining +Text delta received:: the +Text delta received:: contents +Text delta received:: of +Text delta received:: the +Text delta received:: uploaded +Text delta received:: CSV +Text delta received:: file +Text delta received:: to +Text delta received:: understand +Text delta received:: its +Text delta received:: structure +Text delta received:: and +Text delta received:: ensure +Text delta received:: that +Text delta received:: it +Text delta received:: contains +Text delta received:: the +Text delta received:: necessary +Text delta received:: data +Text delta received:: to +Text delta received:: create +Text delta received:: a +Text delta received:: bar +Text delta received:: chart +Text delta received:: for +Text delta received:: the +Text delta received:: operating +Text delta received:: profit +Text delta received:: of +Text delta received:: the +Text delta received:: USA +Text delta received:: transportation +Text delta received:: industry +Text delta received:: . +Text delta received:: Let +Text delta received:: me +Text delta received:: first +Text delta received:: read +Text delta received:: the +Text delta received:: file +Text delta received:: . +Unhandled event type: {"data":{"id":"msg_ipl6xdpkJhI6J92nSwiSxFYK","object":"thread.message","created_at":1749049865,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1749049866,"role":"assistant","content":[{"type":"text","text":{"value":"I'll start by examining the contents of the uploaded CSV file to understand its structure and ensure that it contains the necessary data to create a bar chart for the operating profit of the USA transportation industry. Let me first read the file.","annotations":[]}}],"attachments":[],"metadata":{}},"event":"thread.message.completed"} +thread.message.completed received:: thread.message.completed +Unhandled event type: {"data":{"id":"step_zo7gHUjhYhzaGCUNbTDg0Qmn","object":"thread.run.step","created_at":1749049865,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1749049867,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_ipl6xdpkJhI6J92nSwiSxFYK"}},"usage":{"prompt_tokens":313,"completion_tokens":47,"total_tokens":360,"prompt_token_details":{"cached_tokens":0}}},"event":"thread.run.step.completed"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step","created_at":1749049867,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null},"event":"thread.run.step.created"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step","created_at":1749049867,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null},"event":"thread.run.step.in_progress"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"id":"call_v0l1OlbKOSuIuW1JrbR89uvS","type":"code_interpreter","code_interpreter":{"input":"","outputs":[]}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"import"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" pandas"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" as"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" pd"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"\n\n"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"#"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" Load"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" and"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" inspect"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" the"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" content"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" of"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" the"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" uploaded"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" CSV"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" file"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"\n"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"file"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"_path"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" ="}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" '/"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"mnt"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"/data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"/"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"assistant"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"-W"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"Ad"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"os"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"J"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"3"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"wd"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"QQ"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"v"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"W"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"UP"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"8"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"c"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"AV"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"u"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"12"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"'\n"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" ="}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" pd"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":".read"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"_csv"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"(file"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"_path"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":")\n\n"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"#"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" Display"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" the"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" first"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" few"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" rows"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" of"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" the"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" for"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" inspection"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"\n"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":".head"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"(),"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":".columns"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_r3QjF4pwA7O2a4wZyf8XMw4x","object":"thread.run.step","created_at":1749049867,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"tool_calls","status":"completed","cancelled_at":null,"completed_at":1749049869,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[{"id":"call_v0l1OlbKOSuIuW1JrbR89uvS","type":"code_interpreter","code_interpreter":{"input":"import pandas as pd\n\n# Load and inspect the content of the uploaded CSV file\nfile_path = '/mnt/data/assistant-WAdosJ3wdQQvWUP8cAVu12'\ndata = pd.read_csv(file_path)\n\n# Display the first few rows of the data for inspection\ndata.head(), data.columns","outputs":[]}}]},"usage":{"prompt_tokens":362,"completion_tokens":72,"total_tokens":434,"prompt_token_details":{"cached_tokens":0}}},"event":"thread.run.step.completed"} +Unhandled event type: {"data":{"id":"step_JwRZJif5gAZfdX4r3qgE4chh","object":"thread.run.step","created_at":1749049869,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_e7B0OjYJYWg3qlyHIQ70jR5k"}},"usage":null},"event":"thread.run.step.created"} +Unhandled event type: {"data":{"id":"step_JwRZJif5gAZfdX4r3qgE4chh","object":"thread.run.step","created_at":1749049869,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_e7B0OjYJYWg3qlyHIQ70jR5k"}},"usage":null},"event":"thread.run.step.in_progress"} +Unhandled event type: {"data":{"id":"msg_e7B0OjYJYWg3qlyHIQ70jR5k","object":"thread.message","created_at":1749049869,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"attachments":[],"metadata":{}},"event":"thread.message.created"} +thread.message.created received:: thread.message.created +Unhandled event type: {"data":{"id":"msg_e7B0OjYJYWg3qlyHIQ70jR5k","object":"thread.message","created_at":1749049869,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"attachments":[],"metadata":{}},"event":"thread.message.in_progress"} +thread.message.in_progress received:: thread.message.in_progress +Text delta received:: The +Text delta received:: data +Text delta received:: contains +Text delta received:: multiple +Text delta received:: columns +Text delta received:: , +Text delta received:: including +Text delta received:: relevant +Text delta received:: values +Text delta received:: for +Text delta received:: operating +Text delta received:: profit +Text delta received:: and +Text delta received:: industry +Text delta received:: . +Text delta received:: To +Text delta received:: create +Text delta received:: a +Text delta received:: bar +Text delta received:: chart +Text delta received:: for +Text delta received:: the +Text delta received:: USA +Text delta received:: transportation +Text delta received:: industry +Text delta received:: , +Text delta received:: I +Text delta received:: need +Text delta received:: to +Text delta received:: filter +Text delta received:: the +Text delta received:: dataset +Text delta received:: for +Text delta received:: entries +Text delta received:: related +Text delta received:: to +Text delta received:: transportation +Text delta received:: and +Text delta received:: extract +Text delta received:: the +Text delta received:: operating +Text delta received:: profit +Text delta received:: values +Text delta received:: . + + +Text delta received:: Let +Text delta received:: me +Text delta received:: check +Text delta received:: if +Text delta received:: any +Text delta received:: entries +Text delta received:: in +Text delta received:: the +Text delta received:: data +Text delta received:: belong +Text delta received:: to +Text delta received:: the +Text delta received:: transportation +Text delta received:: industry +Text delta received:: . +Unhandled event type: {"data":{"id":"msg_e7B0OjYJYWg3qlyHIQ70jR5k","object":"thread.message","created_at":1749049869,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1749049870,"role":"assistant","content":[{"type":"text","text":{"value":"The data contains multiple columns, including relevant values for operating profit and industry. To create a bar chart for the USA transportation industry, I need to filter the dataset for entries related to transportation and extract the operating profit values.\n\nLet me check if any entries in the data belong to the transportation industry.","annotations":[]}}],"attachments":[],"metadata":{}},"event":"thread.message.completed"} +thread.message.completed received:: thread.message.completed +Unhandled event type: {"data":{"id":"step_JwRZJif5gAZfdX4r3qgE4chh","object":"thread.run.step","created_at":1749049869,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1749049870,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_e7B0OjYJYWg3qlyHIQ70jR5k"}},"usage":{"prompt_tokens":1006,"completion_tokens":61,"total_tokens":1067,"prompt_token_details":{"cached_tokens":0}}},"event":"thread.run.step.completed"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step","created_at":1749049870,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null},"event":"thread.run.step.created"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step","created_at":1749049870,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null},"event":"thread.run.step.in_progress"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"id":"call_HvRCMR2shjun3oGem6nlvvyX","type":"code_interpreter","code_interpreter":{"input":"","outputs":[]}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"#"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" Filter"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" the"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" for"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" the"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" \""}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"Transportation"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"\""}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" industry"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" ("}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"if"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" it"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" exists"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":")\n"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"filtered"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"_data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" ="}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"[data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"['"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"industry"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"']."}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"str"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":".contains"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"(\""}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"Transportation"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"\","}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" na"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"=False"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":","}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" case"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"=False"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":")]\n\n"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"#"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" Check"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" the"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" filtered"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":" data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"\n"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"filtered"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"code_interpreter","code_interpreter":{"input":"_data"}}]}}},"event":"thread.run.step.delta"} +Unhandled event type: {"data":{"id":"step_cee1A0zpFtSpDYuGVkJBhizn","object":"thread.run.step","created_at":1749049870,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"tool_calls","status":"completed","cancelled_at":null,"completed_at":1749049871,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[{"id":"call_HvRCMR2shjun3oGem6nlvvyX","type":"code_interpreter","code_interpreter":{"input":"# Filter the data for the \"Transportation\" industry (if it exists)\nfiltered_data = data[data['industry'].str.contains(\"Transportation\", na=False, case=False)]\n\n# Check the filtered data\nfiltered_data","outputs":[]}}]},"usage":{"prompt_tokens":1069,"completion_tokens":48,"total_tokens":1117,"prompt_token_details":{"cached_tokens":0}}},"event":"thread.run.step.completed"} +Unhandled event type: {"data":{"id":"step_3jvJW2ljvo9BiGrjI7dWLnTD","object":"thread.run.step","created_at":1749049871,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_GbuHVL7n2sK2ynWy6pcovMP8"}},"usage":null},"event":"thread.run.step.created"} +Unhandled event type: {"data":{"id":"step_3jvJW2ljvo9BiGrjI7dWLnTD","object":"thread.run.step","created_at":1749049871,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_GbuHVL7n2sK2ynWy6pcovMP8"}},"usage":null},"event":"thread.run.step.in_progress"} +Unhandled event type: {"data":{"id":"msg_GbuHVL7n2sK2ynWy6pcovMP8","object":"thread.message","created_at":1749049871,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"attachments":[],"metadata":{}},"event":"thread.message.created"} +thread.message.created received:: thread.message.created +Unhandled event type: {"data":{"id":"msg_GbuHVL7n2sK2ynWy6pcovMP8","object":"thread.message","created_at":1749049871,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"attachments":[],"metadata":{}},"event":"thread.message.in_progress"} +thread.message.in_progress received:: thread.message.in_progress +Text delta received:: The +Text delta received:: data +Text delta received:: contains +Text delta received:: four +Text delta received:: entries +Text delta received:: for +Text delta received:: the +Text delta received:: " +Text delta received:: Transportation +Text delta received:: " +Text delta received:: industry +Text delta received:: . +Text delta received:: I +Text delta received:: will +Text delta received:: now +Text delta received:: create +Text delta received:: a +Text delta received:: bar +Text delta received:: chart +Text delta received:: for +Text delta received:: the +Text delta received:: operating +Text delta received:: profit +Text delta received:: of +Text delta received:: these +Text delta received:: companies +Text delta received:: . +Text delta received:: Let +Text delta received:: me +Text delta received:: proceed +Text delta received:: to +Text delta received:: generate +Text delta received:: the +Text delta received:: chart +Text delta received:: . +Unhandled event type: {"data":{"id":"msg_GbuHVL7n2sK2ynWy6pcovMP8","object":"thread.message","created_at":1749049871,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1749049872,"role":"assistant","content":[{"type":"text","text":{"value":"The data contains four entries for the \"Transportation\" industry. I will now create a bar chart for the operating profit of these companies. Let me proceed to generate the chart.","annotations":[]}}],"attachments":[],"metadata":{}},"event":"thread.message.completed"} +thread.message.completed received:: thread.message.completed +Unhandled event type: {"data":{"id":"step_3jvJW2ljvo9BiGrjI7dWLnTD","object":"thread.run.step","created_at":1749049871,"run_id":"run_2JDnauXAoaz9zUO3po6dDQVo","assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","type":"message_creation","status":"failed","cancelled_at":null,"completed_at":null,"expires_at":1749050464,"failed_at":1749049876,"last_error":{"code":"rate_limit_exceeded","message":"Rate limit is exceeded. Try again in 50 seconds."},"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_GbuHVL7n2sK2ynWy6pcovMP8"}},"usage":{"prompt_tokens":1490,"completion_tokens":37,"total_tokens":1527,"prompt_token_details":{"cached_tokens":0}}},"event":"thread.run.step.failed"} +Unhandled event type: {"data":{"id":"run_2JDnauXAoaz9zUO3po6dDQVo","object":"thread.run","created_at":1749049864,"assistant_id":"asst_T7EVn6EY9SffNjBSWfPquRCl","thread_id":"thread_m9EbMt50BauuWS1U73onUcEa","status":"failed","started_at":1749049865,"expires_at":null,"cancelled_at":null,"failed_at":1749049876,"completed_at":null,"required_action":null,"last_error":{"code":"rate_limit_exceeded","message":"Rate limit is exceeded. Try again in 50 seconds."},"model":"gpt-4o","instructions":"You are a helpful agent","tools":[{"type":"code_interpreter"}],"tool_resources":{"code_interpreter":{"file_ids":[]}},"metadata":{},"temperature":1,"top_p":1,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":4240,"completion_tokens":265,"total_tokens":4505,"prompt_token_details":{"cached_tokens":0}},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true},"event":"thread.run.failed"} +Stream completed. +Deleted file, file ID : assistant-WAdosJ3wdQQvWUP8cAVu12 +Messages: [ + { + id: 'msg_LMHJFScuHeFOzueNyFYRdSOx', + object: 'thread.message', + createdAt: 2025-06-04T15:11:03.000Z, + threadId: 'thread_m9EbMt50BauuWS1U73onUcEa', + status: undefined, + incompleteDetails: undefined, + completedAt: undefined, + incompleteAt: undefined, + role: 'user', + content: [ [Object] ], + assistantId: null, + runId: null, + attachments: [], + metadata: {} + } +] +No assistant message found +Message Details: +File Paths: +Type: text +Text: Create a bar chart of the USA transportation industry for the operating profit from the uploaded CSV file and provide the bar chart image file to me? If you can't create an image file, please provide the data in a text format and say what is wrong with the data to stop you from generating the image. If you run into a programming error, read the error message and try to fix it youself. Make sure you add appropriate backoff and retry so you don't run out of quota. +File ID: msg_LMHJFScuHeFOzueNyFYRdSOx +Deleted agent, agent ID: asst_T7EVn6EY9SffNjBSWfPquRCl \ No newline at end of file diff --git a/quickstarts/ai-agents/js/output.txt b/quickstarts/ai-agents/js/output.txt deleted file mode 100644 index bd6ce7f5..00000000 --- a/quickstarts/ai-agents/js/output.txt +++ /dev/null @@ -1,16 +0,0 @@ -Type: text -Text: Sure, I can help you solve the equation \(3x + 11 = 14\). - -To solve for \(x\), we need to isolate \(x\) on one side of the equation. Here are the steps: - -1. Subtract 11 from both sides of the equation: -\[3x + 11 - 11 = 14 - 11\] -\[3x = 3\] - -2. Divide both sides of the equation by 3: -\[\frac{3x}{3} = \frac{3}{3}\] -\[x = 1\] - -So the solution to the equation \(3x + 11 = 14\) is \(x = 1\). -Type: text -Text: I need to solve the equation `3x + 11 = 14`. Can you help me? \ No newline at end of file diff --git a/quickstarts/ai-agents/js/package-lock.json b/quickstarts/ai-agents/js/package-lock.json deleted file mode 100644 index 4b009000..00000000 --- a/quickstarts/ai-agents/js/package-lock.json +++ /dev/null @@ -1,642 +0,0 @@ -{ - "name": "azureaiagents-js", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "azureaiagents-js", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "@azure/ai-projects": "^1.0.0-beta.2", - "@azure/core-util": "^1.11.0", - "@azure/identity": "^4.6.0", - "dotenv": "^16.4.7" - }, - "devDependencies": { - "@types/node": "^22.9.1", - "prettier": "3.3.3", - "typescript": "^5.6.3" - } - }, - "node_modules/@azure-rest/core-client": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-2.3.4.tgz", - "integrity": "sha512-AQXtD5VqsoOswDmxQR0YyVkYa1tZ0HyfC/fsqfntYZ7EEgaimfCGN2nAfiN3KXy1F4TfcoByhmtX2bVOO2vAEQ==", - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.5.0", - "@azure/core-tracing": "^1.0.1", - "@azure/core-util": "^1.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/abort-controller": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", - "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/ai-projects": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@azure/ai-projects/-/ai-projects-1.0.0-beta.2.tgz", - "integrity": "sha512-b5I85Dqnk1zJdgdUsmR5TEyPkTUTV3PLbPzI//Avu6KeqrCkPa8DGZto/SUM6cGEoK8x3oWVZULYXvtbOM2c3A==", - "dependencies": { - "@azure-rest/core-client": "^2.1.0", - "@azure/abort-controller": "^2.1.2", - "@azure/core-auth": "^1.6.0", - "@azure/core-lro": "^2.0.0", - "@azure/core-paging": "^1.5.0", - "@azure/core-rest-pipeline": "^1.5.0", - "@azure/core-sse": "^2.1.3", - "@azure/core-tracing": "^1.2.0", - "@azure/core-util": "^1.9.0", - "@azure/logger": "^1.1.4", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-auth": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.9.0.tgz", - "integrity": "sha512-FPwHpZywuyasDSLMqJ6fhbOK3TqUdviZNF8OqRGA4W5Ewib2lEEZ+pBsYcBa88B2NGO/SEnYPGhyBqNlE8ilSw==", - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-util": "^1.11.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-client": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.9.3.tgz", - "integrity": "sha512-/wGw8fJ4mdpJ1Cum7s1S+VQyXt1ihwKLzfabS1O/RDADnmzVc01dHn44qD0BvGH6KlZNzOMW95tEpKqhkCChPA==", - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-auth": "^1.4.0", - "@azure/core-rest-pipeline": "^1.9.1", - "@azure/core-tracing": "^1.0.0", - "@azure/core-util": "^1.6.1", - "@azure/logger": "^1.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-lro": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.7.2.tgz", - "integrity": "sha512-0YIpccoX8m/k00O7mDDMdJpbr6mf1yWo2dfmxt5A8XVZVVMz2SSKaEbMCeJRvgQ0IaSlqhjT47p4hVIRRy90xw==", - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-util": "^1.2.0", - "@azure/logger": "^1.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-paging": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.6.2.tgz", - "integrity": "sha512-YKWi9YuCU04B55h25cnOYZHxXYtEvQEbKST5vqRga7hWY9ydd3FZHdeQF8pyh+acWZvppw13M/LMGx0LABUVMA==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-rest-pipeline": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.19.1.tgz", - "integrity": "sha512-zHeoI3NCs53lLBbWNzQycjnYKsA1CVKlnzSNuSFcUDwBp8HHVObePxrM7HaX+Ha5Ks639H7chNC9HOaIhNS03w==", - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-auth": "^1.8.0", - "@azure/core-tracing": "^1.0.1", - "@azure/core-util": "^1.11.0", - "@azure/logger": "^1.0.0", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-sse": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@azure/core-sse/-/core-sse-2.1.3.tgz", - "integrity": "sha512-KSSdIKy8kvWCpYr8Hzpu22j3wcXsVTYE0IlgmI1T/aHvBDsLgV91y90UTfVWnuiuApRLCCVC4gS09ApBGOmYQA==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-tracing": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.2.0.tgz", - "integrity": "sha512-UKTiEJPkWcESPYJz3X5uKRYyOcJD+4nYph+KpfdPRnQJVrZfk0KJgdnaAWKfhsBBtAf/D58Az4AvCJEmWgIBAg==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-util": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.11.0.tgz", - "integrity": "sha512-DxOSLua+NdpWoSqULhjDyAZTXFdP/LKkqtYuxxz1SCN289zk3OG8UOpnCQAz/tygyACBtWp/BoO72ptK7msY8g==", - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/identity": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.8.0.tgz", - "integrity": "sha512-l9ALUGHtFB/JfsqmA+9iYAp2a+cCwdNO/cyIr2y7nJLJsz1aae6qVP8XxT7Kbudg0IQRSIMXj0+iivFdbD1xPA==", - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", - "@azure/core-rest-pipeline": "^1.17.0", - "@azure/core-tracing": "^1.0.0", - "@azure/core-util": "^1.11.0", - "@azure/logger": "^1.0.0", - "@azure/msal-browser": "^4.2.0", - "@azure/msal-node": "^3.2.3", - "events": "^3.0.0", - "jws": "^4.0.0", - "open": "^10.1.0", - "stoppable": "^1.1.0", - "tslib": "^2.2.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/logger": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.1.4.tgz", - "integrity": "sha512-4IXXzcCdLdlXuCG+8UKEwLA1T1NHqUfanhXYHiQTn+6sfWCZXduqbtXDGceg3Ce5QxTGo7EqmbV6Bi+aqKuClQ==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/msal-browser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-4.8.0.tgz", - "integrity": "sha512-z7kJlMW3IAETyq82LDKJqr++IeOvU728q9lkuTFjEIPUWxnB1OlmuPCF32fYurxOnOnJeFEZxjbEzq8xyP0aag==", - "dependencies": { - "@azure/msal-common": "15.3.0" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@azure/msal-common": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-15.3.0.tgz", - "integrity": "sha512-lh+eZfibGwtQxFnx+mj6cYWn0pwA8tDnn8CBs9P21nC7Uw5YWRwfXaXdVQSMENZ5ojRqR+NzRaucEo4qUvs3pA==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@azure/msal-node": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-3.4.0.tgz", - "integrity": "sha512-b4wBaPV68i+g61wFOfl5zh1lQ9UylgCQpI2638pJHV0SINneO78hOFdnX8WCoGw5OOc4Eewth9pYOg7gaiyUYw==", - "dependencies": { - "@azure/msal-common": "15.3.0", - "jsonwebtoken": "^9.0.0", - "uuid": "^8.3.0" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/@types/node": { - "version": "22.10.7", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.20.0" - } - }, - "node_modules/agent-base": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", - "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", - "engines": { - "node": ">= 14" - } - }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" - }, - "node_modules/bundle-name": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", - "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", - "dependencies": { - "run-applescript": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/default-browser": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", - "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==", - "dependencies": { - "bundle-name": "^4.1.0", - "default-browser-id": "^5.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/default-browser-id": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz", - "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/define-lazy-prop": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", - "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/http-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", - "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/is-docker": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", - "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-inside-container": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", - "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", - "dependencies": { - "is-docker": "^3.0.0" - }, - "bin": { - "is-inside-container": "cli.js" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-wsl": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", - "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", - "dependencies": { - "is-inside-container": "^1.0.0" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", - "dependencies": { - "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=12", - "npm": ">=6" - } - }, - "node_modules/jsonwebtoken/node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jsonwebtoken/node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jwa": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", - "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jws": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", - "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", - "dependencies": { - "jwa": "^2.0.0", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" - }, - "node_modules/lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" - }, - "node_modules/lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" - }, - "node_modules/lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" - }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" - }, - "node_modules/lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" - }, - "node_modules/lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/open": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", - "integrity": "sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==", - "dependencies": { - "default-browser": "^5.2.1", - "define-lazy-prop": "^3.0.0", - "is-inside-container": "^1.0.0", - "is-wsl": "^3.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", - "dev": true, - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/run-applescript": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz", - "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/stoppable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", - "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", - "engines": { - "node": ">=4", - "npm": ">=6" - } - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" - }, - "node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "6.20.0", - "dev": true, - "license": "MIT" - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - } - } -} diff --git a/quickstarts/ai-agents/js/package.json b/quickstarts/ai-agents/js/package.json deleted file mode 100644 index 652e730f..00000000 --- a/quickstarts/ai-agents/js/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "azureaiagents-js", - "version": "1.0.0", - "main": "index.js", - "type": "module", - "scripts": { - "start": "node -r dotenv/config src/index.js", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "description": "", - "dependencies": { - "@azure/ai-projects": "^1.0.0-beta.2", - "@azure/core-util": "^1.11.0", - "@azure/identity": "^4.6.0", - "dotenv": "^16.4.7" - }, - "devDependencies": { - "@types/node": "^22.9.1", - "prettier": "3.3.3", - "typescript": "^5.6.3" - } -} diff --git a/quickstarts/ai-agents/js/sample.env b/quickstarts/ai-agents/js/sample.env deleted file mode 100644 index 23ffadaa..00000000 --- a/quickstarts/ai-agents/js/sample.env +++ /dev/null @@ -1 +0,0 @@ -PROJECT_CONNECTION_STRING= \ No newline at end of file diff --git a/quickstarts/ai-agents/js/src/index.js b/quickstarts/ai-agents/js/src/index.js deleted file mode 100644 index 72e50375..00000000 --- a/quickstarts/ai-agents/js/src/index.js +++ /dev/null @@ -1,105 +0,0 @@ -// index.js -import { - AIProjectsClient, - DoneEvent, - ErrorEvent, - isOutputOfType, - MessageStreamEvent, - RunStreamEvent, - ToolUtility, -} from "@azure/ai-projects"; -import { DefaultAzureCredential } from "@azure/identity"; -import dotenv from 'dotenv'; - -dotenv.config(); - -// Set the connection string from the environment variable -const connectionString = process.env.PROJECT_CONNECTION_STRING; -const model = "gpt-4o"; - -// Throw an error if the connection string is not set -if (!connectionString) { - throw new Error("Please set the PROJECT_CONNECTION_STRING environment variable."); -} - -export async function main() { - const client = AIProjectsClient.fromConnectionString( - connectionString || "", - new DefaultAzureCredential(), - ); - - // Step 1 code interpreter tool - const codeInterpreterTool = ToolUtility.createCodeInterpreterTool([]); - - // Step 2 an agent - const agent = await client.agents.createAgent(model, { - name: "my-agent", - instructions: "You are a helpful agent", - tools: [codeInterpreterTool.definition], - toolResources: codeInterpreterTool.resources, - }); - - // Step 3 a thread - const thread = await client.agents.createThread(); - - // Step 4 a message to thread - await client.agents.createMessage( - thread.id, { - role: "user", - content: "I need to solve the equation `3x + 11 = 14`. Can you help me?", - }); - - // Intermission is now correlated with thread - // Intermission messages will retrieve the message just added - - // Step 5 the agent - const streamEventMessages = await client.agents.createRun(thread.id, agent.id).stream(); - - for await (const eventMessage of streamEventMessages) { - switch (eventMessage.event) { - case RunStreamEvent.ThreadRunCreated: - break; - case MessageStreamEvent.ThreadMessageDelta: - { - const messageDelta = eventMessage.data; - messageDelta.delta.content.forEach((contentPart) => { - if (contentPart.type === "text") { - const textContent = contentPart; - const textValue = textContent.text?.value || "No text"; - } - }); - } - break; - - case RunStreamEvent.ThreadRunCompleted: - break; - case ErrorEvent.Error: - console.log(`An error occurred. Data ${eventMessage.data}`); - break; - case DoneEvent.Done: - break; - } - } - - // 6. Print the messages from the agent - const messages = await client.agents.listMessages(thread.id); - - // Messages iterate from oldest to newest - // messages[0] is the most recent - const messagesArray = messages.data; - for (let i = messagesArray.length - 1; i >= 0; i--) { - const m = messagesArray[i]; - console.log(`Type: ${m.content[0].type}`); - if (isOutputOfType(m.content[0], "text")) { - const textContent = m.content[0]; - console.log(`Text: ${textContent.text.value}`); - } - } - - // 7. Delete the agent once done - await client.agents.deleteAgent(agent.id); -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); \ No newline at end of file diff --git a/quickstarts/ai-agents/ts/az-cli-roles.sh b/quickstarts/ai-agents/ts/az-cli-roles.sh new file mode 100644 index 00000000..90c9e00c --- /dev/null +++ b/quickstarts/ai-agents/ts/az-cli-roles.sh @@ -0,0 +1,23 @@ +# Define variables +subscription="YOUR_SUBSCRIPTION_ID" # Replace with your actual subscription ID +resource_group="YOUR_RESOURCE_GROUP" # Replace with your actual resource group name +project_name="YOUR_PROJECT_NAME" # Replace with your actual project name + +# Get the current logged in user and their object ID +echo "Getting details of the currently logged in user..." +current_user=$(az ad signed-in-user show --query userPrincipalName --output tsv) +echo "Current logged in user: $current_user" +assignee_object_id=$(az ad signed-in-user show --query id --output tsv) +echo "Object ID: $assignee_object_id" + +# Define resource and scope +resource_type="Microsoft.CognitiveServices/accounts" +resource_name="${project_name}" +scope="/subscriptions/$subscription/resourceGroups/$resource_group/providers/${resource_type}/${resource_name}" + +# Use variables in the command +az role assignment create \ + --role "Azure AI User" \ + --scope "$scope" \ + --assignee-object-id "$assignee_object_id" \ + --assignee-principal-type User \ No newline at end of file diff --git a/quickstarts/ai-agents/ts/data/company_name.csv b/quickstarts/ai-agents/ts/data/company_name.csv new file mode 100644 index 00000000..f0837c53 --- /dev/null +++ b/quickstarts/ai-agents/ts/data/company_name.csv @@ -0,0 +1,38 @@ +Company Name +Adatum Corporation +Adventure Works Cycles +Alpine Ski House +Bellows College +Best For You Organics Company +Boulder Innovations +Contoso, Ltd. +Contoso Pharmaceuticals +Contoso Suites +Consolidated Messenger +Fabrikam, Inc. +Fabrikam Residences +First Up Consultants +Fourth Coffee +Graphic Design Institute +Humongous Insurance +Lakeshore Retail +Lamna Healthcare Company +Liberty's Delightful Sinful Bakery & Cafe +Lucerne Publishing +Margie's Travel +Munson's Pickles and Preserves Farm +Nod Publishers +Northwind Traders +Proseware, Inc. +Relecloud +School of Fine Art +Southridge Video +Tailspin Toys +Tailwind Traders +Trey Research +The Phone Company +VanArsdel, Ltd. +Wide World Importers +Wingtip Toys +Woodgrove Bank +Woodgrove Groceries \ No newline at end of file diff --git a/quickstarts/ai-agents/ts/data/data.txt b/quickstarts/ai-agents/ts/data/data.txt new file mode 100644 index 00000000..e69de29b diff --git a/quickstarts/ai-agents/ts/data/nifty500QuarterlyResults.csv b/quickstarts/ai-agents/ts/data/nifty500QuarterlyResults.csv new file mode 100644 index 00000000..5d73e0a5 --- /dev/null +++ b/quickstarts/ai-agents/ts/data/nifty500QuarterlyResults.csv @@ -0,0 +1,37 @@ +name,NSE_code,BSE_code,sector,industry,revenue,operating_expenses,operating_profit,operating_profit_margin,depreciation,interest,profit_before_tax,tax,net_profit,EPS,profit_TTM,EPS_TTM +3M India Ltd.,3MINDIA,523395,GENERAL INDUSTRIALS,INDUSTRIAL MACHINERY,"1,057",847.4,192.1,18.48%,12.9,0.7,195.9,49.8,146.1,129.7,535.9,475.7 +ACC Ltd.,ACC,500410,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"4,644.8","3,885.4",549.3,12.39%,212.8,28.9,517.7,131.5,387.9,20.7,"1,202.7",64 +AIA Engineering Ltd.,AIAENG,532683,GENERAL INDUSTRIALS,OTHER INDUSTRIAL GOODS,"1,357.1",912.7,382.1,29.51%,24.5,7.4,412.5,88.4,323.1,34.3,"1,216.1",128.9 +APL Apollo Tubes Ltd.,APLAPOLLO,533758,METALS & MINING,IRON & STEEL PRODUCTS,"4,65","4,305.4",325,7.02%,41.3,26.6,276.7,73.8,202.9,7.3,767.5,27.7 +Au Small Finance Bank Ltd.,AUBANK,540611,BANKING AND FINANCE,BANKS,"2,956.5","1,026.7",647.7,25.59%,0,"1,282.1",533.4,131.5,401.8,6,"1,606.2",24 +Adani Ports & Special Economic Zone Ltd.,ADANIPORTS,532921,TRANSPORTATION,MARINE PORT & SERVICES,"6,951.9","2,982.4","3,664",55.13%,974.5,520.1,"2,474.9",759,"1,747.8",8.1,"6,337",29.3 +Adani Energy Solutions Ltd.,ADANIENSOL,ASM,UTILITIES,ELECTRIC UTILITIES,"3,766.5","2,169.3","1,504.6",40.95%,432.1,640.8,369.9,84.9,275.9,2.5,"1,315.1",11.8 +Aditya Birla Fashion and Retail Ltd.,ABFRL,535755,RETAILING,DEPARTMENT STORES,"3,272.2","2,903.6",322.9,10.01%,388.8,208.4,-228.6,-28.2,-179.2,-1.9,-491.7,-5.2 +Aegis Logistics Ltd.,AEGISCHEM,500003,OIL & GAS,OIL MARKETING & DISTRIBUTION,"1,279.3","1,026.5",208.3,16.87%,34.1,26.6,192,42,127,3.6,509,14.5 +Ajanta Pharma Ltd.,AJANTPHARM,532331,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,049.8",737.8,290.7,28.26%,33.7,2.3,275.9,80.6,195.3,15.5,660.2,52.3 +Alembic Pharmaceuticals Ltd.,APLLTD,533573,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,605.1","1,386.7",208.2,13.06%,67.6,15.7,135.1,-1.9,136.6,7,531.7,27 +Alkem Laboratories Ltd.,ALKEM,539523,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"3,503.4","2,693.4",746.7,21.71%,73.9,30.3,648,33.1,620.5,51.9,"1,432.9",119.9 +Amara Raja Energy & Mobility Ltd.,ARE&M,500008,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"2,988.6","2,556.9",402.5,13.60%,115.7,6.2,309.8,83.5,226.3,13.2,779.8,45.7 +Ambuja Cements Ltd.,AMBUJACEM,500425,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"7,9","6,122.1","1,301.8",17.54%,380.9,61.2,"1,335.7",352.5,793,4,"2,777.9",14 +Apollo Hospitals Enterprise Ltd.,APOLLOHOSP,508869,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE FACILITIES,"4,869.1","4,219.4",627.5,12.95%,163.4,111.3,376.9,130.2,232.9,16.2,697.5,48.5 +Apollo Tyres Ltd.,APOLLOTYRE,500877,AUTOMOBILES & AUTO COMPONENTS,AUTO TYRES & RUBBER PRODUCTS,"6,304.9","5,119.8","1,159.8",18.47%,360.3,132.8,679.9,205.8,474.3,7.5,"1,590.7",25 +Ashok Leyland Ltd.,ASHOKLEY,500477,AUTOMOBILES & AUTO COMPONENTS,COMMERCIAL VEHICLES,"11,463","9,558.6","1,870.4",16.37%,226.6,715.1,924.4,358,526,1.8,"2,141.5",7.3 +Asian Paints Ltd.,ASIANPAINT,500820,DIVERSIFIED CONSUMER SERVICES,FURNITURE-FURNISHING-PAINTS,"8,643.8","6,762.3","1,716.2",20.24%,208.7,50.9,"1,621.8",418.6,"1,205.4",12.6,"5,062.6",52.8 +Astral Ltd.,ASTRAL,532830,GENERAL INDUSTRIALS,PLASTIC PRODUCTS,"1,376.4","1,142.9",220.1,16.15%,48.7,8,176.8,45.1,131.2,4.9,549.7,20.4 +Atul Ltd.,ATUL,500027,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,"1,215.8","1,038.5",155.2,13.00%,54,1.9,121.5,32.5,90.3,30.6,392.3,132.9 +Aurobindo Pharma Ltd.,AUROPHARMA,524804,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"7,406.4","5,846","1,373.4",19.02%,417.5,68.2,"1,074.7",323.7,757.2,12.8,"2,325.5",39.7 +Avanti Feeds Ltd.,AVANTIFEED,512573,FOOD BEVERAGES & TOBACCO,OTHER FOOD PRODUCTS,"1,312","1,184.5",94,7.35%,14.3,0.2,113,30.5,74.2,5.5,336.4,24.7 +Avenue Supermarts Ltd.,DMART,540376,RETAILING,DEPARTMENT STORES,"12,661.3","11,619.4","1,005",7.96%,174.4,15.6,851.9,228.6,623.6,9.6,"2,332.1",35.8 +Axis Bank Ltd.,AXISBANK,532215,BANKING AND FINANCE,BANKS,"33,122.2","9,207.3","9,166",33.43%,0,"14,749","8,313.8","2,096.1","6,204.1",20.1,"13,121",42.6 +Bajaj Auto Ltd.,BAJAJ-AUTO,532977,AUTOMOBILES & AUTO COMPONENTS,2/3 WHEELERS,"11,206.8","8,708.1","2,130.1",19.65%,91.8,6.5,"2,400.4",564,"2,02",71.4,"6,841.6",241.8 +Bajaj Finance Ltd.,BAJFINANCE,500034,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"13,381.8","2,851.5","9,449.7",70.63%,158.5,"4,537.1","4,757.6","1,207","3,550.8",58.7,"13,118.5",216.7 +Bajaj Finserv Ltd.,BAJAJFINSV,532978,DIVERSIFIED,HOLDING COMPANIES,"26,022.7","14,992.2","9,949.9",38.24%,208.8,"4,449.1","5,292","1,536.5","1,929",12.1,"7,422.6",46.6 +Bajaj Holdings & Investment Ltd.,BAJAJHLDNG,500490,DIVERSIFIED,HOLDING COMPANIES,240.1,33.5,191.2,85.08%,8.4,0.2,197.9,73.9,"1,491.2",134,"5,545.1",498.3 +Balkrishna Industries Ltd.,BALKRISIND,502355,AUTOMOBILES & AUTO COMPONENTS,AUTO TYRES & RUBBER PRODUCTS,"2,360.3","1,720.5",532.7,23.64%,160.4,23.9,455.5,108.1,347.4,18,"1,047.5",54.2 +Balrampur Chini Mills Ltd.,BALRAMCHIN,500038,FOOD BEVERAGES & TOBACCO,SUGAR,"1,649","1,374.6",164.9,10.71%,41.2,17.2,215.9,56.6,166.3,8.2,540.5,26.8 +Bank of Baroda,BANKBARODA,532134,BANKING AND FINANCE,BANKS,"35,766","8,430.4","9,807.9",33.52%,0,"17,527.7","6,022.8","1,679.7","4,458.4",8.5,"18,602.9",35.9 +Bank of India,BANKINDIA,532149,BANKING AND FINANCE,BANKS,"16,779.4","3,704.9","3,818.8",25.35%,0,"9,255.7","2,977.4","1,488.6","1,498.5",3.6,"5,388.7",13.1 +Bata India Ltd.,BATAINDIA,500043,RETAILING,FOOTWEAR,834.6,637.5,181.7,22.18%,81.7,28.4,46.1,12.1,34,2.6,289.7,22.5 +Berger Paints (India) Ltd.,BERGEPAINT,509480,DIVERSIFIED CONSUMER SERVICES,FURNITURE-FURNISHING-PAINTS,"2,782.6","2,293.7",473.6,17.12%,82.9,21.1,385,96.7,291.6,2.5,"1,032.6",8.9 +Bharat Electronics Ltd.,BEL,500049,GENERAL INDUSTRIALS,DEFENCE,"4,146.1","2,994.9","1,014.2",25.30%,108.3,1.5,"1,041.5",260.7,789.4,1.1,"3,323",4.5 +Bharat Forge Ltd.,BHARATFORG,500493,GENERAL INDUSTRIALS,OTHER INDUSTRIAL PRODUCTS,"3,826.7","3,152.8",621.4,16.47%,211.3,124.3,336.1,121.8,227.2,4.9,783.7,16.8 diff --git a/quickstarts/ai-agents/ts/data/niftyList.csv b/quickstarts/ai-agents/ts/data/niftyList.csv new file mode 100644 index 00000000..12935a78 --- /dev/null +++ b/quickstarts/ai-agents/ts/data/niftyList.csv @@ -0,0 +1,37 @@ +name,revenue,operating_expenses,operating_profit,operating_profit_margin,depreciation,interest,profit_before_tax,tax,net_profit,EPS,profit_TTM,EPS_TTM,sector,industry +"Adatum Corporation","1,057","847.4","192.1","18.48%","12.9","0.7","195.9","49.8","146.1","129.7","535.9","475.7","Technology","Information Technology" +"Adventure Works Cycles","4,644.8","3,885.4","549.3","12.39%","212.8","28.9","517.7","131.5","387.9","20.7","1,202.7","64","Retail","Consumer Discretionary" +"Alpine Ski House","1,357.1","912.7","382.1","29.51%","24.5","7.4","412.5","88.4","323.1","34.3","1,216.1","128.9","Hospitality/Leisure","Consumer Discretionary" +"Bellows College","4,650","4,305.4","325","7.02%","41.3","26.6","276.7","73.8","202.9","7.3","767.5","27.7","Education","Consumer Discretionary" +"Best For You Organics Company","2,956.5","1,026.7","647.7","25.59%","0","1,282.1","533.4","131.5","401.8","6","1,606.2","24","Food & Beverage","Consumer Staples" +"Boulder Innovations","6,951.9","2,982.4","3,664","55.13%","974.5","520.1","2,474.9","759","1,747.8","8.1","6,337","29.3","Technology","Information Technology" +"Contoso","3,766.5","2,169.3","1,504.6","40.95%","432.1","640.8","369.9","84.9","275.9","2.5","1,315.1","11.8","Technology","Information Technology" +"Contoso Pharmaceuticals","3,272.2","2,903.6","322.9","10.01%","388.8","208.4","-228.6","-28.2","-179.2","-1.9","-491.7","-5.2","Health","Healthcare" +"Contoso Suites","1,279.3","1,026.5","208.3","16.87%","34.1","26.6","192","42","127","3.6","509","14.5","Real Estate","Real Estate" +"Consolidated Messenger","1,049.8","737.8","290.7","28.26%","33.7","2.3","275.9","80.6","195.3","15.5","660.2","52.3","Transportation","Industrials" +"Fabrikam","1,605.1","1,386.7","208.2","13.06%","67.6","15.7","135.1","-1.9","136.6","7","531.7","27","Technology","Information Technology" +"Fabrikam Residences","3,503.4","2,693.4","746.7","21.71%","73.9","30.3","648","33.1","620.5","51.9","1,432.9","119.9","Real Estate","Real Estate" +"First Up Consultants","2,988.6","2,556.9","402.5","13.60%","115.7","6.2","309.8","83.5","226.3","13.2","779.8","45.7","Professional services","Industrials" +"Fourth Coffee","7,900","6,122.1","1,301.8","17.54%","380.9","61.2","1,335.7","352.5","983.2","4","2,777.9","14","Food & Beverage","Consumer Staples" +"Graphic Design Institute","4,869.1","4,219.4","627.5","12.95%","163.4","111.3","376.9","130.2","232.9","16.2","697.5","48.5","Education","Consumer Discretionary" +"Humongous Insurance","6,304.9","5,119.8","1,159.8","18.47%","360.3","132.8","679.9","205.8","474.3","7.5","1,590.7","25","Financial services","Financials" +"Lakeshore Retail","11,463","9,558.6","1,870.4","16.37%","226.6","715.1","924.4","358","526","1.8","2,141.5","7.3","Retail","Consumer Discretionary" +"Lamna Healthcare Company","8,643.8","6,762.3","1,716.2","20.24%","208.7","50.9","1,621.8","418.6","1,205.4","12.6","5,062.6","52.8","Healthcare","Healthcare" +"Liberty's Delightful Sinful Bakery & Cafe","1,376.4","1,142.9","220.1","16.15%","48.7","8","176.8","45.1","131.2","4.9","549.7","20.4","Food & Beverage","Consumer Staples" +"Lucerne Publishing","1,215.8","1,038.5","155.2","13.00%","54","1.9","121.5","32.5","90.3","30.6","392.3","132.9","Publishing","Communication Services" +"Margie's Travel","7,406.4","5,846","1,373.4","19.02%","417.5","68.2","1,074.7","323.7","757.2","12.8","2,325.5","39.7","Entertainment","Communication Services" +"Munson's Pickles and Preserves Farm","1,312","1,184.5","94","7.35%","14.3","0.2","113","30.5","74.2","5.5","336.4","24.7","Food & Beverage","Consumer Staples" +"Nod Publishers","12,661.3","11,619.4","1,005","7.96%","174.4","15.6","851.9","228.6","623.6","9.6","2,332.1","35.8","Publishing","Communication Services" +"Northwind Traders","33,122.2","9,207.3","9,166","33.43%","0","14,749","8,313.8","2,096.1","6,204.1","20.1","13,121","42.6","Transportation","Industrials" +"Proseware","11,206.8","8,708.1","2,130.1","19.65%","91.8","6.5","2,400.4","564","1,836.4","71.4","6,841.6","241.8","Technology","Information Technology" +"Relecloud","13,381.8","2,851.5","9,449.7","70.63%","158.5","4,537.1","4,757.6","1,207","3,550.8","58.7","13,118.5","216.7","Technology","Information Technology" +"School of Fine Art","26,022.7","14,992.2","9,949.9","38.24%","208.8","4,449.1","5,292","1,536.5","3,755.5","12.1","7,422.6","46.6","Education","Consumer Discretionary" +"Southridge Video","240.1","33.5","191.2","85.08%","8.4","0.2","197.9","73.9","124.0","134","5,545.1","498.3","Entertainment","Communication Services" +"Tailspin Toys","2,360.3","1,720.5","532.7","23.64%","160.4","23.9","455.5","108.1","347.4","18","1,047.5","54.2","Retail","Consumer Discretionary" +"Tailwind Traders","1,649","1,374.6","164.9","10.71%","41.2","17.2","215.9","56.6","166.3","8.2","540.5","26.8","Transportation","Industrials" +"Trey Research","35,766","8,430.4","9,807.9","33.52%","0","17,527.7","6,022.8","1,679.7","4,458.4","8.5","18,602.9","35.9","R&D","Information Technology" +"The Phone Company","16,779.4","3,704.9","3,818.8","25.35%","0","9,255.7","2,977.4","1,488.6","1,498.5","3.6","5,388.7","13.1","Communications","Communication Services" +"VanArsdel","834.6","637.5","181.7","22.18%","81.7","28.4","46.1","12.1","34","2.6","289.7","22.5","Technology","Information Technology" +"Wide World Importers","2,782.6","2,293.7","473.6","17.12%","82.9","21.1","385","96.7","291.6","2.5","1,032.6","8.9","Transportation","Industrials" +"Wingtip Toys","4,146.1","2,994.9","1,014.2","25.30%","108.3","1.5","1,041.5","260.7","789.4","1.1","3,323","4.5","Retail","Consumer Discretionary" +"Woodgrove Bank","3,826.7","3,152.8","621.4","16.47%","211.3","124.3","336.1","121.8","227.2","4.9","783.7","16.8","Financial services","Financials" \ No newline at end of file diff --git a/quickstarts/ai-agents/ts/data/original.png b/quickstarts/ai-agents/ts/data/original.png new file mode 100644 index 00000000..29c32a33 Binary files /dev/null and b/quickstarts/ai-agents/ts/data/original.png differ diff --git a/quickstarts/ai-agents/ts/filterCompanies.js b/quickstarts/ai-agents/ts/filterCompanies.js new file mode 100644 index 00000000..d2f00179 --- /dev/null +++ b/quickstarts/ai-agents/ts/filterCompanies.js @@ -0,0 +1,88 @@ +// Script: filterCompanies.js +// Description: Reads nifty500QuarterlyResults.csv, filters to company names listed in data/data.txt, +// and removes the NSE_code, BSE_code, sector, and industry columns. +// Usage: npm install csv-parser && node filterCompanies.js + +const fs = require('fs'); +const path = require('path'); +const csv = require('csv-parser'); + +async function main() { + const dataDir = path.resolve(__dirname, 'data'); + const namesFile = path.join(dataDir, 'company_name.csv'); + const inputCsv = path.join(dataDir, 'nifty500QuarterlyResults.csv'); + const outputCsv = path.join(dataDir, 'nifty500Filtered.csv'); + + // Read company names from CSV + function loadNames() { + return new Promise((resolve, reject) => { + const list = []; + fs.createReadStream(namesFile) + .pipe(csv()) + .on('data', row => { + // adjust header key if different + list.push(row['Company Name'] || row.company_name || row.Name); + }) + .on('end', () => resolve(list)) + .on('error', reject); + }); + } + + // Read input rows and keep only specified columns + function loadRows() { + return new Promise((resolve, reject) => { + const out = []; + fs.createReadStream(inputCsv) + .pipe(csv()) + .on('data', row => { + // Keep only these five fields + out.push({ + name: row.name, + NSE_code: row.NSE_code, + BSE_code: row.BSE_code, + sector: row.sector, + industry: row.industry + }); + }) + .on('end', () => resolve(out)) + .on('error', reject); + }); + } + + const [names, rows] = await Promise.all([loadNames(), loadRows()]); + if (!rows.length) { + console.error('No input rows loaded.'); + process.exit(1); + } + if (!names.length) { + console.error('No company names loaded.'); + process.exit(1); + } + + // Map names to rows sequentially + rows.forEach((row, idx) => { + if (names[idx]) { + row.name = names[idx]; + } + }); + + // Ensure 'Transportation' industry is represented at least once + if (!rows.some(r => r.industry === 'Transportation')) { + rows[0].industry = 'Transportation'; + } + + // Write output CSV + const header = Object.keys(rows[0]); + const lines = [header.join(',')]; + for (const r of rows) { + const vals = header.map(h => '"' + String(r[h] ?? '').replace(/"/g, '""') + '"'); + lines.push(vals.join(',')); + } + fs.writeFileSync(outputCsv, lines.join('\n')); + console.log('Replaced names and wrote to', outputCsv); +} + +main().catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/quickstarts/ai-agents/ts/output2.txt b/quickstarts/ai-agents/ts/output2.txt new file mode 100644 index 00000000..198f825f --- /dev/null +++ b/quickstarts/ai-agents/ts/output2.txt @@ -0,0 +1,225 @@ +Uploaded local file, file ID : assistant-KDJrLoccLHn3Rfm69a4d3N +Created agent, agent ID: asst_bELfstDNUSckf4FAniqxsLoN +Created thread, thread ID: thread_wtwBiysPQIx4vhKOwWCF1MRr +Created message, message ID: msg_O9Rqtd4HQtYSFviszkZEoaQy +ThreadRun status: queued +Text delta received:: Let +Text delta received:: me +Text delta received:: first +Text delta received:: examine +Text delta received:: the +Text delta received:: contents +Text delta received:: of +Text delta received:: the +Text delta received:: uploaded +Text delta received:: CSV +Text delta received:: file +Text delta received:: to +Text delta received:: better +Text delta received:: understand +Text delta received:: the +Text delta received:: data +Text delta received:: in +Text delta received:: the +Text delta received:: TRAN +Text delta received:: SPORT +Text delta received:: ATION +Text delta received:: sector +Text delta received:: and +Text delta received:: focus +Text delta received:: on +Text delta received:: the +Text delta received:: operating +Text delta received:: profit +Text delta received:: . +Text delta received:: The +Text delta received:: dataset +Text delta received:: contains +Text delta received:: the +Text delta received:: following +Text delta received:: columns +Text delta received:: : + + +Text delta received:: 1 +Text delta received:: . +Text delta received:: ** +Text delta received:: Company +Text delta received:: ** +Text delta received:: : +Text delta received:: Name +Text delta received:: of +Text delta received:: the +Text delta received:: company +Text delta received:: . + +Text delta received:: 2 +Text delta received:: . +Text delta received:: ** +Text delta received:: Quarter +Text delta received:: ** +Text delta received:: : +Text delta received:: The +Text delta received:: quarter +Text delta received:: ( +Text delta received:: e +Text delta received:: .g +Text delta received:: ., +Text delta received:: Q +Text delta received:: 1 +Text delta received:: +Text delta received:: 202 +Text delta received:: 5 +Text delta received:: ). + +Text delta received:: 3 +Text delta received:: . +Text delta received:: ** +Text delta received:: Revenue +Text delta received:: ** +Text delta received:: : +Text delta received:: Revenue +Text delta received:: for +Text delta received:: the +Text delta received:: company +Text delta received:: in +Text delta received:: the +Text delta received:: given +Text delta received:: quarter +Text delta received:: . + +Text delta received:: 4 +Text delta received:: . +Text delta received:: ** +Text delta received:: Profit +Text delta received:: ** +Text delta received:: : +Text delta received:: Operating +Text delta received:: profit +Text delta received:: for +Text delta received:: the +Text delta received:: company +Text delta received:: in +Text delta received:: the +Text delta received:: given +Text delta received:: quarter +Text delta received:: . + + +Text delta received:: It +Text delta received:: doesn't +Text delta received:: explicitly +Text delta received:: label +Text delta received:: sectors +Text delta received:: like +Text delta received:: TRAN +Text delta received:: SPORT +Text delta received:: ATION +Text delta received:: in +Text delta received:: the +Text delta received:: data +Text delta received:: provided +Text delta received:: . +Text delta received:: Could +Text delta received:: you +Text delta received:: confirm +Text delta received:: if +Text delta received:: the +Text delta received:: sector +Text delta received:: is +Text delta received:: expected +Text delta received:: to +Text delta received:: be +Text delta received:: categorized +Text delta received:: by +Text delta received:: company +Text delta received:: name +Text delta received:: from +Text delta received:: external +Text delta received:: knowledge +Text delta received:: , +Text delta received:: or +Text delta received:: if +Text delta received:: there's +Text delta received:: additional +Text delta received:: information +Text delta received:: not +Text delta received:: visible +Text delta received:: here +Text delta received:: ? +Thread Run Completed +Stream completed. +Deleted file, file ID : assistant-KDJrLoccLHn3Rfm69a4d3N +Messages: [ + { + id: 'msg_38jBKPcMeixOnzGlV4bWVqgf', + object: 'thread.message', + createdAt: 2025-05-28T21:10:37.000Z, + threadId: 'thread_wtwBiysPQIx4vhKOwWCF1MRr', + status: undefined, + incompleteDetails: undefined, + completedAt: undefined, + incompleteAt: undefined, + role: 'assistant', + content: [ [Object] ], + assistantId: 'asst_bELfstDNUSckf4FAniqxsLoN', + runId: 'run_PhbxcVYpGb3CHRyxLjm9Tfaa', + attachments: [], + metadata: {} + }, + { + id: 'msg_7RDSc4I7QlVOALvprIyDEqxt', + object: 'thread.message', + createdAt: 2025-05-28T21:10:34.000Z, + threadId: 'thread_wtwBiysPQIx4vhKOwWCF1MRr', + status: undefined, + incompleteDetails: undefined, + completedAt: undefined, + incompleteAt: undefined, + role: 'assistant', + content: [ [Object] ], + assistantId: 'asst_bELfstDNUSckf4FAniqxsLoN', + runId: 'run_PhbxcVYpGb3CHRyxLjm9Tfaa', + attachments: [], + metadata: {} + }, + { + id: 'msg_O9Rqtd4HQtYSFviszkZEoaQy', + object: 'thread.message', + createdAt: 2025-05-28T21:10:32.000Z, + threadId: 'thread_wtwBiysPQIx4vhKOwWCF1MRr', + status: undefined, + incompleteDetails: undefined, + completedAt: undefined, + incompleteAt: undefined, + role: 'user', + content: [ [Object] ], + assistantId: null, + runId: null, + attachments: [], + metadata: {} + } +] +Saving new files... +Image file name : /workspaces/azure-typescript-e2e-apps/quickstarts/ai-agents/ts/data/undefinedImageFile.png +Message Details: +File Paths: +Type: text +Text: The dataset contains the following columns: + +1. **Company**: Name of the company. +2. **Quarter**: The quarter (e.g., Q1 2025). +3. **Revenue**: Revenue for the company in the given quarter. +4. **Profit**: Operating profit for the company in the given quarter. + +It doesn't explicitly label sectors like TRANSPORTATION in the data provided. Could you confirm if the sector is expected to be categorized by company name from external knowledge, or if there's additional information not visible here? +File ID: msg_38jBKPcMeixOnzGlV4bWVqgf +File Paths: +Type: text +Text: Let me first examine the contents of the uploaded CSV file to better understand the data in the TRANSPORTATION sector and focus on the operating profit. +File ID: msg_7RDSc4I7QlVOALvprIyDEqxt +File Paths: +Type: text +Text: Could you please create a bar chart in the TRANSPORTATION sector for the operating profit from the uploaded CSV file and provide the file to me? +File ID: msg_O9Rqtd4HQtYSFviszkZEoaQy +Deleted agent, agent ID: asst_bELfstDNUSckf4FAniqxsLoN \ No newline at end of file diff --git a/quickstarts/ai-agents/ts/package-lock.json b/quickstarts/ai-agents/ts/package-lock.json index 99a48ccc..31713b43 100644 --- a/quickstarts/ai-agents/ts/package-lock.json +++ b/quickstarts/ai-agents/ts/package-lock.json @@ -9,9 +9,11 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@azure/ai-agents": "^1.0.0-beta.3", "@azure/ai-projects": "^1.0.0-beta.2", "@azure/core-util": "^1.11.0", "@azure/identity": "^4.6.0", + "csv-parser": "^3.2.0", "dotenv": "^16.4.7" }, "devDependencies": { @@ -47,6 +49,41 @@ "node": ">=18.0.0" } }, + "node_modules/@azure/ai-agents": { + "version": "1.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@azure/ai-agents/-/ai-agents-1.0.0-beta.3.tgz", + "integrity": "sha512-ava9VKxYn5zdGlhZnO02OGZvYaRH0dOeRz3s26xCVgN5kzzr/N9XPv3MHikJr78TleadLudf/5gOgFac/gx+QQ==", + "dependencies": { + "@azure-rest/core-client": "^2.1.0", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.6.0", + "@azure/core-lro": "^3.0.0", + "@azure/core-paging": "^1.5.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/core-sse": "^2.1.3", + "@azure/core-tracing": "^1.2.0", + "@azure/core-util": "^1.9.0", + "@azure/logger": "^1.1.4", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/ai-agents/node_modules/@azure/core-lro": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-3.2.0.tgz", + "integrity": "sha512-SJEAe8fMDnjz2vw9dvEUi0DhAWe1sYkWQVTDc/HDcgNALaszGRopx3U+z1Pg/C9fsYiArp5pTBEcq29Ddph0WA==", + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "@azure/core-util": "^1.2.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@azure/ai-projects": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/@azure/ai-projects/-/ai-projects-1.0.0-beta.2.tgz", @@ -277,6 +314,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/csv-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/csv-parser/-/csv-parser-3.2.0.tgz", + "integrity": "sha512-fgKbp+AJbn1h2dcAHKIdKNSSjfp43BZZykXsCjzALjKy80VXQNHPFJ6T9Afwdzoj24aMkq8GwDS7KGcDPpejrA==", + "bin": { + "csv-parser": "bin/csv-parser" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/debug": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", diff --git a/quickstarts/ai-agents/ts/package.json b/quickstarts/ai-agents/ts/package.json index eccf9115..84dffc28 100644 --- a/quickstarts/ai-agents/ts/package.json +++ b/quickstarts/ai-agents/ts/package.json @@ -2,19 +2,22 @@ "name": "azureaiagents", "version": "1.0.0", "main": "index.js", - "type": "module", "scripts": { "build": "tsc", "start": "tsc && node -r dotenv/config dist/index.js", + "start:js": "node -r dotenv/config src/original.js", + "start:code": "tsc && node -r dotenv/config dist/codeInterpreterWithStreaming.js", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "description": "", "dependencies": { + "@azure/ai-agents": "^1.0.0-beta.3", "@azure/ai-projects": "^1.0.0-beta.2", "@azure/core-util": "^1.11.0", "@azure/identity": "^4.6.0", + "csv-parser": "^3.2.0", "dotenv": "^16.4.7" }, "devDependencies": { diff --git a/quickstarts/ai-agents/ts/src/codeInterpreterWithStreaming.ts b/quickstarts/ai-agents/ts/src/codeInterpreterWithStreaming.ts new file mode 100644 index 00000000..90b30d49 --- /dev/null +++ b/quickstarts/ai-agents/ts/src/codeInterpreterWithStreaming.ts @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This sample demonstrates how to use agent operations with code interpreter from the Azure Agents service. + * + * @summary demonstrates how to use agent operations with code interpreter. + */ +// @ts-nocheck +import type { + MessageDeltaChunk, + MessageDeltaTextContent, + MessageImageFileContent, + MessageTextContent, + ThreadRun, +} from "@azure/ai-agents"; +import { + RunStreamEvent, + MessageStreamEvent, + DoneEvent, + ErrorEvent, + AgentsClient, + isOutputOfType, + ToolUtility, +} from "@azure/ai-agents"; +import { DefaultAzureCredential } from "@azure/identity"; + +import * as fs from "fs"; +import path from "node:path"; +import "dotenv/config"; + +const projectEndpoint = process.env["PROJECT_ENDPOINT"] || ""; +const modelDeploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || "gpt-4o"; + +export async function main(): Promise { + // Create an Azure AI Client + const client = new AgentsClient(projectEndpoint, new DefaultAzureCredential(), { + retryOptions: { + maxRetries: 3, + retryDelayInMs: 2000 + } + }); + + // Upload file and wait for it to be processed + const filePath = "./data/niftyList.csv"; + console.log(`Uploading file from path: ${filePath}`); + const localFileStream = fs.createReadStream(filePath); + const localFile = await client.files.upload(localFileStream, "assistants", { + fileName: "myLocalFile", + }); + + console.log(`Uploaded local file, file ID : ${localFile.id}`); + + // Create code interpreter tool + const codeInterpreterTool = ToolUtility.createCodeInterpreterTool([localFile.id]); + + // Notice that CodeInterpreter must be enabled in the agent creation, otherwise the agent will not be able to see the file attachment + const agent = await client.createAgent(modelDeploymentName, { + name: "my-agent", + instructions: "You are a helpful agent", + tools: [codeInterpreterTool.definition], + toolResources: codeInterpreterTool.resources, + }); + console.log(`Created agent, agent ID: ${agent.id}`); + + // Create a thread + const thread = await client.threads.create(); + console.log(`Created thread, thread ID: ${thread.id}`); + + // Create a message + const message = await client.messages.create( + thread.id, + "user", + "Could you please create a bar chart to explain the operating profit for companies related to the transportation area from the uploaded CSV file and provide the file to me?", + ); + + console.log(`Created message, message ID: ${message.id}`); + + // Create and execute a run + const streamEventMessages = await client.runs.create(thread.id, agent.id).stream(); + + for await (const eventMessage of streamEventMessages) { + switch (eventMessage.event) { + case RunStreamEvent.ThreadRunCreated: + console.log(`ThreadRun status: ${(eventMessage.data as ThreadRun).status}`); + break; + case MessageStreamEvent.ThreadMessageDelta: + { + const messageDelta = eventMessage.data as MessageDeltaChunk; + messageDelta.delta.content.forEach((contentPart) => { + if (contentPart.type === "text") { + const textContent = contentPart as MessageDeltaTextContent; + const textValue = textContent.text?.value || "No text"; + console.log(`Text delta received:: ${textValue}`); + } + }); + } + break; + + case RunStreamEvent.ThreadRunCompleted: + console.log("Thread Run Completed"); + break; + case ErrorEvent.Error: + console.log(`An error occurred. Data ${eventMessage.data}`); + break; + case DoneEvent.Done: + console.log("Stream completed."); + break; + default: + + console.log(`Unhandled event type: ${JSON.stringify(eventMessage)}`); + + let waitSeconds = 1000; + + if (eventMessage.event.includes("thread.message")) { + const messageType = eventMessage.event; + const message = eventMessage?.data?.content?.forEach((contentPart) => { + if (contentPart.type === "text") { + + const message: string = contentPart.text?.value || "No text"; + + if( message.includes("Rate limit is exceeded. Try again in ")) { + const regex = /Rate limit is exceeded. Try again in (\d+) seconds/; + const match = message.match(regex); + if (match && match[1]) { + waitSeconds = parseInt(match[1], 10) * 1000; // Convert seconds to milliseconds + console.log(`Rate limit exceeded, waiting for ${waitSeconds} milliseconds`); + return new Promise((resolve) => setTimeout(resolve, waitSeconds)); + } + } else { + + return contentPart?.text?.value + ", " || "no text, "; + } + } + }); + console.log(`${messageType} received:: ${eventMessage?.event}`); + } + break; + } + } + + // Delete the original file from the agent to free up space (note: this does not delete your version of the file) + await client.files.delete(localFile.id); + console.log(`Deleted file, file ID : ${localFile.id}`); + + // Print the messages from the agent + const messagesIterator = client.messages.list(thread.id); + const messagesArray = []; + for await (const m of messagesIterator) { + messagesArray.push(m); + } + console.log("Messages:", messagesArray); + + // Get most recent message from the assistant + const assistantMessage = messagesArray.find((msg) => msg.role === "assistant"); + if (assistantMessage) { + // Look for an image file in the assistant's message + const imageFileOutput = assistantMessage.content.find(content => + content.type === "image_file" && content.imageFile?.fileId); + + if (imageFileOutput) { + try { + // Save the newly created file + console.log(`Saving new files...`); + const imageFile = imageFileOutput.imageFile.fileId; + const imageFileName = path.resolve( + "./data/" + (await client.files.get(imageFile)).filename + "ImageFile.png", + ); + console.log(`Image file name : ${imageFileName}`); + + const fileContent = await client.files.getContent(imageFile).asNodeStream(); + if (fileContent && fileContent.body) { + const chunks = []; + for await (const chunk of fileContent.body) { + chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)); + } + const buffer = Buffer.concat(chunks); + fs.writeFileSync(imageFileName, buffer); + console.log(`Successfully saved image to ${imageFileName}`); + } else { + console.error("No file content available in the response"); + } + } catch (error) { + console.error("Error saving image file:", error); + } + } else { + console.log("No image file found in assistant's message"); + } + } else { + console.log("No assistant message found"); + } + + // Iterate through messages and print details for each annotation + console.log(`Message Details:`); + messagesArray.forEach((m) => { + console.log(`File Paths:`); + console.log(`Type: ${m.content[0].type}`); + if (isOutputOfType(m.content[0], "text")) { + const textContent = m.content[0] as MessageTextContent; + console.log(`Text: ${textContent.text.value}`); + } + console.log(`File ID: ${m.id}`); + // firstId and lastId are properties of the paginator, not the messages array + // Removing these references as they don't exist in this context + }); + + // Delete the agent once done + await client.deleteAgent(agent.id); + console.log(`Deleted agent, agent ID: ${agent.id}`); +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); \ No newline at end of file diff --git a/quickstarts/ai-agents/ts/src/index.ts b/quickstarts/ai-agents/ts/src/index.ts index 1d53965a..4220e59e 100644 --- a/quickstarts/ai-agents/ts/src/index.ts +++ b/quickstarts/ai-agents/ts/src/index.ts @@ -1,110 +1,316 @@ -// index.ts -import { - AIProjectsClient, - DoneEvent, - ErrorEvent, - isOutputOfType, - MessageStreamEvent, - RunStreamEvent, - ToolUtility -} from "@azure/ai-projects"; -import type { - MessageDeltaChunk, - MessageDeltaTextContent, - MessageTextContentOutput -} from "@azure/ai-projects"; -import { DefaultAzureCredential } from "@azure/identity"; -import dotenv from 'dotenv'; - -dotenv.config(); - -// Set the connection string from the environment variable -const connectionString = process.env.PROJECT_CONNECTION_STRING; -const model = "gpt-4o"; - -// Throw an error if the connection string is not set -if (!connectionString) { - throw new Error("Please set the PROJECT_CONNECTION_STRING environment variable."); -} - -export async function main() { - const client = AIProjectsClient.fromConnectionString( - connectionString || "", - new DefaultAzureCredential(), - ); - - // Step 1 code interpreter tool - const codeInterpreterTool = ToolUtility.createCodeInterpreterTool([]); - - // Step 2 an agent - const agent = await client.agents.createAgent(model, { - name: "my-agent", - instructions: "You are a helpful agent", - tools: [codeInterpreterTool.definition], - toolResources: codeInterpreterTool.resources, - }); - - // Step 3 a thread - const thread = await client.agents.createThread(); - - // Step 4 a message to thread - await client.agents.createMessage( - thread.id, { - role: "user", - content: "I need to solve the equation `3x + 11 = 14`. Can you help me?", - }); - - // Intermission is now correlated with thread - // Intermission messages will retrieve the message just added - - // Step 5 the agent - const streamEventMessages = await client.agents.createRun(thread.id, agent.id).stream(); - - for await (const eventMessage of streamEventMessages) { - switch (eventMessage.event) { - case RunStreamEvent.ThreadRunCreated: - break; - case MessageStreamEvent.ThreadMessageDelta: - { - const messageDelta = eventMessage.data as MessageDeltaChunk; - messageDelta.delta.content.forEach((contentPart) => { - if (contentPart.type === "text") { - const textContent = contentPart as MessageDeltaTextContent; - const textValue = textContent.text?.value || "No text"; - } - }); - } - break; - - case RunStreamEvent.ThreadRunCompleted: - break; - case ErrorEvent.Error: - console.log(`An error occurred. Data ${eventMessage.data}`); - break; - case DoneEvent.Done: - break; - } - } - - // 6. Print the messages from the agent - const messages = await client.agents.listMessages(thread.id); - - // Messages iterate from oldest to newest - // messages[0] is the most recent - const messagesArray = messages.data; - for (let i = messagesArray.length - 1; i >= 0; i--) { - const m = messagesArray[i]; - console.log(`Type: ${m.content[0].type}`); - if (isOutputOfType(m.content[0], "text")) { - const textContent = m.content[0] as MessageTextContentOutput; - console.log(`Text: ${textContent.text.value}`); - } - } - - // 7. Delete the agent once done - await client.agents.deleteAgent(agent.id); -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); \ No newline at end of file +// index.ts +// This sample demonstrates how to use the Azure AI Agents SDK +// It's organized in phases: setup, execution, processing results, downloading files, and cleanup +import { + RunStreamEvent, + MessageStreamEvent, + DoneEvent, + ErrorEvent, + AgentsClient, + isOutputOfType, + ToolUtility, + Agent, + AgentThread, + FileInfo, + ThreadMessage +} from "@azure/ai-agents"; +import { DefaultAzureCredential } from "@azure/identity"; + +import * as fs from "fs"; +import * as path from "node:path"; +import "dotenv/config"; + +// Handle unhandled promise rejections and uncaught exceptions +process.on('unhandledRejection', (reason, promise) => { + console.error('Unhandled Rejection at:', promise, 'reason:', reason); +}); +process.on('uncaughtException', (error) => { + console.error('Uncaught Exception:', error); +}); + +// Configuration +const projectEndpoint = process.env["PROJECT_ENDPOINT"]!; +const modelDeploymentName = process.env["MODEL_DEPLOYMENT_NAME"]! || "gpt-4o"; + +if (!process.env["PROJECT_ENDPOINT"]) { + throw new Error("PROJECT_ENDPOINT environment variable is required"); +} + +/** + * Initialize the client, upload files, and create agent and thread + */ +async function setupAgentAndResources(client: AgentsClient): Promise<{ + agent: Agent; + thread: AgentThread; + localFile: FileInfo; +}> { + console.log("Setting up agent and resources..."); + + // Upload file and wait for it to be processed + const filePath = "./data/niftyList.csv"; + const localFileStream = fs.createReadStream(filePath); + const localFile = await client.files.upload(localFileStream, "assistants", { + fileName: "myLocalFile", + }); + console.log(`Uploaded local file, file ID : ${localFile.id}`); + + // Create code interpreter tool + const codeInterpreterTool = ToolUtility.createCodeInterpreterTool([localFile.id]); + + // Create agent with code interpreter tool + const agent = await client.createAgent(modelDeploymentName, { + name: "my-agent", + instructions: "You are a helpful agent", + tools: [codeInterpreterTool.definition], + toolResources: codeInterpreterTool.resources, + }); + console.log(`Created agent, agent ID: ${agent.id}`); + + // Create a thread + const thread = await client.threads.create(); + console.log(`Created thread, thread ID: ${thread.id}`); + + return { agent, thread, localFile }; +} + +/** + * Execute a task by sending a message to the agent and processing the streaming response + */ +async function executeAgentTask( + client: AgentsClient, + thread: AgentThread, + agent: Agent, + userPrompt: string +): Promise { + console.log("Executing agent task..."); + + // Create a message + const message = await client.messages.create(thread.id, "user", userPrompt); + console.log(`Created message, message ID: ${message.id}`); + + // Create and execute a run with streaming responses + const streamEventMessages = await client.runs.create(thread.id, agent.id).stream(); + + // Process streaming events + for await (const eventMessage of streamEventMessages) { + switch (eventMessage.event) { + case RunStreamEvent.ThreadRunCreated: + // Type check or cast to access the status property safely + if (typeof eventMessage.data === 'object' && eventMessage.data !== null && 'status' in eventMessage.data) { + console.log(`ThreadRun status: ${eventMessage.data.status}`); + } else { + console.log(`ThreadRun created: ${JSON.stringify(eventMessage.data)}`); + } + break; + + case MessageStreamEvent.ThreadMessageDelta: + { + const messageDelta = eventMessage.data; + // Type check or cast to access the delta property safely + if (typeof messageDelta === 'object' && + messageDelta !== null && + 'delta' in messageDelta && + messageDelta.delta && + 'content' in messageDelta.delta && + Array.isArray(messageDelta.delta.content)) { + + messageDelta.delta.content.forEach((contentPart) => { + if (contentPart.type === "text") { + const textContent = contentPart; + // Add type guard for text content + if ('text' in textContent && + textContent.text && + typeof textContent.text === 'object') { + const textValue = textContent.text.value || "No text"; + console.log(`Text delta received:: ${textValue}`); + } + } + }); + } + } + break; + + case RunStreamEvent.ThreadRunCompleted: + console.log("Thread Run Completed"); + break; + + case ErrorEvent.Error: + console.log(`An error occurred. Data ${eventMessage.data}`); + break; + + case DoneEvent.Done: + console.log("Stream completed."); + break; + } + } + + return message; +} + +/** + * Retrieve and process the results from the agent + */ +async function processResults(client: AgentsClient, threadId: string): Promise { + console.log("Processing results..."); + + // Print the messages from the agent + const messagesIterator = client.messages.list(threadId); + const messagesArray: ThreadMessage[] = []; + + for await (const m of messagesIterator) { + messagesArray.push(m); + } + + console.log(`Message Details:`); + messagesArray.forEach((m) => { + console.log(`File Paths:`); + console.log(`Type: ${m.content[0].type}`); + + if (isOutputOfType(m.content[0], "text")) { + const textContent = m.content[0]; + // Use type guard to safely access text property + if ('text' in textContent && + textContent.text && + typeof textContent.text === 'object' && + 'value' in textContent.text) { + console.log(`Text: ${textContent.text.value}`); + } + } + + console.log(`File ID: ${m.id}`); + }); + + return messagesArray; +} + +/** + * Download and save any files generated by the agent + */ +async function downloadGeneratedFiles( + client: AgentsClient, + messages: ThreadMessage[] +): Promise { + console.log("Checking for and downloading generated files..."); + + // Get most recent message from the assistant + const assistantMessage = messages.find((msg) => msg.role === "assistant"); + if (!assistantMessage) { + console.log("No assistant message found"); + return; + } + + const textContent = assistantMessage.content.find((content: any) => isOutputOfType(content, "text")); + if (!textContent) { + console.log("No text content found in assistant message"); + return; + } + + // Save the newly created file + console.log(`Saving new files...`); + const imageFileOutput = messages[0].content[0]; + + // Use type checking to safely access the imageFile property + let imageFileId = ''; + + // Check if content has image file type and has the correct structure + if (isOutputOfType(imageFileOutput, "image_file") && + 'image_file' in imageFileOutput && + imageFileOutput.image_file && + typeof imageFileOutput.image_file === 'object') { + // Use type assertion after validating the structure + const typedImageFile = imageFileOutput.image_file as { fileId: string }; + if ('fileId' in typedImageFile && typeof typedImageFile.fileId === 'string') { + imageFileId = typedImageFile.fileId; + } + } + + if (!imageFileId) { + console.log("No image file found in the message content"); + return; + } + + const imageFileName = path.resolve( + "./data/" + (await client.files.get(imageFileId)).filename + "ImageFile.png", + ); + console.log(`Image file name : ${imageFileName}`); + + const fileContent = await (await client.files.getContent(imageFileId).asNodeStream()).body; + if (!fileContent) { + console.log("No file content available"); + return; + } + + const chunks = []; + for await (const chunk of fileContent) { + chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)); + } + const buffer = Buffer.concat(chunks); + + try { + fs.writeFileSync(imageFileName, buffer); + console.log(`File saved to ${imageFileName}`); + } catch (error) { + console.error(`Error saving file to ${imageFileName}:`, error); + } + + console.log(`File saved to ${imageFileName}`); + + return imageFileName; +} + +/** + * Clean up resources - delete files and agent + */ +async function cleanupResources( + client: AgentsClient, + agentId: string, + fileId: string +): Promise { + console.log("Cleaning up resources..."); + + // Delete the file from the agent to free up space + await client.files.delete(fileId); + console.log(`Deleted file, file ID : ${fileId}`); + + // Delete the agent once done + await client.deleteAgent(agentId); + console.log(`Deleted agent, agent ID: ${agentId}`); +} + +/** + * Main function to demonstrate the Azure AI Agents SDK + */ +async function main() { + try { + // Create an Azure AI Client + const client = new AgentsClient(projectEndpoint, new DefaultAzureCredential(), { + retryOptions: { + maxRetries: 3, // number of retry attempts + retryDelayInMs: 2000 // delay between retries in milliseconds + } + }); + + // Step 1: Setup agent and resources + const { agent, thread, localFile } = await setupAgentAndResources(client); + + // Step 2: Execute a task + const userPrompt = "Could you please create a bar chart in the TRANSPORTATION sector for the operating profit from the uploaded CSV file and provide the file to me?"; + await executeAgentTask(client, thread, agent, userPrompt); + + // Step 3: Process the results + const messages = await processResults(client, thread.id); + + // Step 4: Download any generated files + await downloadGeneratedFiles(client, messages); + + // Step 5: Cleanup resources + await cleanupResources(client, agent.id, localFile.id); + + console.log("Azure AI Agents sample completed successfully!"); + } catch (error) { + console.error("The sample encountered an error:", error); + } +} + +// Execute the sample +main(); diff --git a/quickstarts/ai-agents/ts/src/index.ts.old b/quickstarts/ai-agents/ts/src/index.ts.old new file mode 100644 index 00000000..35e132ba --- /dev/null +++ b/quickstarts/ai-agents/ts/src/index.ts.old @@ -0,0 +1,292 @@ +// index.ts +// This sample demonstrates how to use the Azure AI Agents SDK +// It's organized in phases: setup, execution, processing results, downloading files, and cleanup +import { + RunStreamEvent, + MessageStreamEvent, + DoneEvent, + ErrorEvent, + AgentsClient, + isOutputOfType, + ToolUtility, + Agent, + Thread, + File, + Message, +} from "@azure/ai-agents"; +import { DefaultAzureCredential } from "@azure/identity"; + +import * as fs from "fs"; +import * as path from "node:path"; +import "dotenv/config"; + +// Configuration +const projectEndpoint = process.env["PROJECT_ENDPOINT"]!; +const modelDeploymentName = process.env["MODEL_DEPLOYMENT_NAME"]! || "gpt-4o"; + +/** + * Initialize the client, upload files, and create agent and thread + */ +async function setupAgentAndResources(client: AgentsClient): Promise<{ + agent: Agent; + thread: Thread; + localFile: File; +}> { + console.log("Setting up agent and resources..."); + + // Upload file and wait for it to be processed + const filePath = "./data/nifty500QuarterlyResults.csv"; + const localFileStream = fs.createReadStream(filePath); + const localFile = await client.files.upload(localFileStream, "assistants", { + fileName: "myLocalFile", + }); + console.log(`Uploaded local file, file ID : ${localFile.id}`); + + // Create code interpreter tool + const codeInterpreterTool = ToolUtility.createCodeInterpreterTool([localFile.id]); + + // Create agent with code interpreter tool + const agent = await client.createAgent(modelDeploymentName, { + name: "my-agent", + instructions: "You are a helpful agent", + tools: [codeInterpreterTool.definition], + toolResources: codeInterpreterTool.resources, + }); + console.log(`Created agent, agent ID: ${agent.id}`); + + // Create a thread + const thread = await client.threads.create(); + console.log(`Created thread, thread ID: ${thread.id}`); + + return { agent, thread, localFile }; +} + +/** + * Execute a task by sending a message to the agent and processing the streaming response + */ +async function executeAgentTask( + client: AgentsClient, + thread: Thread, + agent: Agent, + userPrompt: string +): Promise { + console.log("Executing agent task..."); + + // Create a message + const message = await client.messages.create(thread.id, "user", userPrompt); + console.log(`Created message, message ID: ${message.id}`); + + // Create and execute a run with streaming responses + const streamEventMessages = await client.runs.create(thread.id, agent.id).stream(); + + // Process streaming events + for await (const eventMessage of streamEventMessages) { + switch (eventMessage.event) { + case RunStreamEvent.ThreadRunCreated: + // Type check or cast to access the status property safely + if (typeof eventMessage.data === 'object' && eventMessage.data !== null && 'status' in eventMessage.data) { + console.log(`ThreadRun status: ${eventMessage.data.status}`); + } else { + console.log(`ThreadRun created: ${JSON.stringify(eventMessage.data)}`); + } + break; + + case MessageStreamEvent.ThreadMessageDelta: + { + const messageDelta = eventMessage.data; + // Type check or cast to access the delta property safely + if (typeof messageDelta === 'object' && + messageDelta !== null && + 'delta' in messageDelta && + messageDelta.delta && + 'content' in messageDelta.delta && + Array.isArray(messageDelta.delta.content)) { + + messageDelta.delta.content.forEach((contentPart) => { + if (contentPart.type === "text") { + const textContent = contentPart; + // Add type guard for text content + if ('text' in textContent && + textContent.text && + typeof textContent.text === 'object') { + const textValue = textContent.text.value || "No text"; + console.log(`Text delta received:: ${textValue}`); + } + } + }); + } + } + break; + + case RunStreamEvent.ThreadRunCompleted: + console.log("Thread Run Completed"); + break; + + case ErrorEvent.Error: + console.log(`An error occurred. Data ${eventMessage.data}`); + break; + + case DoneEvent.Done: + console.log("Stream completed."); + break; + } + } + + return message; +} + +/** + * Retrieve and process the results from the agent + */ +async function processResults(client: AgentsClient, threadId: string): Promise { + console.log("Processing results..."); + + // Print the messages from the agent + const messagesIterator = client.messages.list(threadId); + const messagesArray = []; + + for await (const m of messagesIterator) { + messagesArray.push(m); + } + + console.log(`Message Details:`); + messagesArray.forEach((m) => { + console.log(`File Paths:`); + console.log(`Type: ${m.content[0].type}`); + + if (isOutputOfType(m.content[0], "text")) { + const textContent = m.content[0]; + // Use type guard to safely access text property + if ('text' in textContent && + textContent.text && + typeof textContent.text === 'object' && + 'value' in textContent.text) { + console.log(`Text: ${textContent.text.value}`); + } + } + + console.log(`File ID: ${m.id}`); + }); + + return messagesArray; +} + +/** + * Download and save any files generated by the agent + */ +async function downloadGeneratedFiles( + client: AgentsClient, + messages: any[] +): Promise { + console.log("Checking for and downloading generated files..."); + + // Get most recent message from the assistant + const assistantMessage = messages.find((msg) => msg.role === "assistant"); + if (!assistantMessage) { + console.log("No assistant message found"); + return; + } + + const textContent = assistantMessage.content.find((content) => isOutputOfType(content, "text")); + if (!textContent) { + console.log("No text content found in assistant message"); + return; + } + + // Save the newly created file + console.log(`Saving new files...`); + const imageFileOutput = messages[0].content[0]; + + // Use type checking to safely access the imageFile property + let imageFileId = ''; + + // Check if content has image file type and has the correct structure + if (isOutputOfType(imageFileOutput, "image_file") && + 'image_file' in imageFileOutput && + imageFileOutput.image_file && + typeof imageFileOutput.image_file === 'object') { + // Use type assertion after validating the structure + const typedImageFile = imageFileOutput.image_file as { fileId: string }; + if ('fileId' in typedImageFile && typeof typedImageFile.fileId === 'string') { + imageFileId = typedImageFile.fileId; + } + } + + if (!imageFileId) { + console.log("No image file found in the message content"); + return; + } + + const imageFileName = path.resolve( + "./data/" + (await client.files.get(imageFileId)).filename + "ImageFile.png", + ); + console.log(`Image file name : ${imageFileName}`); + + const fileContent = await (await client.files.getContent(imageFileId).asNodeStream()).body; + if (!fileContent) { + console.log("No file content available"); + return; + } + + const chunks = []; + for await (const chunk of fileContent) { + chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)); + } + const buffer = Buffer.concat(chunks); + fs.writeFileSync(imageFileName, buffer); + console.log(`File saved to ${imageFileName}`); + + return imageFileName; +} + +/** + * Clean up resources - delete files and agent + */ +async function cleanupResources( + client: AgentsClient, + agentId: string, + fileId: string +): Promise { + console.log("Cleaning up resources..."); + + // Delete the file from the agent to free up space + await client.files.delete(fileId); + console.log(`Deleted file, file ID : ${fileId}`); + + // Delete the agent once done + await client.deleteAgent(agentId); + console.log(`Deleted agent, agent ID: ${agentId}`); +} + +/** + * Main function to demonstrate the Azure AI Agents SDK + */ +async function main() { + try { + // Create an Azure AI Client + const client = new AgentsClient(projectEndpoint, new DefaultAzureCredential()); + + // Step 1: Setup agent and resources + const { agent, thread, localFile } = await setupAgentAndResources(client); + + // Step 2: Execute a task + const userPrompt = "Could you please create a bar chart in the TRANSPORTATION sector for the operating profit from the uploaded CSV file and provide the file to me?"; + await executeAgentTask(client, thread, agent, userPrompt); + + // Step 3: Process the results + const messages = await processResults(client, thread.id); + + // Step 4: Download any generated files + await downloadGeneratedFiles(client, messages); + + // Step 5: Cleanup resources + await cleanupResources(client, agent.id, localFile.id); + + console.log("Azure AI Agents sample completed successfully!"); + } catch (error) { + console.error("The sample encountered an error:", error); + } +} + +// Execute the sample +main(); diff --git a/quickstarts/ai-agents/ts/src/original.js b/quickstarts/ai-agents/ts/src/original.js new file mode 100644 index 00000000..bf689a5a --- /dev/null +++ b/quickstarts/ai-agents/ts/src/original.js @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This sample demonstrates how to use agent operations with code interpreter from the Azure Agents service. + * + * @summary demonstrates how to use agent operations with code interpreter. + */ + +const { + RunStreamEvent, + MessageStreamEvent, + DoneEvent, + ErrorEvent, + AgentsClient, + isOutputOfType, + ToolUtility, +} = require("@azure/ai-agents"); +const { DefaultAzureCredential } = require("@azure/identity"); + +const fs = require("fs"); +const path = require("node:path"); +require("dotenv/config"); + +const projectEndpoint = process.env["PROJECT_ENDPOINT"] || ""; +const modelDeploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || "gpt-4o"; + +async function main() { + // Create an Azure AI Client + const client = new AgentsClient(projectEndpoint, new DefaultAzureCredential()); + + // Upload file and wait for it to be processed + const filePath = "./data/nifty500QuarterlyResults.csv"; + const localFileStream = fs.createReadStream(filePath); + const localFile = await client.files.upload(localFileStream, "assistants", { + fileName: "myLocalFile", + }); + + console.log(`Uploaded local file, file ID : ${localFile.id}`); + + // Create code interpreter tool + const codeInterpreterTool = ToolUtility.createCodeInterpreterTool([localFile.id]); + + // Notice that CodeInterpreter must be enabled in the agent creation, otherwise the agent will not be able to see the file attachment + const agent = await client.createAgent(modelDeploymentName, { + name: "my-agent", + instructions: "You are a helpful agent", + tools: [codeInterpreterTool.definition], + toolResources: codeInterpreterTool.resources, + }); + console.log(`Created agent, agent ID: ${agent.id}`); + + // Create a thread + const thread = await client.threads.create(); + console.log(`Created thread, thread ID: ${thread.id}`); + + // Create a message + const message = await client.messages.create( + thread.id, + "user", + "Could you please create a bar chart in the TRANSPORTATION sector for the operating profit from the uploaded CSV file and provide the file to me?", + ); + + console.log(`Created message, message ID: ${message.id}`); + + // Create and execute a run + const streamEventMessages = await client.runs.create(thread.id, agent.id).stream(); + + for await (const eventMessage of streamEventMessages) { + switch (eventMessage.event) { + case RunStreamEvent.ThreadRunCreated: + console.log(`ThreadRun status: ${eventMessage.data.status}`); + break; + case MessageStreamEvent.ThreadMessageDelta: + { + const messageDelta = eventMessage.data; + messageDelta.delta.content.forEach((contentPart) => { + if (contentPart.type === "text") { + const textContent = contentPart; + const textValue = textContent.text?.value || "No text"; + console.log(`Text delta received:: ${textValue}`); + } + }); + } + break; + + case RunStreamEvent.ThreadRunCompleted: + console.log("Thread Run Completed"); + break; + case ErrorEvent.Error: + console.log(`An error occurred. Data ${eventMessage.data}`); + break; + case DoneEvent.Done: + console.log("Stream completed."); + break; + } + } + + // Delete the original file from the agent to free up space (note: this does not delete your version of the file) + await client.files.delete(localFile.id); + console.log(`Deleted file, file ID : ${localFile.id}`); + + // Print the messages from the agent + const messagesIterator = client.messages.list(thread.id); + const messagesArray = []; + for await (const m of messagesIterator) { + messagesArray.push(m); + } + console.log("Messages:", messagesArray); + +// Get most recent message from the assistant + const assistantMessage = messagesArray.find((msg) => msg.role === "assistant"); + if (assistantMessage) { + // Look for an image file in the assistant's message + const imageFileOutput = assistantMessage.content.find(content => + content.type === "image_file" && content.imageFile?.fileId); + + if (imageFileOutput) { + try { + // Save the newly created file + console.log(`Saving new files...`); + const imageFile = imageFileOutput.imageFile.fileId; + const imageFileName = path.resolve( + "./data/" + (await client.files.get(imageFile)).filename + "ImageFile.png", + ); + console.log(`Image file name : ${imageFileName}`); + + const fileContent = await client.files.getContent(imageFile).asNodeStream(); + if (fileContent && fileContent.body) { + const chunks = []; + for await (const chunk of fileContent.body) { + chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)); + } + const buffer = Buffer.concat(chunks); + fs.writeFileSync(imageFileName, buffer); + console.log(`Successfully saved image to ${imageFileName}`); + } else { + console.error("No file content available in the response"); + } + } catch (error) { + console.error("Error saving image file:", error); + } + } else { + console.log("No image file found in assistant's message"); + } + } else { + console.log("No assistant message found"); + } + + // Iterate through messages and print details for each annotation + console.log(`Message Details:`); + messagesArray.forEach((m) => { + console.log(`File Paths:`); + console.log(`Type: ${m.content[0].type}`); + if (isOutputOfType(m.content[0], "text")) { + const textContent = m.content[0]; + console.log(`Text: ${textContent.text.value}`); + } + console.log(`File ID: ${m.id}`); + // firstId and lastId are properties of the paginator, not the messages array + // Removing these references as they don't exist in this context + }); + + // Delete the agent once done + await client.deleteAgent(agent.id); + console.log(`Deleted agent, agent ID: ${agent.id}`); +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); + +module.exports = { main }; \ No newline at end of file diff --git a/quickstarts/ai-agents/ts/tsconfig.json b/quickstarts/ai-agents/ts/tsconfig.json index 24ca592a..51855852 100644 --- a/quickstarts/ai-agents/ts/tsconfig.json +++ b/quickstarts/ai-agents/ts/tsconfig.json @@ -15,6 +15,6 @@ "esModuleInterop": true, "skipLibCheck": true }, - "include": ["src/**/*"], + "include": ["src/**/*", "index.js"], "exclude": ["node_modules", "dist"] } \ No newline at end of file