-
Notifications
You must be signed in to change notification settings - Fork 51
feat: add Sardis payment tools for ADK agents #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
795b67a
baacc40
9e391d7
8813b6b
611b73b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Sardis Payment Tools for Google ADK | ||
|
|
||
| Policy-controlled payments for AI agents built with [Google Agent Development Kit](https://google.github.io/adk-docs/). | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| pip install sardis-adk | ||
| ``` | ||
|
|
||
| ## Setup | ||
|
|
||
| Set your environment variables: | ||
|
|
||
| ```bash | ||
| export SARDIS_API_KEY="sk_..." | ||
| export SARDIS_WALLET_ID="wal_..." | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ```python | ||
| from google.adk.agents import Agent | ||
| from tools.sardis import sardis_pay, sardis_check_balance, sardis_check_policy | ||
|
|
||
| agent = Agent( | ||
| model="gemini-2.0-flash", | ||
| name="payment_agent", | ||
| description="An agent that can make policy-controlled payments", | ||
| tools=[sardis_pay, sardis_check_balance, sardis_check_policy], | ||
| ) | ||
| ``` | ||
|
|
||
| ## Available Tools | ||
|
|
||
| | Tool | Description | | ||
| |------|-------------| | ||
| | `sardis_pay` | Execute a payment with policy guardrails | | ||
| | `sardis_check_balance` | Check wallet balance and spending limits | | ||
| | `sardis_check_policy` | Pre-check if a payment would be allowed | | ||
|
|
||
| ## Features | ||
|
|
||
| - **Policy guardrails** — spending limits, merchant restrictions, category rules | ||
| - **Non-custodial** — MPC wallets, no private keys stored | ||
| - **Multi-chain** — Base, Polygon, Ethereum, Arbitrum, Optimism | ||
| - **Stablecoin native** — USDC, USDT, EURC, PYUSD | ||
| - **Full audit trail** — append-only ledger for compliance | ||
|
|
||
| ## Links | ||
|
|
||
| - [Sardis Documentation](https://sardis.sh/docs) | ||
| - [sardis-adk on PyPI](https://pypi.org/project/sardis-adk/) | ||
| - [GitHub](https://github.com/EfeDurmaz16/sardis) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| """Sardis payment tools for Google ADK agents.""" | ||
|
|
||
| from sardis_adk.tools import ( | ||
| sardis_pay, | ||
| sardis_check_balance, | ||
| sardis_check_policy, | ||
| SARDIS_TOOLS, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "sardis_pay", | ||
| "sardis_check_balance", | ||
| "sardis_check_policy", | ||
| "SARDIS_TOOLS", | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||||||||||||||||||||||
| """Sardis payment tool for Google Agent Development Kit. | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file appears to be redundant as its content is nearly identical to |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| This tool enables ADK agents to make policy-controlled payments through | ||||||||||||||||||||||||||||||||||
| Sardis non-custodial MPC wallets. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Installation: | ||||||||||||||||||||||||||||||||||
| pip install sardis-adk | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Usage: | ||||||||||||||||||||||||||||||||||
| from tools.sardis import sardis_pay, sardis_check_balance | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Use in an ADK agent | ||||||||||||||||||||||||||||||||||
| agent = Agent( | ||||||||||||||||||||||||||||||||||
| model="gemini-2.0-flash", | ||||||||||||||||||||||||||||||||||
| name="payment_agent", | ||||||||||||||||||||||||||||||||||
| tools=[sardis_pay, sardis_check_balance], | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The usage example in the docstring has a couple of issues:
To avoid confusion and ensure the example is runnable, please update it.
Suggested change
|
||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| from sardis_adk.tools import ( | ||||||||||||||||||||||||||||||||||
| sardis_pay, | ||||||||||||||||||||||||||||||||||
| sardis_check_balance, | ||||||||||||||||||||||||||||||||||
| sardis_check_policy, | ||||||||||||||||||||||||||||||||||
| SARDIS_TOOLS, | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| __all__ = [ | ||||||||||||||||||||||||||||||||||
| "sardis_pay", | ||||||||||||||||||||||||||||||||||
| "sardis_check_balance", | ||||||||||||||||||||||||||||||||||
| "sardis_check_policy", | ||||||||||||||||||||||||||||||||||
| "SARDIS_TOOLS", | ||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The model name
gemini-2.0-flashappears to be incorrect. The latest available model in this family isgemini-1.5-flash. Using an incorrect model name will cause an error when users run the example code. Please update it to a valid model name.