Skip to main content

Stripe Agent Toolkit

Project description

Stripe Agent Toolkit - Python

The Stripe Agent Toolkit library enables popular agent frameworks including LangChain and CrewAI to integrate with Stripe APIs through function calling. The library is not exhaustive of the entire Stripe API. It is built directly on top of the Stripe Python SDK.

Installation

You don't need this source code unless you want to modify the package. If you just want to use the package, just run:

pip install stripe-agent-toolkit

Requirements

  • Python 3.11+

Usage

The library needs to be configured with your account's secret key which is available in your Stripe Dashboard.

from stripe_agent_toolkit.crewai.toolkit import StripeAgentToolkit

stripe_agent_toolkit = StripeAgentToolkit(
    secret_key="sk_test_...",
    configuration={
        "actions": {
            "payment_links": {
                "create": True,
            },
        }
    },
)

The toolkit works with LangChain and CrewAI and can be passed as a list of tools. For example:

from crewai import Agent

stripe_agent = Agent(
    role="Stripe Agent",
    goal="Integrate with Stripe",
    backstory="You are an expert at integrating with Stripe",
    tools=[*stripe_toolkit.get_tools()]
)

Examples for LangChain and CrewAI are included in /examples.

Context

In some cases you will want to provide values that serve as defaults when making requests. Currently, the account context value enables you to make API calls for your connected accounts.

stripe_agent_toolkit = StripeAgentToolkit(
    secret_key="sk_test_...",
    configuration={
        "context": {
            "account": "acct_123"
        }
    }
)

Development

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stripe_agent_toolkit-0.2.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

stripe_agent_toolkit-0.2.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file stripe_agent_toolkit-0.2.0.tar.gz.

File metadata

  • Download URL: stripe_agent_toolkit-0.2.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for stripe_agent_toolkit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8d5c3b7e682c8cf559de5d46b70878921fbff9df61b1694a9e88c7f66e6372ec
MD5 ccb978eeee0fea0646abe2293ee5b4bb
BLAKE2b-256 f2caee0f661bbbe34bce9cabb953e9b709f6e1e376fd7f0f043e3997f5490aca

See more details on using hashes here.

Provenance

The following attestation bundles were made for stripe_agent_toolkit-0.2.0.tar.gz:

Publisher: release.yml on stripe/agent-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stripe_agent_toolkit-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for stripe_agent_toolkit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b7cb9f02baab761e3bd16b34b1b415028f6920aa77c9bab6713a9e979ea85ba
MD5 78cabaaac5f88ea443014ec25f0a26b4
BLAKE2b-256 297fcc2fc1e160dfa57913af62a5aa564214ec20c436cb1864003cc45aacbbbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for stripe_agent_toolkit-0.2.0-py3-none-any.whl:

Publisher: release.yml on stripe/agent-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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