mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-17 06:58:09 +01:00
Compare commits
5 Commits
docker-onl
...
review-dal
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4567c4e42 | ||
|
|
ae4811a8d0 | ||
|
|
470ef08615 | ||
|
|
3e9439022e | ||
|
|
f8e0dd3b2a |
2
setup.md
2
setup.md
@@ -166,7 +166,7 @@ Here is configuration guidance for specific goals. Travel and financial goals ha
|
|||||||
* Requires a Stripe key for the `create_invoice` tool. Set this in the `STRIPE_API_KEY` environment variable in .env
|
* Requires a Stripe key for the `create_invoice` tool. Set this in the `STRIPE_API_KEY` environment variable in .env
|
||||||
* It's free to sign up and get a key at [Stripe](https://stripe.com/)
|
* It's free to sign up and get a key at [Stripe](https://stripe.com/)
|
||||||
* Set permissions for read-write on: `Credit Notes, Invoices, Customers and Customer Sessions`
|
* Set permissions for read-write on: `Credit Notes, Invoices, Customers and Customer Sessions`
|
||||||
* If you're lazy go to `tools/create_invoice.py` and replace the `create_invoice` function with the mock `create_invoice_example` that exists in the same file.
|
* If you don't have a Stripe key, comment out the STRIPE_API_KEY in the .env file, and a dummy invoice will be created rather than a Stripe invoice. The function can be found in `tools/create_invoice.py`
|
||||||
|
|
||||||
### Goal: Find a Premier League match, book train tickets to it and invoice the user for the cost (Replay 2025 Keynote)
|
### Goal: Find a Premier League match, book train tickets to it and invoice the user for the cost (Replay 2025 Keynote)
|
||||||
- `AGENT_GOAL=goal_match_train_invoice` - Focuses on Premier League match attendance with train booking and invoice generation
|
- `AGENT_GOAL=goal_match_train_invoice` - Focuses on Premier League match attendance with train booking and invoice generation
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ def ensure_customer_exists(
|
|||||||
def create_invoice(args: dict) -> dict:
|
def create_invoice(args: dict) -> dict:
|
||||||
"""Create and finalize a Stripe invoice."""
|
"""Create and finalize a Stripe invoice."""
|
||||||
# If an API key exists in the env file, find or create customer
|
# If an API key exists in the env file, find or create customer
|
||||||
if stripe.api_key is not None:
|
if stripe.api_key is not None and stripe.api_key != "":
|
||||||
customer_id = ensure_customer_exists(
|
customer_id = ensure_customer_exists(
|
||||||
args.get("customer_id"), args.get("email", "default@example.com")
|
args.get("customer_id"), args.get("email", "default@example.com")
|
||||||
)
|
)
|
||||||
@@ -69,15 +69,3 @@ def create_invoice(args: dict) -> dict:
|
|||||||
"invoiceURL": "https://pay.example.com/invoice/12345",
|
"invoiceURL": "https://pay.example.com/invoice/12345",
|
||||||
"reference": "INV-12345",
|
"reference": "INV-12345",
|
||||||
}
|
}
|
||||||
|
|
||||||
def create_invoice_example(args: dict) -> dict:
|
|
||||||
"""
|
|
||||||
This is an example implementation of the CreateInvoice tool
|
|
||||||
Doesn't call any external services, just returns a dummy response
|
|
||||||
"""
|
|
||||||
print("[CreateInvoice] Creating invoice with:", args)
|
|
||||||
return {
|
|
||||||
"invoiceStatus": "generated",
|
|
||||||
"invoiceURL": "https://pay.example.com/invoice/12345",
|
|
||||||
"reference": "INV-12345",
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user