konfig/carbon-php-sdk

无论来源如何,将外部数据连接到LLMs。

v0.2.35 2024-09-24 17:19 UTC

README

Visit Carbon

Carbon

无论来源如何,将外部数据连接到LLMs。

Packagist

目录

安装与使用

要求

此库需要 PHP ^8.0

Composer

要使用 Composer 安装绑定,请将以下内容添加到 composer.json

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/Carbon-for-Developers/carbon-php-sdk.git"
    }
  ],
  "require": {
    "konfig/carbon-php-sdk": "0.2.35"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

<?php
require_once('/path/to/carbon-php-sdk/vendor/autoload.php');

入门

请按照 安装过程 进行,然后运行以下操作

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// 1) Get an access token for a customer
$carbon = new \Carbon\Client(
    apiKey: "API_KEY",
    customerId: "CUSTOMER_ID",
);

$result = $carbon->auth->getAccessToken();

# 2) Use the access token to authenticate moving forward
$carbon = new \Carbon\Client(accessToken: $token->getAccessToken());

# use SDK as usual
$whiteLabeling = $carbon->auth->getWhiteLabeling();
# etc.

参考

carbon.auth.getAccessToken

获取访问令牌

🛠️ 使用

$result = $carbon->auth->getAccessToken();

🔄 返回

TokenResponse

🌐 端点

/auth/v1/access_token GET

🔙 返回目录

carbon.auth.getWhiteLabeling

返回组织是否启用白标以及哪些集成启用白标

:param current_user: 当前用户 :param db: 数据库会话 :return: WhiteLabelingResponse

🛠️ 使用

$result = $carbon->auth->getWhiteLabeling();

🔄 返回

WhiteLabelingResponse

🌐 端点

/auth/v1/white_labeling GET

🔙 返回目录

carbon.dataSources.queryUserDataSources

用户数据源

🛠️ 使用

$result = $carbon->dataSources->queryUserDataSources(
    pagination: [
        "limit" => 10,
        "offset" => 0,
    ], 
    order_by: "created_at", 
    order_dir: "desc", 
    filters: [
        "source" => "GOOGLE_CLOUD_STORAGE",
    ]
);

⚙️ 参数

pagination: Pagination
order_by:
order_dir:
filters: OrganizationUserDataSourceFilters

🔄 返回

OrganizationUserDataSourceResponse

🌐 端点

/user_data_sources POST

🔙 返回目录

carbon.dataSources.revokeAccessToken

撤销访问令牌

🛠️ 使用

$result = $carbon->dataSources->revokeAccessToken(
    data_source_id: 1
);

⚙️ 参数

data_source_id: int

🔄 返回

GenericSuccessResponse

🌐 端点

/revoke_access_token POST

🔙 返回目录

carbon.embeddings.all

检索嵌入和内容 V2

🛠️ 使用

$result = $carbon->embeddings->all(
    filters: [
        "include_all_children" => False,
        "non_synced_only" => False,
    ], 
    pagination: [
        "limit" => 10,
        "offset" => 0,
    ], 
    order_by: "created_at", 
    order_dir: "desc", 
    include_vectors: False
);

⚙️ 参数

filters: OrganizationUserFilesToSyncFilters
pagination: Pagination
order_by:
order_dir:
include_vectors: bool

🔄 返回

EmbeddingsAndChunksResponse

🌐 端点

/list_chunks_and_embeddings POST

🔙 返回目录

carbon.embeddings.getDocuments

对于预过滤文档,使用 tags_v2 而不是使用 tags(现在已弃用)更受欢迎。如果同时指定了 tags_v2tags,则忽略 tagstags_v2 通过使用 "AND"、"OR" 和否定逻辑来构建复杂的过滤器。以下输入为例

{
    "OR": [
        {
            "key": "subject",
            "value": "holy-bible",
            "negate": false
        },
        {
            "key": "person-of-interest",
            "value": "jesus christ",
            "negate": false
        },
        {
            "key": "genre",
            "value": "religion",
            "negate": true
        }
        {
            "AND": [
                {
                    "key": "subject",
                    "value": "tao-te-ching",
                    "negate": false
                },
                {
                    "key": "author",
                    "value": "lao-tzu",
                    "negate": false
                }
            ]
        }
    ]
}

在这种情况下,文件将根据以下条件过滤

  1. "subject" = "holy-bible" OR
  2. "person-of-interest" = "jesus christ" OR
  3. "genre" != "religion" OR
  4. "subject" = "tao-te-ching" AND "author" = "lao-tzu"

注意查询的最顶层必须是 "OR" 或 "AND" 数组。目前,嵌套限制为 3 层。对于具有 "key"、"value" 和 "negate" 键的标签块,以下类型规则适用

  1. "key" 是必需的,必须是 string
  2. "value" 是必需的,可以是 any 或 list[any]
  3. "negate" 是可选的,必须是 truefalse。如果存在且为 true,则过滤块在结果查询中被否定。默认为 false

在查询嵌入时,您可以在请求中可选地指定 media_type 参数。默认情况下(如果没有设置),它等于 "TEXT"。这意味着查询将在已解析为文本的文件上执行(目前,这包括除图像文件以外的所有文件)。如果它等于 "IMAGE",则查询将在图像文件上执行(目前为 .jpg.png 文件)。您可以将此字段视为在 file_ids 中设置的任何过滤器之上的额外过滤器。

当将 hybrid_search 设置为 true 时,在信息检索过程中将使用关键词搜索和语义搜索的组合来对候选嵌入进行排名和选择。默认情况下,这些搜索方法在排名过程中权重相等。要调整每种搜索方法的权重(或“重要性”),可以使用 hybrid_search_tuning_parameters 属性。不同调整参数的描述如下:

  • weight_a:分配给语义搜索的权重
  • weight_b:分配给关键词搜索的权重

必须确保所有 n 个权重之和等于 1。等式有 0.001 的误差容忍度,以考虑可能的浮点数问题。

为了在一组文档中为用户启用混合搜索,需要启用两个标志

  1. 使用 /modify_user_configuration 端点为用户启用 sparse_vectors。此请求的负载体如下
{
  "configuration_key_name": "sparse_vectors",
  "value": {
    "enabled": true
  }
}
  1. 确保您要搜索的文档已启用混合搜索。对于 /uploadfile 端点,可以通过设置以下查询参数来实现:generate_sparse_vectors=true

Carbon 支持多个模型用于生成文件的嵌入。对于图像,我们支持 Vertex AI 的多模态模型;对于文本,我们支持 OpenAI 的 text-embedding-ada-002 和 Cohere 的 embed-multilingual-v3.0。模型可以通过 embedding_model 参数指定(在 /embeddings 的 POST 主体中,以及在 /uploadfile 中的查询参数)。如果没有提供模型,则默认使用 text-embedding-ada-002。在执行嵌入查询时,将考虑使用指定模型生成的文件的嵌入。例如,如果文件 A 和 B 使用 OPENAI 生成嵌入,而文件 C 和 D 使用 COHERE_MULTILINGUAL_V3 生成嵌入,则默认情况下,查询将仅考虑文件 A 和 B。如果将 COHERE_MULTILINGUAL_V3 指定为 /embeddings 中的 embedding_model,则仅考虑文件 C 和 D。请确保您希望查询考虑的所有文件的嵌入都通过同一模型生成。目前,不要VERTEX_MULTIMODAL 设置为 embedding_model。此模型在 Carbon 检测到图像文件时自动使用。

🛠️ 使用

$result = $carbon->embeddings->getDocuments(
    query: "a", 
    k: 1, 
    tags: [
        "key": "string_example",
    ], 
    query_vector: [
        3.14
    ], 
    file_ids: [
        1
    ], 
    parent_file_ids: [
        1
    ], 
    include_all_children: False, 
    tags_v2: [
    ], 
    include_tags: True, 
    include_vectors: True, 
    include_raw_file: True, 
    hybrid_search: True, 
    hybrid_search_tuning_parameters: [
        "weight_a" => 0.5,
        "weight_b" => 0.5,
    ], 
    media_type: "TEXT", 
    embedding_model: "OPENAI", 
    include_file_level_metadata: False, 
    high_accuracy: False, 
    rerank: [
        "model" => "model_example",
    ], 
    file_types_at_source: [
        "string_example"
    ], 
    exclude_cold_storage_files: False
);

⚙️ 参数

查询:string

获取相关块和嵌入的查询。

k:int

返回的相关块数量。

tags:array<string, Tags1>

一组标签以限制搜索。已弃用,可能在未来被移除。

query_vector:float[]

可选查询向量,用于获取相关块和嵌入。它必须由生成嵌入的同一模型生成。不能同时提供 queryquery_vector

file_ids:int[]

可选文件 ID 列表,以限制搜索。

parent_file_ids:int[]

可选父文件 ID 列表,以限制搜索。父文件描述一个文件属于哪个文件(例如,文件夹)。

include_all_children:bool

标志,用于控制是否包含过滤文件的子文件的所有嵌入搜索。

tags_v2:object

一组标签以限制搜索。使用此代替已弃用的 tags

include_tags:bool

控制是否在响应中包含每个块标签的标志。

include_vectors: bool

控制是否在响应中包含嵌入向量的标志。

include_raw_file: bool

控制是否在响应中包含包含每个块原始文件的签名URL的标志。

hybrid_search: bool

控制是否执行混合搜索的标志。

hybrid_search_tuning_parameters: HybridSearchTuningParamsNullable
media_type:
embedding_model:
include_file_level_metadata: bool

控制是否在响应中包含文件级元数据的标志。此元数据将与文档的 content_metadata 字段一起包含,包括块/嵌入级别的元数据。

high_accuracy: bool

控制是否执行高精度嵌入搜索的标志。默认情况下,此设置为 false。如果为 true,则搜索可能返回更准确的结果,但可能需要更长的时间才能完成。

rerank: RerankParamsNullable
file_types_at_source: AutoSyncedSourceTypesPropertyInner[]

根据源文件类型过滤文件(例如帮助中心票据和文章)

exclude_cold_storage_files: bool

控制是否排除不在热存储中的文件。如果设置为 False,则如果任何过滤文件在冷存储中,则将返回错误。

🔄 返回

DocumentResponseList

🌐 端点

/embeddings POST

🔙 返回目录

carbon.embeddings.getEmbeddingsAndChunks

检索嵌入和内容

🛠️ 使用

$result = $carbon->embeddings->getEmbeddingsAndChunks(
    filters: [
        "user_file_id" => 1,
        "embedding_model" => "OPENAI",
    ], 
    pagination: [
        "limit" => 10,
        "offset" => 0,
    ], 
    order_by: "created_at", 
    order_dir: "desc", 
    include_vectors: False
);

⚙️ 参数

filters: EmbeddingsAndChunksFilters
pagination: Pagination
order_by:
order_dir:
include_vectors: bool

🔄 返回

EmbeddingsAndChunksResponse

🌐 端点

/text_chunks POST

🔙 返回目录

carbon.embeddings.uploadChunksAndEmbeddings

上传块和嵌入

🛠️ 使用

$result = $carbon->embeddings->uploadChunksAndEmbeddings(
    embedding_model: "OPENAI", 
    chunks_and_embeddings: [
        [
            "file_id" => 1,
            "chunks_and_embeddings" => [
                [
                    "chunk_number" => 1,
                    "chunk" => "chunk_example",
                ]
            ],
        ]
    ], 
    overwrite_existing: False, 
    chunks_only: False, 
    custom_credentials: [
        "key": [],
    ]
);

⚙️ 参数

embedding_model:
chunks_and_embeddings: SingleChunksAndEmbeddingsUploadInput[]
overwrite_existing: bool
chunks_only: bool
custom_credentials: array<string,object>

🔄 返回

GenericSuccessResponse

🌐 端点

/upload_chunks_and_embeddings POST

🔙 返回目录

carbon.files.createUserFileTags

标签是一个键值对,可以添加到文件中。这个键值对可以用于搜索(例如嵌入搜索),以缩小搜索范围。一个文件可以有任意数量的标签。以下为保留键,不能使用:

  • db_embedding_id
  • organization_id
  • user_id
  • organization_user_file_id

Carbon目前支持两种标签值的数据类型 - stringlist。键只能是 string。如果使用除 stringlist 之外的值,它们会被自动转换为字符串(例如,4 将变为 "4")。

🛠️ 使用

$result = $carbon->files->createUserFileTags(
    tags: [
        "key": "string_example",
    ], 
    organization_user_file_id: 1
);

⚙️ 参数

tags:array<string, Tags1>
organization_user_file_id: int

🔄 返回

UserFile

🌐 端点

/create_user_file_tags POST

🔙 返回目录

carbon.files.delete

Deprecated

删除文件端点

🛠️ 使用

$result = $carbon->files->delete(
    file_id: 1
);

⚙️ 参数

file_id: int

🔄 返回

GenericSuccessResponse

🌐 端点

/deletefile/{file_id} DELETE

🔙 返回目录

carbon.files.deleteFileTags

删除文件标签

🛠️ 使用

$result = $carbon->files->deleteFileTags(
    tags: [
        "string_example"
    ], 
    organization_user_file_id: 1
);

⚙️ 参数

tags: string[]
organization_user_file_id: int

🔄 返回

UserFile

🌐 端点

/delete_user_file_tags POST

🔙 返回目录

carbon.files.deleteMany

Deprecated

删除文件端点

🛠️ 使用

$result = $carbon->files->deleteMany(
    file_ids: [
        1
    ], 
    sync_statuses: [
        "string_example"
    ], 
    delete_non_synced_only: False, 
    send_webhook: False, 
    delete_child_files: False
);

⚙️ 参数

file_ids:int[]
sync_statuses: []
delete_non_synced_only: bool
send_webhook: bool
delete_child_files: bool

🔄 返回

GenericSuccessResponse

🌐 端点

/delete_files POST

🔙 返回目录

carbon.files.deleteV2

删除文件 V2 端点

🛠️ 使用

$result = $carbon->files->deleteV2(
    filters: [
        "include_all_children" => False,
        "non_synced_only" => False,
    ], 
    send_webhook: False, 
    preserve_file_record: False
);

⚙️ 参数

filters: OrganizationUserFilesToSyncFilters
send_webhook: bool
preserve_file_record: bool

是否从数据库中删除与文件相关的所有数据,但保留文件元数据,允许重新同步。默认情况下 preserve_file_record 为 false,这意味着与文件相关的所有数据以及其元数据都将被删除。请注意,即使 preserve_file_record 为 true,通过 uploadfile 端点上传的原始文件仍无法重新同步。

🔄 返回

GenericSuccessResponse

🌐 端点

/delete_files_v2 POST

🔙 返回目录

carbon.files.getParsedFile

Deprecated

此路由已弃用。请使用 /user_files_v2 代替。

🛠️ 使用

$result = $carbon->files->getParsedFile(
    file_id: 1
);

⚙️ 参数

file_id: int

🔄 返回

PresignedURLResponse

🌐 端点

/parsed_file/{file_id} GET

🔙 返回目录

carbon.files.getRawFile

Deprecated

此路由已弃用。请使用 /user_files_v2 代替。

🛠️ 使用

$result = $carbon->files->getRawFile(
    file_id: 1
);

⚙️ 参数

file_id: int

🔄 返回

PresignedURLResponse

🌐 端点

/raw_file/{file_id} GET

🔙 返回目录

carbon.files.modifyColdStorageParameters

修改冷存储参数

🛠️ 使用

$result = $carbon->files->modifyColdStorageParameters(
    filters: [
        "include_all_children" => False,
        "non_synced_only" => False,
    ], 
    enable_cold_storage: True, 
    hot_storage_time_to_live: 1
);

⚙️ 参数

filters: OrganizationUserFilesToSyncFilters
enable_cold_storage: bool
hot_storage_time_to_live: int

🔄 返回

bool

🌐 端点

/modify_cold_storage_parameters POST

🔙 返回目录

carbon.files.moveToHotStorage

移动到热存储

🛠️ 使用

$result = $carbon->files->moveToHotStorage(
    filters: [
        "include_all_children" => False,
        "non_synced_only" => False,
    ]
);

⚙️ 参数

filters: OrganizationUserFilesToSyncFilters

🔄 返回

bool

🌐 端点

/move_to_hot_storage POST

🔙 返回目录

carbon.files.queryUserFiles

对于预过滤文档,使用 tags_v2 而不是使用 tags(现在已弃用)更受欢迎。如果同时指定了 tags_v2tags,则忽略 tagstags_v2 通过使用 "AND"、"OR" 和否定逻辑来构建复杂的过滤器。以下输入为例

{
    "OR": [
        {
            "key": "subject",
            "value": "holy-bible",
            "negate": false
        },
        {
            "key": "person-of-interest",
            "value": "jesus christ",
            "negate": false
        },
        {
            "key": "genre",
            "value": "religion",
            "negate": true
        }
        {
            "AND": [
                {
                    "key": "subject",
                    "value": "tao-te-ching",
                    "negate": false
                },
                {
                    "key": "author",
                    "value": "lao-tzu",
                    "negate": false
                }
            ]
        }
    ]
}

在这种情况下,文件将根据以下条件过滤

  1. "subject" = "holy-bible" OR
  2. "person-of-interest" = "jesus christ" OR
  3. "genre" != "religion" OR
  4. "subject" = "tao-te-ching" AND "author" = "lao-tzu"

注意查询的最顶层必须是 "OR" 或 "AND" 数组。目前,嵌套限制为 3 层。对于具有 "key"、"value" 和 "negate" 键的标签块,以下类型规则适用

  1. "key" 是必需的,必须是 string
  2. "value" 是必需的,可以是 any 或 list[any]
  3. "negate" 是可选的,必须是 truefalse。如果存在且为 true,则过滤块在结果查询中被否定。默认为 false

🛠️ 使用

$result = $carbon->files->queryUserFiles(
    pagination: [
        "limit" => 10,
        "offset" => 0,
    ], 
    order_by: "created_at", 
    order_dir: "desc", 
    filters: [
        "include_all_children" => False,
        "non_synced_only" => False,
    ], 
    include_raw_file: True, 
    include_parsed_text_file: True, 
    include_additional_files: True
);

⚙️ 参数

pagination: Pagination
order_by:
order_dir:
filters: OrganizationUserFilesToSyncFilters
include_raw_file: bool
include_parsed_text_file: bool
include_additional_files: bool

🔄 返回

UserFilesV2

🌐 端点

/user_files_v2 POST

🔙 返回目录

carbon.files.queryUserFilesDeprecated

Deprecated

此路由已弃用。请使用 /user_files_v2 代替。

🛠️ 使用

$result = $carbon->files->queryUserFilesDeprecated(
    pagination: [
        "limit" => 10,
        "offset" => 0,
    ], 
    order_by: "created_at", 
    order_dir: "desc", 
    filters: [
        "include_all_children" => False,
        "non_synced_only" => False,
    ], 
    include_raw_file: True, 
    include_parsed_text_file: True, 
    include_additional_files: True
);

⚙️ 参数

pagination: Pagination
order_by:
order_dir:
filters: OrganizationUserFilesToSyncFilters
include_raw_file: bool
include_parsed_text_file: bool
include_additional_files: bool

🔄 返回

UserFile

🌐 端点

/user_files POST

🔙 返回目录

carbon.files.resync

重新同步文件

🛠️ 使用

$result = $carbon->files->resync(
    file_id: 1, 
    chunk_size: 1, 
    chunk_overlap: 1, 
    force_embedding_generation: False, 
    skip_file_processing: False
);

⚙️ 参数

file_id: int
块大小: int
块重叠: int
强制嵌入生成: bool
跳过文件处理: bool

🔄 返回

UserFile

🌐 端点

/resync_file POST

🔙 返回目录

carbon.files.upload

此端点用于直接将本地文件上传到Carbon。POST请求应是一个多部分表单请求。请注意,目前set_page_as_boundary查询参数仅适用于PDF。当此值设置时,PDF块的最大长度为单页。但是,可以获取每个块的额外信息,即围绕块的边界框坐标(这可用于文本突出显示等)。以下是对所有可能的查询参数的描述

  • chunk_size:分割文档时应用的块大小(以标记为单位)
  • chunk_overlap:分割文档时应用的块重叠(以标记为单位)
  • skip_embedding_generation:是否跳过块和嵌入的生成
  • set_page_as_boundary:如上所述
  • embedding_model:用于生成文档块的嵌入模型的模型
  • use_ocr:是否在生成块之前使用OCR作为预处理步骤。适用于PDF、JPEG和PNG
  • generate_sparse_vectors:是否为文件生成稀疏向量。对于混合搜索是必需的
  • prepend_filename_to_chunks:是否将文件名添加到块文本的开头

Carbon 支持多个模型用于生成文件的嵌入。对于图像,我们支持 Vertex AI 的多模态模型;对于文本,我们支持 OpenAI 的 text-embedding-ada-002 和 Cohere 的 embed-multilingual-v3.0。模型可以通过 embedding_model 参数指定(在 /embeddings 的 POST 主体中,以及在 /uploadfile 中的查询参数)。如果没有提供模型,则默认使用 text-embedding-ada-002。在执行嵌入查询时,将考虑使用指定模型生成的文件的嵌入。例如,如果文件 A 和 B 使用 OPENAI 生成嵌入,而文件 C 和 D 使用 COHERE_MULTILINGUAL_V3 生成嵌入,则默认情况下,查询将仅考虑文件 A 和 B。如果将 COHERE_MULTILINGUAL_V3 指定为 /embeddings 中的 embedding_model,则仅考虑文件 C 和 D。请确保您希望查询考虑的所有文件的嵌入都通过同一模型生成。目前,不要VERTEX_MULTIMODAL 设置为 embedding_model。此模型在 Carbon 检测到图像文件时自动使用。

🛠️ 使用

$result = $carbon->files->upload(
    file: open('/path/to/file', 'rb'), 
    chunk_size: 1, 
    chunk_overlap: 1, 
    skip_embedding_generation: False, 
    set_page_as_boundary: False, 
    embedding_model: "string_example", 
    use_ocr: False, 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    max_items_per_chunk: 1, 
    parse_pdf_tables_with_ocr: False, 
    detect_audio_language: False, 
    transcription_service: "assemblyai", 
    include_speaker_labels: False, 
    media_type: "TEXT", 
    split_rows: False, 
    enable_cold_storage: False, 
    hot_storage_time_to_live: 1, 
    generate_chunks_only: False
);

⚙️ 参数

文件: \SplFileObject
块大小: int

在处理文件时使用的tiktoken标记的块大小。

块重叠: int

在处理文件时使用的tiktoken标记的块重叠。

skip_embedding_generation: bool

控制是否在处理文件时生成和存储嵌入的标志。

set_page_as_boundary: bool

控制是否将一页的内容设置为块中可以出现的最大内容量的标志。仅对PDF有效。有关更多信息,请参阅路由描述。

embedding_model: ``

用于嵌入文件块的嵌入模型。

use_ocr: bool

在处理文件时是否使用OCR。适用于PDF、JPEG和PNG。对于包含表格、图像和/或扫描文本的文档很有用。

generate_sparse_vectors: bool

是否为文件生成稀疏向量。这是文件成为混合搜索候选者的必需条件。

prepend_filename_to_chunks: bool

是否将文件名添加到块的开头。

max_items_per_chunk: int

每个块中的对象数。仅适用于csv、tsv、xlsx和json文件。

parse_pdf_tables_with_ocr: bool

是否在启用use_ocr时使用丰富的表格解析。

detect_audio_language: bool

是否自动检测上传的音频文件的语言。

transcription_service:

用于音频文件的转录服务。如果没有指定服务,将使用'deepgram'。

include_speaker_labels: bool

检测多个说话者,并为音频文件中的语音段标记说话者。

media_type:

文件的媒体类型。如果没有提供,将根据文件扩展名推断。

split_rows: bool

是否将表格行拆分成块。目前仅适用于CSV、TSV和XLSX文件。

enable_cold_storage: bool

启用文件冷存储。如果设置为true,文件将在一段时间不活动后移动到冷存储。默认为false。

hot_storage_time_to_live: int

文件移动到冷存储后的秒数。

generate_chunks_only: bool

如果启用此标志,文件将分块并存储在Carbon中,但不会生成嵌入。这将覆盖skip_embedding_generation标志。

🔄 返回

UserFile

🌐 端点

/uploadfile POST

🔙 返回目录

carbon.files.uploadFromUrl

从URL创建上传文件

🛠️ 使用

$result = $carbon->files->uploadFromUrl(
    url: "string_example", 
    file_name: "string_example", 
    chunk_size: 1, 
    chunk_overlap: 1, 
    skip_embedding_generation: False, 
    set_page_as_boundary: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    use_textract: False, 
    prepend_filename_to_chunks: False, 
    max_items_per_chunk: 1, 
    parse_pdf_tables_with_ocr: False, 
    detect_audio_language: False, 
    transcription_service: "assemblyai", 
    include_speaker_labels: False, 
    media_type: "TEXT", 
    split_rows: False, 
    cold_storage_params: [
        "enable_cold_storage" => False,
    ], 
    generate_chunks_only: False
);

⚙️ 参数

url: string
file_name: string
块大小: int
块重叠: int
skip_embedding_generation: bool
set_page_as_boundary: bool
embedding_model:
generate_sparse_vectors: bool
use_textract: bool
prepend_filename_to_chunks: bool
max_items_per_chunk: int

每个块中的对象数。仅适用于csv、tsv、xlsx和json文件。

parse_pdf_tables_with_ocr: bool
detect_audio_language: bool
transcription_service:
include_speaker_labels: bool
media_type:
split_rows: bool
cold_storage_params: ColdStorageProps
generate_chunks_only: bool

如果启用此标志,文件将分块并存储在Carbon中,但不会生成嵌入。这将覆盖skip_embedding_generation标志。

🔄 返回

UserFile

🌐 端点

/upload_file_from_url POST

🔙 返回目录

carbon.files.uploadText

Carbon 支持多个模型用于生成文件的嵌入。对于图像,我们支持 Vertex AI 的多模态模型;对于文本,我们支持 OpenAI 的 text-embedding-ada-002 和 Cohere 的 embed-multilingual-v3.0。模型可以通过 embedding_model 参数指定(在 /embeddings 的 POST 主体中,以及在 /uploadfile 中的查询参数)。如果没有提供模型,则默认使用 text-embedding-ada-002。在执行嵌入查询时,将考虑使用指定模型生成的文件的嵌入。例如,如果文件 A 和 B 使用 OPENAI 生成嵌入,而文件 C 和 D 使用 COHERE_MULTILINGUAL_V3 生成嵌入,则默认情况下,查询将仅考虑文件 A 和 B。如果将 COHERE_MULTILINGUAL_V3 指定为 /embeddings 中的 embedding_model,则仅考虑文件 C 和 D。请确保您希望查询考虑的所有文件的嵌入都通过同一模型生成。目前,不要VERTEX_MULTIMODAL 设置为 embedding_model。此模型在 Carbon 检测到图像文件时自动使用。

🛠️ 使用

$result = $carbon->files->uploadText(
    contents: "aaaaa", 
    name: "string_example", 
    chunk_size: 1, 
    chunk_overlap: 1, 
    skip_embedding_generation: False, 
    overwrite_file_id: 1, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    cold_storage_params: [
        "enable_cold_storage" => False,
    ], 
    generate_chunks_only: False
);

⚙️ 参数

contents: string
name: string
块大小: int
块重叠: int
skip_embedding_generation: bool
overwrite_file_id: int
embedding_model:
generate_sparse_vectors: bool
cold_storage_params: ColdStorageProps
generate_chunks_only: bool

如果启用此标志,文件将分块并存储在Carbon中,但不会生成嵌入。这将覆盖skip_embedding_generation标志。

🔄 返回

UserFile

🌐 端点

/upload_text POST

🔙 返回目录

carbon.integrations.cancel

取消数据源项同步

🛠️ 使用

$result = $carbon->integrations->cancel(
    data_source_id: 1
);

⚙️ 参数

data_source_id: int

🔄 返回

OrganizationUserDataSourceAPI

🌐 端点

/integrations/items/sync/cancel POST

🔙 返回目录

carbon.integrations.connectDataSource

连接数据源

🛠️ 使用

$result = $carbon->integrations->connectDataSource(
    authentication: [
        "source" => "GOOGLE_DRIVE",
        "access_token" => "access_token_example",
    ], 
    sync_options: [
        "chunk_size" => 1500,
        "chunk_overlap" => 20,
        "skip_embedding_generation" => False,
        "embedding_model" => "OPENAI",
        "generate_sparse_vectors" => False,
        "prepend_filename_to_chunks" => False,
        "sync_files_on_connection" => True,
        "set_page_as_boundary" => False,
        "enable_file_picker" => True,
        "sync_source_items" => True,
        "incremental_sync" => False,
    ]
);

⚙️ 参数

authentication: AuthenticationProperty
sync_options: SyncOptions

🔄 返回

ConnectDataSourceResponse

🌐 端点

/integrations/connect POST

🔙 返回目录

carbon.integrations.connectFreshdesk

参考此文章以获取API密钥 https://support.freshdesk.com/en/support/solutions/articles/215517。确保您的API密钥具有从您的帐户读取解决方案的权限,并且您处于 付费 计划。一旦您有了API密钥,您就可以与您的freshdesk域一起向此端点发出请求。这将触发您的“解决方案”标签中的文章的自动同步。以下附加参数可用于将数据与同步的文章相关联或修改同步行为。

🛠️ 使用

$result = $carbon->integrations->connectFreshdesk(
    domain: "string_example", 
    api_key: "string_example", 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    sync_files_on_connection: True, 
    request_id: "string_example", 
    sync_source_items: True, 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ]
);

⚙️ 参数

domain: string
api_key: string
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
sync_files_on_connection: bool
request_id: string
sync_source_items: bool

启用此标志将从源获取所有可用的内容,并通过列表项端点列出

file_sync_config: FileSyncConfigNullable

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/freshdesk POST

🔙 返回目录

carbon.integrations.connectGitbook

您需要访问令牌来连接您的Gitbook帐户。请注意,权限将由生成访问令牌的用户定义,因此请确保您有权访问您要同步的空间。有关更多详细信息,请参阅本文档 https://developer.gitbook.com/gitbook-api/authentication。此外,您还需要指定您将从中同步数据的组织名称。

🛠️ 使用

$result = $carbon->integrations->connectGitbook(
    organization: "string_example", 
    access_token: "string_example", 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    sync_files_on_connection: True, 
    request_id: "string_example", 
    sync_source_items: True, 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ]
);

⚙️ 参数

organization: string
access_token: string
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
sync_files_on_connection: bool
request_id: string
sync_source_items: bool

启用此标志将从源获取所有可用的内容,并通过列表项端点列出

file_sync_config: FileSyncConfigNullable

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/gitbook POST

🔙 返回目录

carbon.integrations.connectGuru

您需要访问令牌来连接您的Guru帐户。要获取访问令牌,请按照以下步骤操作 https://help.getguru.com/docs/gurus-api#obtaining-a-user-token。用户名应该是您的Guru用户名。

🛠️ 使用

$result = $carbon->integrations->connectGuru(
    username: "string_example", 
    access_token: "string_example", 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    sync_files_on_connection: True, 
    request_id: "string_example", 
    sync_source_items: True, 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ]
);

⚙️ 参数

username: string
access_token: string
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
sync_files_on_connection: bool
request_id: string
sync_source_items: bool

启用此标志将从源获取所有可用的内容,并通过列表项端点列出

file_sync_config: FileSyncConfigNullable

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/guru POST

🔙 返回目录

carbon.integrations.createAwsIamUser

此端点可以用于连接S3以及Digital Ocean Spaces(与S3兼容)
对于S3,创建一个新的IAM用户,并具有以下权限:

  1. 列出所有存储桶。
  2. 从特定的存储桶和对象中读取以与Carbon同步。确保任何未来的存储桶或对象都具有相同的权限。
创建后,为该用户生成一个访问密钥,并将凭据与我们分享。我们建议在生成此密钥之前进行测试。对于Digital Ocean Spaces,在您的应用程序和API页面生成上述凭据 https://cloud.digitalocean.com/account/api/spaces。端点URL是连接Digital Ocean Spaces所必需的。它应该看起来像 <>.digitaloceanspaces.com

🛠️ 使用

$result = $carbon->integrations->createAwsIamUser(
    access_key: "string_example", 
    access_key_secret: "string_example", 
    sync_source_items: True, 
    endpoint_url: "string_example"
);

⚙️ 参数

access_key: string
access_key_secret: string
sync_source_items: bool

启用此标志将从源获取所有可用的内容,并通过列表项端点列出

endpoint_url: string

您可以通过此端点指定Digital Ocean端点URL来通过此端点连接Digital Ocean Space。URL应采用格式 .digitaloceanspaces.com。对于S3存储桶,它不是必需的。

🔄 返回

OrganizationUserDataSourceAPI

🌐 端点

/integrations/s3 POST

🔙 返回目录

carbon.integrations.getOauthUrl

此端点可以用于生成以下URL

  • 基于OAuth的连接器的OAuth URL
  • 文件同步URL,如果用户已具有有效的访问令牌,则跳过OAuth流程,并将他们带到成功状态。

🛠️ 使用

$result = $carbon->integrations->getOauthUrl(
    service: "BOX", 
    tags: None, 
    scope: "string_example", 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    zendesk_subdomain: "string_example", 
    microsoft_tenant: "string_example", 
    sharepoint_site_name: "string_example", 
    confluence_subdomain: "string_example", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    max_items_per_chunk: 1, 
    salesforce_domain: "string_example", 
    sync_files_on_connection: True, 
    set_page_as_boundary: False, 
    data_source_id: 1, 
    connecting_new_account: False, 
    request_id: "string_example", 
    use_ocr: False, 
    parse_pdf_tables_with_ocr: False, 
    enable_file_picker: True, 
    sync_source_items: True, 
    incremental_sync: False, 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ], 
    automatically_open_file_picker: True, 
    gong_account_email: "string_example", 
    servicenow_credentials: [
        "instance_subdomain" => "instance_subdomain_example",
        "client_id" => "client_id_example",
        "client_secret" => "client_secret_example",
        "redirect_uri" => "redirect_uri_example",
    ]
);

⚙️ 参数

service:
tags:
scope: string
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
zendesk子域: 字符串
microsoft租户: 字符串
sharepoint站点名称: 字符串
confluence子域: 字符串
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
max_items_per_chunk: int

每个块中的对象数。仅适用于csv、tsv、xlsx和json文件。

salesforce域名: 字符串
sync_files_on_connection: bool

用于指定Carbon在授权完成后是否尝试自动同步所有文件。此功能仅支持部分连接器,对于其他连接器将忽略。支持连接器:Intercom、Zendesk、Gitbook、Confluence、Salesforce、Freshdesk

set_page_as_boundary: bool
data_source_id: int

用于指定在连接多个数据源时要从哪个数据源同步。如果您只连接了一个该类型的数据源或正在连接新账户,可以跳过。

connecting_new_account: 布尔型

用于连接新数据源。如果没有指定,我们将根据类型和ID尝试为现有数据源创建同步URL。

request_id: string

此请求ID将添加到使用生成的OAuth URL同步的所有文件中

use_ocr: bool

为支持OCR的文件启用OCR。支持的格式:pdf、png、jpg

parse_pdf_tables_with_ocr: bool
enable_file_picker: 布尔型

为支持该功能的源启用集成文件选择器。支持源:BOX、DROPBOX、GOOGLE_DRIVE、ONEDRIVE、SHAREPOINT

sync_source_items: bool

启用此标志将从源获取所有可用的内容,并通过列表项端点列出

incremental_sync: 布尔型

只有当文件尚未同步或嵌入属性已更改时才同步文件。此标志目前由ONEDRIVE、GOOGLE_DRIVE、BOX、DROPBOX、INTERCOM、GMAIL、OUTLOOK、ZENDESK、CONFLUENCE、NOTION、SHAREPOINT、SERVICENOW支持。对于其他数据源将忽略。

file_sync_config: FileSyncConfigNullable
automatically_open_file_picker: 布尔型

OAuth流程完成后自动打开源文件选择器。此标志目前由BOX、DROPBOX、GOOGLE_DRIVE、ONEDRIVE、SHAREPOINT支持。对于其他数据源将忽略。

gong_account_email: 字符串

如果您要连接Gong账户,则需要输入您要连接的账户的电子邮件。此电子邮件将用于识别您的carbon数据源。

servicenow_credentials: ServiceNowCredentialsNullable

🔄 返回

OuthURLResponse

🌐 端点

/integrations/oauth_url POST

🔙 返回目录

carbon.integrations.listConfluencePages

Deprecated

此端点已被弃用。请使用/integrations/items/list代替。

要开始列出用户的Confluence页面,至少需要指定一个已连接的Confluence账户的data_source_id。此基本请求返回用户在Confluence实例中可以访问的每个空间的根页面列表。要进一步遍历用户的页面目录,可以使用具有相同data_source_id和将parent_id设置为之前请求中页面ID的额外请求来调用此端点。为了方便,响应列表中每个目录项目的has_children属性将标记哪些页面将作为parent_id设置时返回非空页面列表。

🛠️ 使用

$result = $carbon->integrations->listConfluencePages(
    data_source_id: 1, 
    parent_id: "string_example"
);

⚙️ 参数

data_source_id: int
parent_id: 字符串

🔄 返回

ListResponse

🌐 端点

/integrations/confluence/list POST

🔙 返回目录

carbon.integrations.listConversations

列出所有公开和私有的频道、私聊和群组私聊。响应中的ID可以用作过滤条件,以同步消息到Carbon。
类型:以逗号分隔的类型列表。可用的类型有im(私聊)、mpim(群组私聊)、public_channel(公开频道)和private_channel(私有频道)。默认为public_channel。
游标:用于分页。如果响应中返回了next_cursor,则需要在下一个请求中将它作为游标传递。
data_source_id:如果您已链接多个Slack账号,则需要指定数据源。
exclude_archived:是否排除存档对话,默认为true。

🛠️ 使用

$result = $carbon->integrations->listConversations(
    types: "public_channel", 
    cursor: "string_example", 
    data_source_id: 1, 
    exclude_archived: True
);

⚙️ 参数

类型:string
游标:string
data_source_id: int
exclude_archived:bool

🔄 返回

对象

🌐 端点

/integrations/slack/conversations GET

🔙 返回目录

carbon.integrations.listDataSourceItems

列出数据源项

🛠️ 使用

$result = $carbon->integrations->listDataSourceItems(
    data_source_id: 1, 
    parent_id: "string_example", 
    filters: [
    ], 
    pagination: [
        "limit" => 10,
        "offset" => 0,
    ], 
    order_by: "name", 
    order_dir: "asc"
);

⚙️ 参数

data_source_id: int
parent_id: 字符串
过滤器:ListItemsFiltersNullable
pagination: Pagination
order_by:
order_dir:

🔄 返回

ListDataSourceItemsResponse

🌐 端点

/integrations/items/list POST

🔙 返回目录

carbon.integrations.listFolders

连接Outlook账号后,您可以使用此端点列出Outlook上所有的文件夹。这包括系统文件夹(如“收件箱”)和用户创建的文件夹。

🛠️ 使用

$result = $carbon->integrations->listFolders(
    data_source_id: 1
);

⚙️ 参数

data_source_id: int

🔄 返回

对象

🌐 端点

/integrations/outlook/user_folders GET

🔙 返回目录

carbon.integrations.listGitbookSpaces

连接Gitbook账号后,您可以使用此端点列出当前组织下的所有空间。

🛠️ 使用

$result = $carbon->integrations->listGitbookSpaces(
    data_source_id: 1
);

⚙️ 参数

data_source_id: int

🔄 返回

对象

🌐 端点

/integrations/gitbook/spaces GET

🔙 返回目录

carbon.integrations.listLabels

连接Gmail账号后,您可以使用此端点列出所有标签。用户创建的标签将具有“user”类型,而Gmail的默认标签将具有“system”类型。

🛠️ 使用

$result = $carbon->integrations->listLabels(
    data_source_id: 1
);

⚙️ 参数

data_source_id: int

🔄 返回

对象

🌐 端点

/integrations/gmail/user_labels GET

🔙 返回目录

carbon.integrations.listOutlookCategories

连接Outlook账号后,您可以使用此端点列出Outlook上的所有类别。我们目前支持列出最多250个类别。

🛠️ 使用

$result = $carbon->integrations->listOutlookCategories(
    data_source_id: 1
);

⚙️ 参数

data_source_id: int

🔄 返回

对象

🌐 端点

/integrations/outlook/user_categories GET

🔙 返回目录

carbon.integrations.listRepos

连接GitHub账号后,您可以使用此端点列出您有权访问的仓库。您可以使用数据源ID或用户名从特定账号中检索。

🛠️ 使用

$result = $carbon->integrations->listRepos(
    per_page: 30, 
    page: 1, 
    data_source_id: 1
);

⚙️ 参数

per_page:int
page:int
data_source_id: int

🔄 返回

对象

🌐 端点

/integrations/github/repos GET

🔙 返回目录

carbon.integrations.syncAzureBlobFiles

在通过/integrations/items/sync和integrations/items/list可选地加载项目后,使用容器名称和文件名作为此端点的ID以同步到Carbon。以下附加参数可以关联所选项目或修改同步行为。

🛠️ 使用

$result = $carbon->integrations->syncAzureBlobFiles(
    ids: [
        [
        ]
    ], 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    max_items_per_chunk: 1, 
    set_page_as_boundary: False, 
    data_source_id: 1, 
    request_id: "string_example", 
    use_ocr: False, 
    parse_pdf_tables_with_ocr: False, 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ]
);

⚙️ 参数

ids:AzureBlobGetFileInput[]
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
max_items_per_chunk: int

每个块中的对象数。仅适用于csv、tsv、xlsx和json文件。

set_page_as_boundary: bool
data_source_id: int
request_id: string
use_ocr: bool
parse_pdf_tables_with_ocr: bool
file_sync_config: FileSyncConfigNullable

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/azure_blob_storage/files POST

🔙 返回目录

carbon.integrations.syncAzureBlobStorage

此端点可用于连接Azure Blob Storage。

对于Azure Blob存储,请按照以下步骤操作

  1. 创建一个新的Azure存储账户并授予以下权限
    • 列出容器。
    • 从特定容器和块读取以与Carbon同步。确保任何未来的容器或块都有相同的权限。
  2. 为存储账户生成共享访问签名(SAS)令牌或访问密钥。

创建后,提供以下详细信息以生成连接URL

  1. 存储账户密钥名称。
  2. 存储账户名称。

🛠️ 使用

$result = $carbon->integrations->syncAzureBlobStorage(
    account_name: "string_example", 
    account_key: "string_example", 
    sync_source_items: True
);

⚙️ 参数

account_name: string
account_key: string
sync_source_items: bool

🔄 返回

OrganizationUserDataSourceAPI

🌐 端点

/integrations/azure_blob_storage POST

🔙 返回目录

carbon.integrations.syncConfluence

Deprecated

此端点已弃用。请使用/integrations/files/sync代替。

在用户的Confluence账户中列出页面后,所选页面的ids集合和连接账户的data_source_id可以传递到该端点以将它们同步到Carbon。以下列出的附加参数可以用于将数据关联到所选页面或更改同步行为。

🛠️ 使用

$result = $carbon->integrations->syncConfluence(
    data_source_id: 1, 
    ids: [
        "string_example"
    ], 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    max_items_per_chunk: 1, 
    set_page_as_boundary: False, 
    request_id: "string_example", 
    use_ocr: False, 
    parse_pdf_tables_with_ocr: False, 
    incremental_sync: False, 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ]
);

⚙️ 参数

data_source_id: int
ids: IdsProperty
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
max_items_per_chunk: int

每个块中的对象数。仅适用于csv、tsv、xlsx和json文件。

set_page_as_boundary: bool
request_id: string
use_ocr: bool
parse_pdf_tables_with_ocr: bool
incremental_sync: 布尔型

只有当文件尚未同步或嵌入属性已更改时才同步文件。此标志目前由ONEDRIVE、GOOGLE_DRIVE、BOX、DROPBOX、INTERCOM、GMAIL、OUTLOOK、ZENDESK、CONFLUENCE、NOTION、SHAREPOINT、SERVICENOW支持。对于其他数据源将忽略。

file_sync_config: FileSyncConfigNullable

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/confluence/sync POST

🔙 返回目录

carbon.integrations.syncDataSourceItems

同步数据源项

🛠️ 使用

$result = $carbon->integrations->syncDataSourceItems(
    data_source_id: 1
);

⚙️ 参数

data_source_id: int

🔄 返回

OrganizationUserDataSourceAPI

🌐 端点

/integrations/items/sync POST

🔙 返回目录

carbon.integrations.syncFiles

通过/integrations/items/sync和/integrations/items/list列出文件和文件夹后,使用所选项的外部ID作为此端点的ids以将它们同步到Carbon。Sharepoint项需要额外的参数root_id,该参数标识文件或文件夹所在的驱动器,并存储在root_external_id中。该附加参数是可选的,省略它将告诉同步操作假定该项存储在默认的文档驱动器中。

🛠️ 使用

$result = $carbon->integrations->syncFiles(
    data_source_id: 1, 
    ids: [
        "string_example"
    ], 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    max_items_per_chunk: 1, 
    set_page_as_boundary: False, 
    request_id: "string_example", 
    use_ocr: False, 
    parse_pdf_tables_with_ocr: False, 
    incremental_sync: False, 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ]
);

⚙️ 参数

data_source_id: int
ids: IdsProperty
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
max_items_per_chunk: int

每个块中的对象数。仅适用于csv、tsv、xlsx和json文件。

set_page_as_boundary: bool
request_id: string
use_ocr: bool
parse_pdf_tables_with_ocr: bool
incremental_sync: 布尔型

只有当文件尚未同步或嵌入属性已更改时才同步文件。此标志目前由ONEDRIVE、GOOGLE_DRIVE、BOX、DROPBOX、INTERCOM、GMAIL、OUTLOOK、ZENDESK、CONFLUENCE、NOTION、SHAREPOINT、SERVICENOW支持。对于其他数据源将忽略。

file_sync_config: FileSyncConfigNullable

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/files/sync POST

🔙 返回目录

carbon.integrations.syncGitHub

参考此文章以获取访问令牌 https://githubdocs.cn/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens。确保您的访问令牌具有从您想要的仓库读取内容的权限。请注意,如果您的访问令牌过期,您需要通过此端点手动更新它。

🛠️ 使用

$result = $carbon->integrations->syncGitHub(
    username: "string_example", 
    access_token: "string_example", 
    sync_source_items: False
);

⚙️ 参数

username: string
access_token: string
sync_source_items: bool

启用此标志将从源获取所有可用的内容,并通过列表项端点列出

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/github POST

🔙 返回目录

carbon.integrations.syncGitbook

您可以使用此端点一次同步最多20个Gitbook空间。以下附加参数可以用于将数据与同步的页面关联或修改同步行为。

🛠️ 使用

$result = $carbon->integrations->syncGitbook(
    space_ids: [
        "string_example"
    ], 
    data_source_id: 1, 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    request_id: "string_example", 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ]
);

⚙️ 参数

space_ids: string[]
data_source_id: int
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
request_id: string
file_sync_config: FileSyncConfigNullable

🔄 返回

对象

🌐 端点

/integrations/gitbook/sync POST

🔙 返回目录

carbon.integrations.syncGmail

成功连接您的Gmail账户后,您可以使用过滤器参数选择要与我们同步的电子邮件。过滤器是一个键值对JSON对象。它还支持AND和OR操作。目前,我们支持以下列出的有限键集。

label:内置的Gmail标签,例如“Important”或您创建的任何自定义标签。
afterbefore:YYYY/mm/dd格式的日期(例如2023/12/31)。获取某个日期之后或之前的电子邮件。您也可以将它们组合使用以获取特定日期段的电子邮件。
is:可以有以下值 - starred、important、snoozed和unread
from:发件人的电子邮件地址
收件人:收件人的电子邮件地址
在:可以有以下值 - sent(用户发送的同步电子邮件)
有:可以有以下值 - attachment(有附件的同步电子邮件)

使用指定值之外的键或值可能会导致意外的行为。

带有过滤器的基本查询示例可以是

{
    "filters": {
            "key": "label",
            "value": "Test"
        }
}

这将列出所有带有标签“测试”的电子邮件。

您可以使用以下方式使用 AND 和 OR 操作

{
    "filters": {
        "AND": [
            {
                "key": "after",
                "value": "2024/01/07"
            },
            {
                "OR": [
                    {
                        "key": "label",
                        "value": "Personal"
                    },
                    {
                        "key": "is",
                        "value": "starred"
                    }
                ]
            }
        ]
    }
}

这将返回 1 月 7 日之后的电子邮件,这些电子邮件要么被星标,要么有“个人”标签。请注意,这是我们所支持的嵌套级别最高的,即您不能在上面的示例中在 OR 过滤器内添加更多的 AND/OR 过滤器。

🛠️ 使用

$result = $carbon->integrations->syncGmail(
    filters: [], 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    data_source_id: 1, 
    request_id: "string_example", 
    sync_attachments: False, 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ], 
    incremental_sync: False
);

⚙️ 参数

过滤器:对象
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
data_source_id: int
request_id: string
sync_attachments:布尔值
file_sync_config: FileSyncConfigNullable
incremental_sync: 布尔型

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/gmail/sync POST

🔙 返回目录

carbon.integrations.syncOutlook

成功连接您的 Outlook 账户后,您可以使用过滤器文件夹参数选择要与我们同步的电子邮件。 "folder" 应该是要从 Outlook 同步的文件夹。默认情况下,我们从收件箱文件夹获取消息。
过滤器是一个键值对 JSON 对象。它还支持 AND 和 OR 操作。目前,我们支持以下列出的有限键集。

category:您在 Outlook 中创建的自定义类别。
afterbefore:YYYY/mm/dd格式的日期(例如2023/12/31)。获取某个日期之后或之前的电子邮件。您也可以将它们组合使用以获取特定日期段的电子邮件。
是:可以有以下值:flagged
from:发件人的电子邮件地址

带有过滤器的基本查询示例可以是

{
    "filters": {
            "key": "category",
            "value": "Test"
        }
}

这将列出所有带有“测试”类别的电子邮件。

在相同查询中指定自定义文件夹

{
    "folder": "Folder Name",
    "filters": {
            "key": "category",
            "value": "Test"
        }
}

您可以使用以下方式使用 AND 和 OR 操作

{
    "filters": {
        "AND": [
            {
                "key": "after",
                "value": "2024/01/07"
            },
            {
                "OR": [
                    {
                        "key": "category",
                        "value": "Personal"
                    },
                    {
                        "key": "category",
                        "value": "Test"
                    },
                ]
            }
        ]
    }
}

这将返回 1 月 7 日之后的电子邮件,这些电子邮件要么是个人,要么是测试类别。请注意,这是我们所支持的嵌套级别最高的,即您不能在上面的示例中在 OR 过滤器内添加更多的 AND/OR 过滤器。

🛠️ 使用

$result = $carbon->integrations->syncOutlook(
    filters: [], 
    tags: [], 
    folder: "Inbox", 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    data_source_id: 1, 
    request_id: "string_example", 
    sync_attachments: False, 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ], 
    incremental_sync: False
);

⚙️ 参数

过滤器:对象
tags: object
folder:字符串
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
data_source_id: int
request_id: string
sync_attachments:布尔值
file_sync_config: FileSyncConfigNullable
incremental_sync: 布尔型

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/outlook/sync POST

🔙 返回目录

carbon.integrations.syncRepos

您可以使用 /integrations/github/repos 获取您的令牌可以访问的库,并同步它们的内容。您还可以传递任何公共存储库的完整名称(用户名/仓库名)。这将存储库内容与碳存储,可以通过 /integrations/items/list 端点访问。每个请求最多接受 25 个存储库。

🛠️ 使用

$result = $carbon->integrations->syncRepos(
    repos: [
        "string_example"
    ], 
    data_source_id: 1
);

⚙️ 参数

repos:字符串[]
data_source_id: int

🔄 返回

对象

🌐 端点

/integrations/github/sync_repos POST

🔙 返回目录

carbon.integrations.syncRssFeed

Rss Feed

🛠️ 使用

$result = $carbon->integrations->syncRssFeed(
    url: "string_example", 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    request_id: "string_example"
);

⚙️ 参数

url: string
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
request_id: string

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/rss_feed POST

🔙 返回目录

carbon.integrations.syncS3Files

在通过 /integrations/items/sync 和 integrations/items/list 选项卡可选加载项目后,使用存储桶名称和对象键作为此端点的 ID 来同步它们到 Carbon。以下附加参数可以关联所选项目或修改同步行为

🛠️ 使用

$result = $carbon->integrations->syncS3Files(
    ids: [
        [
        ]
    ], 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    max_items_per_chunk: 1, 
    set_page_as_boundary: False, 
    data_source_id: 1, 
    request_id: "string_example", 
    use_ocr: False, 
    parse_pdf_tables_with_ocr: False, 
    file_sync_config: [
        "auto_synced_source_types" => ["ARTICLE"],
        "sync_attachments" => False,
        "detect_audio_language" => False,
        "transcription_service" => "assemblyai",
        "include_speaker_labels" => False,
        "split_rows" => False,
        "generate_chunks_only" => False,
        "skip_file_processing" => False,
    ]
);

⚙️ 参数

ids:S3GetFileInput[]
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
max_items_per_chunk: int

每个块中的对象数。仅适用于csv、tsv、xlsx和json文件。

set_page_as_boundary: bool
data_source_id: int
request_id: string
use_ocr: bool
parse_pdf_tables_with_ocr: bool
file_sync_config: FileSyncConfigNullable

🔄 返回

GenericSuccessResponse

🌐 端点

/integrations/s3/files POST

🔙 返回目录

carbon.integrations.syncSlack

您可以使用 /integrations/slack/conversations 端点列出所有对话。对话的 ID 将用作此端点的输入,时间戳作为可选过滤器。

🛠️ 使用

$result = $carbon->integrations->syncSlack(
    filters: [
        "conversation_id" => "conversation_id_example",
    ], 
    tags: [], 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    embedding_model: "OPENAI", 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    data_source_id: 1, 
    request_id: "string_example"
);

⚙️ 参数

过滤器:SlackFilters
tags: object
块大小: int
块重叠: int
skip_embedding_generation: bool
embedding_model:
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
data_source_id: int
request_id: string

🔄 返回

对象

🌐 端点

/integrations/slack/sync POST

🔙 返回目录

carbon.organizations.get

获取组织

🛠️ 使用

$result = $carbon->organizations->get();

🔄 返回

OrganizationResponse

🌐 端点

/organization GET

🔙 返回目录

carbon.organizations.update

更新组织

🛠️ 使用

$result = $carbon->organizations->update(
    global_user_config: [
    ], 
    data_source_configs: [
        "key": [
            "allowed_file_formats" => [],
        ],
    ]
);

⚙️ 参数

global_user_config: UserConfigurationNullable
data_source_configs: arrayDataSourceConfiguration><

用于设置组织级别默认配置,相关于数据源。

🔄 返回

GenericSuccessResponse

🌐 端点

/organization/update POST

🔙 返回目录

carbon.organizations.updateStats

使用此端点重新聚合组织的统计信息,例如 aggregate_file_size。重新聚合过程是异步的,因此会发送一个 webhook,事件类型为 FILE_STATISTICS_AGGREGATED,以通知进程完成。在此聚合完成后,可以通过/organization端点检索更新的统计信息。/organization 的响应还将包含上次重新聚合统计信息的时间戳。

🛠️ 使用

$result = $carbon->organizations->updateStats();

🔄 返回

GenericSuccessResponse

🌐 端点

/organization/statistics POST

🔙 返回目录

carbon.users.all

列出组织内的用户

🛠️ 使用

$result = $carbon->users->all(
    pagination: [
        "limit" => 10,
        "offset" => 0,
    ], 
    filters: [
    ], 
    order_by: "created_at", 
    order_dir: "asc", 
    include_count: False
);

⚙️ 参数

pagination: Pagination
filters: ListUsersFilters
order_by:
order_dir:
include_count: bool

🔄 返回

UserListResponse

🌐 端点

/list_users POST

🔙 返回目录

carbon.users.delete

删除用户

🛠️ 使用

$result = $carbon->users->delete(
    customer_ids: [
        "string_example"
    ]
);

⚙️ 参数

customer_ids: string[]

🔄 返回

GenericSuccessResponse

🌐 端点

/delete_users POST

🔙 返回目录

carbon.users.get

用户端点

🛠️ 使用

$result = $carbon->users->get(
    customer_id: "string_example"
);

⚙️ 参数

customer_id: string

🔄 返回

UserResponse

🌐 端点

/user POST

🔙 返回目录

carbon.users.toggleUserFeatures

Deprecated

切换用户功能

🛠️ 使用

$result = $carbon->users->toggleUserFeatures(
    configuration_key_name: "string_example", 
    value: []
);

⚙️ 参数

configuration_key_name: string
value: object

🔄 返回

GenericSuccessResponse

🌐 端点

/modify_user_configuration POST

🔙 返回目录

carbon.users.updateUsers

更新用户

🛠️ 使用

$result = $carbon->users->updateUsers(
    customer_ids: [
        "string_example"
    ], 
    auto_sync_enabled_sources: [
        "string_example"
    ], 
    max_files: -1, 
    max_files_per_upload: -1
);

⚙️ 参数

customer_ids: string[]

组织提供用户 ID 列表

auto_sync_enabled_sources: AutoSyncEnabledSourcesProperty
max_files: int

用户所有上传的文件中的自定义文件上传限制(对所有用户)。如果设置,则用户不得上传超过此限制的文件。如果未设置或设置为 -1,则用户将没有限制。

max_files_per_upload: int

用户在单次上传中的自定义文件上传限制。如果设置了该值,则用户在单次上传中不允许上传超过此限制的文件。如果没有设置,或设置为 -1,则用户没有限制。

🔄 返回

GenericSuccessResponse

🌐 端点

/update_users POST

🔙 返回目录

carbon.utilities.fetchUrls

Deprecated

从网页中提取所有URL。

参数: url (str): 网页的URL

返回: FetchURLsResponse: 包含从网页中提取的URL列表和网页内容的响应对象。

🛠️ 使用

$result = $carbon->utilities->fetchUrls(
    url: "url_example"
);

⚙️ 参数

url: string

🔄 返回

FetchURLsResponse

🌐 端点

/fetch_urls GET

🔙 返回目录

carbon.utilities.fetchWebpage

Fetch Urls V2

🛠️ 使用

$result = $carbon->utilities->fetchWebpage(
    url: "string_example"
);

⚙️ 参数

url: string

🔄 返回

对象

🌐 端点

/fetch_webpage POST

🔙 返回目录

carbon.utilities.fetchYoutubeTranscripts

从YouTube视频中提取英文字幕。

参数: id (str): YouTube视频的ID。raw (bool): 是否返回原始字幕。默认为False。

返回: dict: 包含YouTube视频字幕的字典。

🛠️ 使用

$result = $carbon->utilities->fetchYoutubeTranscripts(
    id: "id_example", 
    raw: False
);

⚙️ 参数

id: string
raw: bool

🔄 返回

YoutubeTranscriptResponse

🌐 端点

/fetch_youtube_transcript GET

🔙 返回目录

carbon.utilities.processSitemap

从网站地图中检索所有URL,这些URL可以随后与我们的web_scrape端点一起使用。

🛠️ 使用

$result = $carbon->utilities->processSitemap(
    url: "url_example"
);

⚙️ 参数

url: string

🔄 返回

对象

🌐 端点

/process_sitemap GET

🔙 返回目录

carbon.utilities.scrapeSitemap

从网站地图中提取所有URL,并对每个URL执行网络抓取。

参数: sitemap_url (str): 网站地图的URL

返回: dict: 包含抓取作业状态信息的响应对象。

🛠️ 使用

$result = $carbon->utilities->scrapeSitemap(
    url: "string_example", 
    tags: [
        "key": "string_example",
    ], 
    max_pages_to_scrape: 1, 
    chunk_size: 1500, 
    chunk_overlap: 20, 
    skip_embedding_generation: False, 
    enable_auto_sync: False, 
    generate_sparse_vectors: False, 
    prepend_filename_to_chunks: False, 
    html_tags_to_skip: [], 
    css_classes_to_skip: [], 
    css_selectors_to_skip: [], 
    embedding_model: "OPENAI", 
    url_paths_to_include: [], 
    url_paths_to_exclude: [], 
    urls_to_scrape: [], 
    download_css_and_media: False, 
    generate_chunks_only: False
);

⚙️ 参数

url: string
tags:array<string, Tags1>
max_pages_to_scrape: int
块大小: int
块重叠: int
skip_embedding_generation: bool
enable_auto_sync: bool
generate_sparse_vectors: bool
prepend_filename_to_chunks: bool
html_tags_to_skip: string[]
css_classes_to_skip: string[]
css_selectors_to_skip: string[]
embedding_model:
url_paths_to_include: string[]

URL子路径或目录,您希望包含。例如,如果您只想包含以/questions开始的stackoverflow.com中的URL,则在此输入中添加/questions/。

url_paths_to_exclude: string[]

URL子路径或目录,您希望排除。例如,如果您想排除以/questions开始的stackoverflow.com中的URL,则在此输入中添加/questions/。

urls_to_scrape: string[]

您可以从网站地图中提交应抓取的URL子集。要获取URL列表,您可以查看/process_sitemap端点。如果为空,则将从网站地图中抓取所有URL。

download_css_and_media: bool

是否应从页面(图像、字体等)下载CSS和媒体。启用此标志时,抓取可能需要更长的时间才能完成,但成功率会提高。

generate_chunks_only: bool

如果启用此标志,文件将分块并存储在Carbon中,但不会生成嵌入。这将覆盖skip_embedding_generation标志。

🔄 返回

对象

🌐 端点

/scrape_sitemap POST

🔙 返回目录

carbon.utilities.scrapeWeb

在指定的网页URL上执行网络抓取。我们的网络爬虫完全兼容JavaScript,并支持递归深度,使您能够高效地从目标网站提取所有内容。

🛠️ 使用

$result = $carbon->utilities->scrapeWeb(
    body: [
        [
            "url" => "url_example",
            "recursion_depth" => 3,
            "max_pages_to_scrape" => 100,
            "chunk_size" => 1500,
            "chunk_overlap" => 20,
            "skip_embedding_generation" => False,
            "enable_auto_sync" => False,
            "generate_sparse_vectors" => False,
            "prepend_filename_to_chunks" => False,
            "html_tags_to_skip" => [],
            "css_classes_to_skip" => [],
            "css_selectors_to_skip" => [],
            "embedding_model" => "OPENAI",
            "url_paths_to_include" => [],
            "download_css_and_media" => False,
            "generate_chunks_only" => False,
        ]
    ],
);

⚙️ 请求体

WebscrapeRequest[]

🔄 返回

对象

🌐 端点

/web_scrape POST

🔙 返回目录

carbon.utilities.searchUrls

执行网络搜索并获取相关URL列表。

例如,当您搜索“与mRNA相关的内容”时,您将收到如下链接列表

- https://tomrenz.substack.com/p/mrna-and-why-it-matters

- https://www.statnews.com/2020/11/10/the-story-of-mrna-how-a-once-dismissed-idea-became-a-leading-technology-in-the-covid-vaccine-race/

- https://www.statnews.com/2022/11/16/covid-19-vaccines-were-a-success-but-mrna-still-has-a-delivery-problem/

- https://joomi.substack.com/p/were-still-being-misled-about-how

随后,您可以将这些链接提交给web_scrape端点,以检索相应网页的内容。

参数:query (str):要搜索的查询

返回:FetchURLsResponse:包含给定搜索查询的URL列表的响应对象。

🛠️ 使用

$result = $carbon->utilities->searchUrls(
    query: "query_example"
);

⚙️ 参数

查询:string

🔄 返回

FetchURLsResponse

🌐 端点

/search_urls GET

🔙 返回目录

carbon.utilities.userWebpages

用户网页

🛠️ 使用

$result = $carbon->utilities->userWebpages(
    filters: [
    ], 
    pagination: [
        "limit" => 10,
        "offset" => 0,
    ], 
    order_by: "created_at", 
    order_dir: "asc"
);

⚙️ 参数

过滤器: UserWebPagesFilters
pagination: Pagination
order_by:
order_dir:

🔄 返回

对象

🌐 端点

/user_webpages POST

🔙 返回目录

carbon.webhooks.addUrl

添加Webhook URL

🛠️ 使用

$result = $carbon->webhooks->addUrl(
    url: "string_example"
);

⚙️ 参数

url: string

🔄 返回

Webhook

🌐 端点

/add_webhook POST

🔙 返回目录

carbon.webhooks.deleteUrl

删除Webhook URL

🛠️ 使用

$result = $carbon->webhooks->deleteUrl(
    webhook_id: 1
);

⚙️ 参数

webhook_id: int

🔄 返回

GenericSuccessResponse

🌐 端点

/delete_webhook/{webhook_id} DELETE

🔙 返回目录

carbon.webhooks.urls

Webhook URL

🛠️ 使用

$result = $carbon->webhooks->urls(
    pagination: [
        "limit" => 10,
        "offset" => 0,
    ], 
    order_by: "created_at", 
    order_dir: "desc", 
    filters: [
        "ids" => [],
    ]
);

⚙️ 参数

pagination: Pagination
order_by:
order_dir:
过滤器: WebhookFilters

🔄 返回

WebhookQueryResponse

🌐 端点

/webhooks POST

🔙 返回目录

作者

此PHP包由Konfig自动生成。