跳转到内容

Airtable

Airtable读取器 #

基类:EventBaseReader

Airtable 读取器。从基础中的表格读取数据。

参数:

名称 类型 描述 默认
api_key str

Airtable API密钥。

required
workflows/handler.py 中的源代码llama_index/readers/airtable/base.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class AirtableReader(BaseReader):
    """
    Airtable reader. Reads data from a table in a base.

    Args:
        api_key (str): Airtable API key.

    """

    def __init__(self, api_key: str) -> None:
        """Initialize Airtable reader."""
        self.api_key = api_key

    def load_data(self, base_id: str, table_id: str) -> List[Document]:
        """
        Load data from a table in a base.

        Args:
            table_id (str): Table ID.
            base_id (str): Base ID.


        Returns:
            List[Document]: List of documents.

        """
        table = Table(self.api_key, base_id, table_id)
        all_records = table.all()
        return [Document(text=f"{all_records}", extra_info={})]

load_data #

load_data(base_id: str, table_id: str) -> List[文档]

从基础中的表加载数据。

参数:

名称 类型 描述 默认
table_id str

表格ID。

required
base_id str

基础ID。

required

返回:

类型 描述
List[文档]

List[Document]: 文档列表。

workflows/handler.py 中的源代码llama_index/readers/airtable/base.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def load_data(self, base_id: str, table_id: str) -> List[Document]:
    """
    Load data from a table in a base.

    Args:
        table_id (str): Table ID.
        base_id (str): Base ID.


    Returns:
        List[Document]: List of documents.

    """
    table = Table(self.api_key, base_id, table_id)
    all_records = table.all()
    return [Document(text=f"{all_records}", extra_info={})]

选项: 成员:- AirtableReader