catalog/repos/airbytehq--airbyte-agent-connectors.md

136 lines
5.4 KiB
Markdown
Raw Permalink Normal View History

2026-04-07 11:44:56 +08:00
# AI智能体数据连接器
`AI代理` `数据连接` `Python SDK` `SaaS集成` `LLM工具`
<div align="center">
<a href="https://airbyte.ai/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset=".github/images/logo-dark.svg">
<source media="(prefers-color-scheme: light)" srcset=".github/images/logo-light.svg">
<img alt="Airbyte Logo" src=".github/images/logo-dark.svg" width="80%">
</picture>
</a>
</div>
<p/>
[![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![Publish Connectors](https://github.com/airbytehq/airbyte-ai-connectors/actions/workflows/publish.yml/badge.svg)](https://github.com/airbytehq/airbyte-ai-connectors/actions/workflows/publish.yml)
[![License](https://img.shields.io/badge/License-Elastic_2.0-blue.svg)](LICENSE)
[![Airbyte Stars](https://img.shields.io/github/stars/airbytehq/airbyte-agent-connectors?style=social)](https://github.com/airbytehq/airbyte-agent-connectors)
[![Slack](https://img.shields.io/badge/Slack-Join_Community-4A154B?logo=slack&logoColor=white)](https://slack.airbyte.com/)
[![Twitter Follow](https://img.shields.io/twitter/follow/airbytehq?style=social)](https://twitter.com/airbytehq)
## AI 智能体访问数据的统一接口
Airbyte AI 连接器是一组 Python 包,让 AI 智能体能够通过强类型、文档完善的工具调用第三方 API。每个连接器都是独立的 Python 包,可直接在应用中使用、集成到智能体框架中,或通过 MCP即将推出和 API即将推出对外暴露。
## 本仓库包含的内容
* 针对特定 SaaS API 的 Python SDK例如 Gong、Stripe、GitHub
* 统一的连接器结构,让你能快速理解和扩展任意连接器
* 开箱即用的客户端,自动验证认证、处理 Schema并为每个操作暴露类型化方法
## Python SDK 快速上手
Python SDK 将 Airbyte AI 连接器封装为原生 Python 客户端。这些客户端既可独立运行,也可作为工具集成到 PydanticAI 或 LangChain 等框架中。首先,将连接器包添加到你的依赖项或 `pyproject.toml`。以下以 Gong 为例:
```yaml
dependencies = [
"pydantic-ai>=0.0.1",
"airbyte-ai-gong",
]
```
接着,导入你所需集成的连接器类,并提供第三方集成所需的 API 凭据或密钥。Airbyte AI 连接器会验证这些信息,然后为所有操作暴露类型化方法:
```py
from airbyte_ai_gong import GongConnector
from airbyte_ai_gong.models import GongAuthConfig
connector = GongConnector.create(auth_config=GongAuthConfig(
access_key="...",
access_key_secret="...",
))
```
完成上述步骤后,你可以将连接器调用作为工具挂载,供智能体在推理或工具执行阶段调用。以下是使用 PydanticAI Agent 的示例:
```py
import os
from pydantic_ai import Agent
from airbyte_ai_gong import GongConnector
from airbyte_ai_gong.models import GongAuthConfig
connector = GongConnector(auth_config=GongAuthConfig(
access_key=os.environ["GONG_ACCESS_KEY"],
access_key_secret=os.environ["GONG_ACCESS_KEY_SECRET"],
))
agent = Agent(
"openai:gpt-4o",
system_prompt=(
"You manage Gong calls and transcripts. "
"You can list users, get user details, list calls, and fetch call details. "
"Execute actions immediately."
),
)
@agent.tool_plain
async def list_users(limit: int = 10):
return await connector.users.list(limit=limit)
@agent.tool_plain
async def get_user(user_id: str):
return await connector.users.get(id=user_id)
```
你可以前往每个连接器的[可用操作](https://github.com/airbytehq/airbyte-ai-connectors/tree/main/connectors/gong#available-operations)页面,查看其支持的实体和方法详情。
## 连接器结构
每个连接器都是独立的 Python 包:
```
connectors/
├── gong/
│ ├── airbyte_ai_gong/
│ ├── pyproject.toml
│ ├── CHANGELOG.md
│ └── README.md
├── github/
│ └── ...
└── ...
```
每个连接器文件夹内包含:
* 自动生成的 Python 客户端
* 包含支持操作说明的连接器专属 README
* 基于 Airbyte 连接器定义生成的类型化方法
* 验证与错误处理逻辑
## 适用场景
当你有以下需求时,可使用 Airbyte AI 连接器:
* **智能体友好的数据访问**:让 LLM 智能体通过有护栏、有类型响应的方式调用真实的 SaaS API如 CRM、计费、分析等
* **统一的认证与 Schema**:在众多 API 中复用统一的配置和错误处理模式;可在 PydanticAI、LangChain 或任意自定义智能体循环中使用
* **可组合的构建块**:在单个智能体中组合多个连接器,编排跨系统工作流
相比临时构建的 API 封装,这些连接器提供了共享结构、自动生成的客户端,并与 Airbyte 生态系统保持一致。
## 路线图
我们正在积极扩展 AI 连接器,即将推出:
* MCP 支持(模型上下文协议)
* 托管 API 网关,用于托管式工具执行
* 示例应用与入门模板
* 每周持续新增连接器
## 贡献与反馈
我们热忱欢迎反馈、建议和 Bug 报告。如果你正在使用 Airbyte AI 连接器构建 AI 智能体,并希望分享想法或获取帮助,欢迎加入我们的 [Slack 社区](https://airbytehq.slack.com/ssb/redirect#/shared-invite/email)。我们很乐意了解你在构建什么,以及你希望看到哪些新连接器或新能力。
由 Airbyte 用心打造 💜