A Xero toolkit for AI agents
Project description
Xero Python Agent Toolkit
- The Xero Agent Toolkit library enables agent frameworks to integrate with Xero APIs through function calling.
- The current version showcases one scenario where a user would like to create a payment received by a contact.
- The current version works with langchain agents, but can be used or can be adjusted to work with other agent frameworks.
- The framework currently supports Xero custom connections.
Installation
pip install xero-agent-toolkit
Requirements
- Python 3.8+
Usage
1. Authentication
The library needs to be configured with your Xero client id and client secret.
See more info here on Xero custom connections.
from xero-agent-toolkit import XeroAgentToolkit
xero_agent_toolkit = XeroAgentToolkit(client_id, client_secret)
2. Getting the tools
Once you have create the XeroAgentToolkit, and passed the authentication info, you can grab the Xero tools to pass to the langchain agent
model = ...
tools = xero_agent_toolkit.get_tools()
agent_executor = create_react_agent(model, tools, ...)
3. Initialization
The last thing before using the agent is calling the "system_init" method that allows the agent toolkit to update the agent's system prompt if needed
xero_agent_toolkit.system_init(agent_executor, config)
Example Scenario
Agent: How can I help you?
User: I received a 20$ payment from Ridgeway
Agent: I found two contacts with the nickname "Ridgeway":
- Ridgeway Bank
- Ridgeway University
Please confirm which one you would like to associate the payment with.
User: The University
Agent: I found the following invoice for Ridgeway University:
- Invoice Number: INV-0025
- Amount Due: $6187.50
- Status: AUTHORIZED
please confirm you would like to link the payment to this invoice
User: Yes
Agent: I need a numeric account code to create the payment. Please provide the account code to proceed.
User: 091
Agent: The payment of $20 has been successfully created and linked to invoice INV-0025 for Ridgeway University. If you need any further assistance, feel free to ask!
User: What is the new amount due?
Agent: The new amount due for invoice INV-0025 is now 6167.50 after the payment of 20 was applied.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xero_agent_toolkit-0.0.1-py3-none-any.whl.
File metadata
- Download URL: xero_agent_toolkit-0.0.1-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b601df19630a43bc24d095622e575ea6e49b40b7bdc230bba5720632ce45ae3e
|
|
| MD5 |
03b811199048cfffc442d9be73387cfe
|
|
| BLAKE2b-256 |
f9610596662d179e4ba492a07dd01755d348992fe8bc4d11dfb6b720a0cca70b
|