Skip to content

Conversation

@DanWahlin
Copy link
Contributor

This pull request introduces significant updates to the quickstart.js file in the Azure AI sample project. The changes include enhancements to the agent creation and execution process, the addition of a file search agent, and improvements to logging and message handling. Key updates are summarized below.

Enhancements to agent functionality:

  • Renamed runAgent to runAgents and added detailed logging for agent execution, including user prompts, run statuses, and token usage. Enhanced the agent interaction flow with a helper function (printAssistantMessage) to format assistant responses. [1] [2]

Addition of file search agent:

  • Introduced functionality to upload a file, create a vector store, and use a file search tool to retrieve information from uploaded files. Added detailed logging for file uploads, vector store details, and assistant responses.

Code improvements:

  • Added imports for fs, path, and fileURLToPath to handle file operations and paths. Defined __dirname for compatibility with ES modules.
  • Commented out the chatCompletion function call and updated the runAgents function call to reflect the new functionality.

Error handling and event streaming:

  • Implemented event-based handling for file search runs, processing events such as ThreadRunCreated, ThreadMessageDelta, and ErrorEvent. This ensures robust handling of streaming responses and errors.

@qubitron qubitron merged commit 49a12a9 into azure-ai-foundry:main May 9, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants