Skip to main content

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":

  1. Ridgeway Bank
  2. 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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xero_agent_toolkit-0.0.4-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file xero_agent_toolkit-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for xero_agent_toolkit-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e7ee42b5ddbf21af1147de691507024aedd3c999d04915edb95260aa3cb9232e
MD5 267cbc44eb66682441b873d6150854e4
BLAKE2b-256 436ecc62edb98aece7f8a250d8dc819b77a0db9daa436771d706867b3f01fd81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page