Get Started
Use local functions with your AI agents
How to use local functions with your AI agents
This guide covers advanced techniques for running AI agents with your own LLMs using the xpander SDK. Make sure you’ve completed the Bring Your Own LLM guide first.
Local Function Implementation
File Operations
Building upon the basic local tools setup, here’s how to implement secure file operations:
Example Usage: AI Agent with Local File Access
Here’s a complete example of using the AI agent to create and manage different types of files:
Example output files created:
- hello.txt: “Hello World in plain text!“
- data.csv: “Name,Age\nAlice,25\nBob,30”
- config.json:
{"message": "Hello World", "type": "greeting"}
- doc.xml:
Hello World in XML format
This example demonstrates:
- Setting up the conversation memory
- Handling tool calls for file operations
- Processing different file formats
- Managing the conversation loop
- Proper error handling and response tracking
Need help? Visit our Discord community or documentation.