mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-15 05:58:08 +01:00
Model Context Protocol (MCP) support with new use case (#42)
* initial mcp * food ordering with mcp * prompt eng * splitting out goals and updating docs * a diff so I can get tests from codex * a diff so I can get tests from codex * oops, missing files * tests, file formatting * readme and setup updates * setup.md link fixes * readme change * readme change * readme change * stripe food setup script * single agent mode default * prompt engineering for better multi agent performance * performance should be greatly improved * Update goals/finance.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update activities/tool_activities.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * co-pilot PR suggested this change, and now fixed it * stronger wording around json format response * formatting * moved docs to dir * moved image assets under docs * cleanup env example, stripe guidance * cleanup --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1811e4cf59
commit
5d55a9fe80
@@ -1,17 +1,14 @@
|
||||
import os
|
||||
|
||||
import stripe
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv(override=True) # Load environment variables from a .env file
|
||||
|
||||
stripe.api_key = os.getenv("STRIPE_API_KEY")
|
||||
|
||||
|
||||
def ensure_customer_exists(
|
||||
customer_id: str = None, email: str = "default@example.com"
|
||||
) -> str:
|
||||
"""Ensure a Stripe customer exists; create one if not."""
|
||||
import stripe
|
||||
|
||||
if customer_id:
|
||||
try:
|
||||
stripe.Customer.retrieve(customer_id)
|
||||
@@ -27,6 +24,12 @@ def ensure_customer_exists(
|
||||
|
||||
def create_invoice(args: dict) -> dict:
|
||||
"""Create and finalize a Stripe invoice."""
|
||||
import stripe
|
||||
|
||||
# Load environment variables and configure stripe
|
||||
load_dotenv(override=True)
|
||||
stripe.api_key = os.getenv("STRIPE_API_KEY")
|
||||
|
||||
# If an API key exists in the env file, find or create customer
|
||||
if stripe.api_key is not None and stripe.api_key != "":
|
||||
customer_id = ensure_customer_exists(
|
||||
|
||||
Reference in New Issue
Block a user