Tool Use Patterns
Different ways to use the Aipolabs ACI SDK
You can give your AI agent different levels of tool-use autonomy through the meta functions:
- Pattern 1: Pre-planned Tools
- Provide the specific functions (tools) to be used by an LLM.
- Pattern 2: Dynamic Tool Discovery and Execution
- 2.1: Tool List Expansion
- Provide all but the
AipolabsExecuteFunction
meta function (tool) to the LLM.
- Provide all but the
- 2.2: Tool Definition as Text Context Approach
- Provide all 4 meta functions (tools) to the LLM.
- 2.1: Tool List Expansion
Pre-planned
This is the most straright forward use case. You can directly find the functions you want to use on the developer portal, retrieve the function definitions, and append them to your LLM API call. This way your agents will only use the tools you have selected and provided, it would not attempt to find and use other tools.
Dynamic Tool Discovery and Execution With Tool List Expansion
In this use case, the tools list provided to LLM API calls changes according to the function definitions retrieved by the agent from the Aipolabs ACI using the provided meta functions (tools).
The retrieved function definitions are appended to the available tools list for LLMs to decide when and how to use it in subsequent LLM calls. This leverages the ability of many LLMs to 100% enforce adherence of function-call outputs to the provided definition, while still offering the flexibility to essentially access as many different tools as needed by the LLM-powered agent.
The trade-off here is that the developer has to manage tool-list and know when to append or remove tools when making the LLM call.
Example starting tools lists provided to the LLM
Adding retrieved function definitions to the tools_retrieved list
Subsequent tool-calling
For a full example, see here .
Dynamic Tool Discovery and Execution With Tool Definition as Text Context
In this use case, the tools list provided to the LLM is static, all 4 meta functions (tools) from the Aipolabs ACI are included.
The difference between this and the semi autonomous use case is that retrieved function definitions are provided to the LLM directly in the context window. The LLM then has to decide whether to call the ACIExecuteFunction metafunction to actually execute an API call.
By using the meta functions (tools) this way, the developer does not have to manage the tools list, but the accuracy of tool use can decrease.
Example tools list provided to LLM
Tool-calling through LLM
For a full example, see here .