When to use API plugins
Using API plugins, you allow declarative agent to communicate with APIs to read and modify external data. Learn how to decide when to use API plugins to extend your declarative agent.
Decision criteria
API plugins offer you powerful integration capabilities for your declarative agents. The following criteria help you decide if API plugins are suitable for your scenario.
Data beyond the foundational model
The first thing that you need to understand is whether the agent can meet your requirements using only the information from its foundational model. If it needs access to additional information, such as your internal databases, you need to extend it with, for example, an API plugin.
Data shape
The next thing that you need to understand is the shape of the data that the agent needs to access. Is the data structured, like customer records or orders, or is it unstructured like a document or report? If the data is structured, it's a good match for use with an API plugin. If it's unstructured, do you have a search index and an API that the agent could use? Otherwise, you could consider using a Copilot connector to ingest the data to Microsoft 365 and benefit from its search capabilities.
Data access
The final thing that determines the decision to use an API plugin and the amount of effort involved is the ability for the plugin to access the data. Do you have an API that the agent could connect to? Do you have an OpenAPI specification that describes the API? Does the API use an authentication mechanism that the agent can handle? Is the API simple to understand or use or does it use complex queries that a language model couldn't make?
Apply the criteria
API plugins work best when you need to connect a declarative agent to structured and frequently changing data outside of its foundational model. Because there are nuances to this decision, let's think about how to apply these criteria to our example scenario.
- Does the agent need access to data beyond the foundational model? Yes. The information about repairs isn't part of the agent's foundational model. Instead, the information is stored in a database and exposed through an API, which is why using an API plugin is a good way to give the agent access to this information.
- Is the information structured? Yes. Repairs information is structured data exposed through an API. Because it doesn't need more processing, it's suitable for use by an API plugin.
- Is the information exposed through an API accessible over the internet? Yes. Repairs information is exposed through an API. The API is accessible over the internet and secured with an API key, which means that the agent can securely interact with it.
A declarative agent with an API plugin seems like a good solution for our scenario. It meets all our requirements and even offers us the ability to extend the assistant in the future to allow users to modify information about repairs.
Guidance summary
The following flowchart summarizes the key questions to ask when you're considering extending your declarative agent with an API plugin.