Learning by Patrik

AI-103: Develop AI Apps and Agents on Azure

...see more

A generative AI app becomes significantly more capable when the model can use external tools instead of relying only on its trained knowledge. In Microsoft Foundry, tools can give an LLM access to live information, private data, code execution, and application functions.

Tools extend the LLM

The Responses API accepts a collection of tools that the model can use when processing a request. Four important types are:

Code Interpreter
Lets the model generate and execute code. This is useful for calculations and data analysis where deterministic code execution is preferable to relying on token prediction.

Web Search
Provides access to current web information that may not exist in the model’s training data.

File Search
Grounds responses in your own documents. The retrieval pipeline works roughly like this:

Files → Chunking → Embeddings → Vector Store → Semantic Search → LLM Context

Documents are uploaded to a vector store, chunked, and converted into embeddings. At query time, the user’s request is compared semantically with those embeddings. Relevant chunks are retrieved and added to the model context before the response is generated.

Function Calling
Connects the model to application-specific logic such as APIs, databases, or business operations.

A typical execution flow is:

User → LLM → Function Call → Application → Function → Result → LLM → Response

The application defines available functions with a name, description, and parameters. The model determines when a function is required and returns a structured function-call request. Your application executes the function and sends its result back to the model.

In real applications, this usually runs in a loop because one request may require multiple tool calls.

Combining multiple tools

Tools become especially useful when combined. For example, an AI assistant could use:

  • Web Search for current information

  • File Search for company-specific knowledge

  • Code Interpreter for calculations

  • Functions for application actions

The result is an architecture where the LLM handles reasoning and tool selection, while specialized components handle retrieval, computation, and execution.

That separation is a key step from building a simple chatbot toward building grounded, tool-enabled AI applications and agents.

Related Snipps on Snippset

Comments