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.
Metadata
Release files for xero-agent-toolkit 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xero_agent_toolkit-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for xero_agent_toolkit-0.0.5-py3-none-any.whl |
Release files / xero_agent_toolkit-0.0.5-py3-none-any.whl
| Download URL | xero_agent_toolkit-0.0.5-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f6a247dbffe1912f1751cf9a9cda14a0853d52d9a2cf707e75d252809f003a0
|
|
BLAKE2b-256 checksum How to use checksums |
aaf89d99ecfbabf981b5e299b4d6dbdf4d13f4f8918f105feabe2116c11025c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.6
|
Security for xero-agent-toolkit 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.