Stripe Agent Toolkit 安装与配置指南

Stripe Agent Toolkit 安装与配置指南

agent-toolkit Python and TypeScript library for integrating the Stripe API into agentic workflows agent-toolkit 项目地址: https://gitcode.com/gh_mirrors/ag/agent-toolkit

1. 项目基础介绍

Stripe Agent Toolkit 是一个开源项目,它为流行的智能体框架(如 OpenAI 的 Agent SDK、LangChain、CrewAI、Vercel 的 AI SDK 和 Model Context Protocol)提供了与 Stripe API 的集成。这个库支持 Python 和 TypeScript 两种编程语言,并基于 Stripe 的 Python 和 Node SDK 构建而成。它允许开发者通过函数调用来集成 Stripe API,实现创建支付链接、管理客户、产品、价格和订阅等功能。

2. 项目使用的关键技术和框架

  • Stripe API: Stripe 提供的 API,允许开发者轻松处理在线支付、订阅和其他金融交易。
  • Python: 一种广泛使用的高级编程语言,用于开发 Stripe Agent Toolkit 的 Python 部分。
  • TypeScript: JavaScript 的超集,添加了静态类型选项,用于开发 Stripe Agent Toolkit 的 Node.js 部分。
  • Model Context Protocol (MCP): 一个允许模型与外部工具进行交互的协议,用于集成智能体框架。

3. 项目安装和配置的准备工作与详细步骤

准备工作

在开始安装之前,请确保您的系统已安装以下依赖:

  • Python 3.11+: 用于运行 Python 包。
  • Node 18+: 用于运行 TypeScript 包。
  • Git: 用于克隆项目代码。

安装步骤

Python 版本
  1. 克隆项目仓库:

    git clone https://github.com/stripe/agent-toolkit.git
    cd agent-toolkit
    
  2. 安装 Python 包:

    pip install .
    

或者,如果您只是想要使用该包而不是修改它,可以直接通过 pip 安装:

pip install stripe-agent-toolkit
TypeScript 版本
  1. 克隆项目仓库:

    git clone https://github.com/stripe/agent-toolkit.git
    cd agent-toolkit
    
  2. 安装 Node.js 包:

    npm install .
    

或者,如果您只是想要使用该包而不是修改它,可以直接通过 npm 安装:

npm install @stripe/agent-toolkit

配置步骤

  1. 获取 Stripe 帐户的秘密密钥。您可以在 Stripe 仪表板中找到它。

  2. 对于 Python 版本,配置 StripeAgentToolkit:

    from stripe_agent_toolkit.openai.toolkit import StripeAgentToolkit
    
    stripe_agent_toolkit = StripeAgentToolkit(
        secret_key="sk_test_...",
        configuration={
            "actions": {
                "payment_links": {
                    "create": True,
                },
            },
        },
    )
    
  3. 对于 TypeScript 版本,配置 StripeAgentToolkit:

    import { StripeAgentToolkit } from "@stripe/agent-toolkit/langchain";
    
    const stripeAgentToolkit = new StripeAgentToolkit({
        secretKey: process.env.STRIPE_SECRET_KEY,
        configuration: {
            actions: {
                paymentLinks: {
                    create: true,
                },
            },
        },
    });
    

完成以上步骤后,您就可以开始使用 Stripe Agent Toolkit 来集成 Stripe API 了。请根据项目文档和需求进一步配置和使用相关的功能。

agent-toolkit Python and TypeScript library for integrating the Stripe API into agentic workflows agent-toolkit 项目地址: https://gitcode.com/gh_mirrors/ag/agent-toolkit

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

屈游会

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值