| | |
| | | {/** |
| | | * @typedef Props |
| | | * @property {string} apiBaseUrl |
| | | */} |
| | | |
| | | import { CodeGroup } from '@/app/components/develop/code.tsx' |
| | | import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstruction, Paragraph } from '@/app/components/develop/md.tsx' |
| | | |
| | |
| | | <Property name='text' type='string' key='text'> |
| | | 文档内容 |
| | | </Property> |
| | | <Property name='doc_type' type='string' key='doc_type'> |
| | | 文档类型(选填) |
| | | - <code>book</code> 图书 Book |
| | | - <code>web_page</code> 网页 Web page |
| | | - <code>paper</code> 学术论文/文章 Academic paper/article |
| | | - <code>social_media_post</code> 社交媒体帖子 Social media post |
| | | - <code>wikipedia_entry</code> 维基百科条目 Wikipedia entry |
| | | - <code>personal_document</code> 个人文档 Personal document |
| | | - <code>business_document</code> 商业文档 Business document |
| | | - <code>im_chat_log</code> 即时通讯记录 Chat log |
| | | - <code>synced_from_notion</code> Notion同步文档 Notion document |
| | | - <code>synced_from_github</code> GitHub同步文档 GitHub document |
| | | - <code>others</code> 其他文档类型 Other document types |
| | | </Property> |
| | | <Property name='doc_metadata' type='object' key='doc_metadata'> |
| | | |
| | | 文档元数据(如提供文档类型则必填)。字段因文档类型而异: |
| | | |
| | | 针对图书 For <code>book</code>: |
| | | - <code>title</code> 书名 Book title |
| | | - <code>language</code> 图书语言 Book language |
| | | - <code>author</code> 作者 Book author |
| | | - <code>publisher</code> 出版社 Publisher name |
| | | - <code>publication_date</code> 出版日期 Publication date |
| | | - <code>isbn</code> ISBN号码 ISBN number |
| | | - <code>category</code> 图书分类 Book category |
| | | |
| | | 针对网页 For <code>web_page</code>: |
| | | - <code>title</code> 页面标题 Page title |
| | | - <code>url</code> 页面网址 Page URL |
| | | - <code>language</code> 页面语言 Page language |
| | | - <code>publish_date</code> 发布日期 Publish date |
| | | - <code>author/publisher</code> 作者/发布者 Author or publisher |
| | | - <code>topic/keywords</code> 主题/关键词 Topic or keywords |
| | | - <code>description</code> 页面描述 Page description |
| | | |
| | | 请查看 [api/services/dataset_service.py](https://github.com/langgenius/dify/blob/main/api/services/dataset_service.py#L475) 了解各文档类型所需字段的详细信息。 |
| | | |
| | | 针对"其他"类型文档,接受任何有效的JSON对象 |
| | | </Property> |
| | | <Property name='indexing_technique' type='string' key='indexing_technique'> |
| | | 索引方式 |
| | | - <code>high_quality</code> 高质量:使用 |
| | | ding 模型进行嵌入,构建为向量数据库索引 |
| | | - <code>high_quality</code> 高质量:使用 embedding 模型进行嵌入,构建为向量数据库索引 |
| | | - <code>economy</code> 经济:使用 keyword table index 的倒排索引进行构建 |
| | | </Property> |
| | | <Property name='doc_form' type='string' key='doc_form'> |
| | |
| | | - <code>semantic_search</code> 语义检索 |
| | | - <code>full_text_search</code> 全文检索 |
| | | - <code>reranking_enable</code> (bool) 是否开启rerank |
| | | - <code>reranking_mode</code> (String) 混合检索 |
| | | - <code>weighted_score</code> 权重设置 |
| | | - <code>reranking_model</code> Rerank 模型 |
| | | - <code>reranking_model</code> (object) Rerank 模型配置 |
| | | - <code>reranking_provider_name</code> (string) Rerank 模型的提供商 |
| | | - <code>reranking_model_name</code> (string) Rerank 模型的名称 |
| | |
| | | - <code>text_model</code> text 文档直接 embedding,经济模式默认为该模式 |
| | | - <code>hierarchical_model</code> parent-child 模式 |
| | | - <code>qa_model</code> Q&A 模式:为分片文档生成 Q&A 对,然后对问题进行 embedding |
| | | - <code>doc_type</code> 文档类型(选填)Type of document (optional) |
| | | - <code>book</code> 图书 |
| | | 文档记录一本书籍或出版物 |
| | | - <code>web_page</code> 网页 |
| | | 网页内容的文档记录 |
| | | - <code>paper</code> 学术论文/文章 |
| | | 学术论文或研究文章的记录 |
| | | - <code>social_media_post</code> 社交媒体帖子 |
| | | 社交媒体上的帖子内容 |
| | | - <code>wikipedia_entry</code> 维基百科条目 |
| | | 维基百科的词条内容 |
| | | - <code>personal_document</code> 个人文档 |
| | | 个人相关的文档记录 |
| | | - <code>business_document</code> 商业文档 |
| | | 商业相关的文档记录 |
| | | - <code>im_chat_log</code> 即时通讯记录 |
| | | 即时通讯的聊天记录 |
| | | - <code>synced_from_notion</code> Notion同步文档 |
| | | 从Notion同步的文档内容 |
| | | - <code>synced_from_github</code> GitHub同步文档 |
| | | 从GitHub同步的文档内容 |
| | | - <code>others</code> 其他文档类型 |
| | | 其他未列出的文档类型 |
| | | |
| | | - <code>doc_metadata</code> 文档元数据(如提供文档类型则必填 |
| | | 字段因文档类型而异 |
| | | |
| | | 针对图书类型 For <code>book</code>: |
| | | - <code>title</code> 书名 |
| | | 书籍的标题 |
| | | - <code>language</code> 图书语言 |
| | | 书籍的语言 |
| | | - <code>author</code> 作者 |
| | | 书籍的作者 |
| | | - <code>publisher</code> 出版社 |
| | | 出版社的名称 |
| | | - <code>publication_date</code> 出版日期 |
| | | 书籍的出版日期 |
| | | - <code>isbn</code> ISBN号码 |
| | | 书籍的ISBN编号 |
| | | - <code>category</code> 图书分类 |
| | | 书籍的分类类别 |
| | | |
| | | 针对网页类型 For <code>web_page</code>: |
| | | - <code>title</code> 页面标题 |
| | | 网页的标题 |
| | | - <code>url</code> 页面网址 |
| | | 网页的URL地址 |
| | | - <code>language</code> 页面语言 |
| | | 网页的语言 |
| | | - <code>publish_date</code> 发布日期 |
| | | 网页的发布日期 |
| | | - <code>author/publisher</code> 作者/发布者 |
| | | 网页的作者或发布者 |
| | | - <code>topic/keywords</code> 主题/关键词 |
| | | 网页的主题或关键词 |
| | | - <code>description</code> 页面描述 |
| | | 网页的描述信息 |
| | | |
| | | 请查看 [api/services/dataset_service.py](https://github.com/langgenius/dify/blob/main/api/services/dataset_service.py#L475) 了解各文档类型所需字段的详细信息。 |
| | | |
| | | 针对"其他"类型文档,接受任何有效的JSON对象 |
| | | |
| | | - <code>doc_language</code> 在 Q&A 模式下,指定文档的语言,例如:<code>English</code>、<code>Chinese</code> |
| | | |
| | |
| | | <Property name='external_knowledge_id' type='str' key='external_knowledge_id'> |
| | | 外部知识库 ID(选填) |
| | | </Property> |
| | | <Property name='embedding_model' type='str' key='embedding_model'> |
| | | Embedding 模型名称 |
| | | </Property> |
| | | <Property name='embedding_model_provider' type='str' key='embedding_model_provider'> |
| | | Embedding 模型供应商 |
| | | </Property> |
| | | <Property name='retrieval_model' type='object' key='retrieval_model'> |
| | | 检索模式 |
| | | - <code>search_method</code> (string) 检索方法 |
| | | - <code>hybrid_search</code> 混合检索 |
| | | - <code>semantic_search</code> 语义检索 |
| | | - <code>full_text_search</code> 全文检索 |
| | | - <code>reranking_enable</code> (bool) 是否开启rerank |
| | | - <code>reranking_model</code> (object) Rerank 模型配置 |
| | | - <code>reranking_provider_name</code> (string) Rerank 模型的提供商 |
| | | - <code>reranking_model_name</code> (string) Rerank 模型的名称 |
| | | - <code>top_k</code> (int) 召回条数 |
| | | - <code>score_threshold_enabled</code> (bool)是否开启召回分数限制 |
| | | - <code>score_threshold</code> (float) 召回分数限制 |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | |
| | | <Col> |
| | | ### Query |
| | | <Properties> |
| | | <Property name='keyword' type='string' key='keyword'> |
| | | 搜索关键词,可选 |
| | | </Property> |
| | | <Property name='tag_ids' type='array[string]' key='tag_ids'> |
| | | 标签 ID 列表,可选 |
| | | </Property> |
| | | <Property name='page' type='integer' key='page'> |
| | | 页码,可选,默认为 1 |
| | | <Property name='page' type='string' key='page'> |
| | | 页码 |
| | | </Property> |
| | | <Property name='limit' type='string' key='limit'> |
| | | 返回条数,可选,默认 20,范围 1-100 |
| | | </Property> |
| | | <Property name='include_all' type='boolean' key='include_all'> |
| | | 是否包含所有数据集(仅对所有者生效),可选,默认为 false |
| | | 返回条数,默认 20,范围 1-100 |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | |
| | | "limit": 20, |
| | | "total": 50, |
| | | "page": 1 |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}' |
| | | method='GET' |
| | | title='查看知识库详情' |
| | | name='#view_dataset' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="GET" |
| | | label="/datasets/{dataset_id}" |
| | | targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}' \\\n--header 'Authorization: Bearer {api_key}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}' \ |
| | | --header 'Authorization: Bearer {api_key}' |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "id": "eaedb485-95ac-4ffd-ab1e-18da6d676a2f", |
| | | "name": "Test Knowledge Base", |
| | | "description": "", |
| | | "provider": "vendor", |
| | | "permission": "only_me", |
| | | "data_source_type": null, |
| | | "indexing_technique": null, |
| | | "app_count": 0, |
| | | "document_count": 0, |
| | | "word_count": 0, |
| | | "created_by": "e99a1635-f725-4951-a99a-1daaaa76cfc6", |
| | | "created_at": 1735620612, |
| | | "updated_by": "e99a1635-f725-4951-a99a-1daaaa76cfc6", |
| | | "updated_at": 1735620612, |
| | | "embedding_model": null, |
| | | "embedding_model_provider": null, |
| | | "embedding_available": true, |
| | | "retrieval_model_dict": { |
| | | "search_method": "semantic_search", |
| | | "reranking_enable": false, |
| | | "reranking_mode": null, |
| | | "reranking_model": { |
| | | "reranking_provider_name": "", |
| | | "reranking_model_name": "" |
| | | }, |
| | | "weights": null, |
| | | "top_k": 2, |
| | | "score_threshold_enabled": false, |
| | | "score_threshold": null |
| | | }, |
| | | "tags": [], |
| | | "doc_form": null, |
| | | "external_knowledge_info": { |
| | | "external_knowledge_id": null, |
| | | "external_knowledge_api_id": null, |
| | | "external_knowledge_api_name": null, |
| | | "external_knowledge_api_endpoint": null |
| | | }, |
| | | "external_retrieval_model": { |
| | | "top_k": 2, |
| | | "score_threshold": 0.0, |
| | | "score_threshold_enabled": null |
| | | } |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}' |
| | | method='PATCH' |
| | | title='修改知识库详情' |
| | | name='#update_dataset' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | </Properties> |
| | | |
| | | ### Request Body |
| | | <Properties> |
| | | <Property name='indexing_technique' type='string' key='indexing_technique'> |
| | | 索引模式(选填,建议填写) |
| | | - <code>high_quality</code> 高质量 |
| | | - <code>economy</code> 经济 |
| | | </Property> |
| | | <Property name='permission' type='string' key='permission'> |
| | | 权限(选填,默认 only_me) |
| | | - <code>only_me</code> 仅自己 |
| | | - <code>all_team_members</code> 所有团队成员 |
| | | - <code>partial_members</code> 部分团队成员 |
| | | </Property> |
| | | <Property name='embedding_model_provider' type='string' key='embedding_model_provider'> |
| | | 嵌入模型提供商(选填), 必须先在系统内设定好接入的模型,对应的是provider字段 |
| | | </Property> |
| | | <Property name='embedding_model' type='string' key='embedding_model'> |
| | | 嵌入模型(选填) |
| | | </Property> |
| | | <Property name='retrieval_model' type='object' key='retrieval_model'> |
| | | 检索参数(选填,如不填,按照默认方式召回) |
| | | - <code>search_method</code> (text) 检索方法:以下四个关键字之一,必填 |
| | | - <code>keyword_search</code> 关键字检索 |
| | | - <code>semantic_search</code> 语义检索 |
| | | - <code>full_text_search</code> 全文检索 |
| | | - <code>hybrid_search</code> 混合检索 |
| | | - <code>reranking_enable</code> (bool) 是否启用 Reranking,非必填,如果检索模式为 semantic_search 模式或者 hybrid_search 则传值 |
| | | - <code>reranking_mode</code> (object) Rerank 模型配置,非必填,如果启用了 reranking 则传值 |
| | | - <code>reranking_provider_name</code> (string) Rerank 模型提供商 |
| | | - <code>reranking_model_name</code> (string) Rerank 模型名称 |
| | | - <code>weights</code> (float) 混合检索模式下语意检索的权重设置 |
| | | - <code>top_k</code> (integer) 返回结果数量,非必填 |
| | | - <code>score_threshold_enabled</code> (bool) 是否开启 score 阈值 |
| | | - <code>score_threshold</code> (float) Score 阈值 |
| | | </Property> |
| | | <Property name='partial_member_list' type='array' key='partial_member_list'> |
| | | 部分团队成员 ID 列表(选填) |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="PATCH" |
| | | label="/datasets/{dataset_id}" |
| | | targetCode={`curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ |
| | | "name": "Test Knowledge Base", |
| | | "indexing_technique": "high_quality", |
| | | "permission": "only_me", |
| | | "embedding_model_provider": "zhipuai", |
| | | "embedding_model": "embedding-3", |
| | | "retrieval_model": { |
| | | "search_method": "keyword_search", |
| | | "reranking_enable": false, |
| | | "reranking_mode": null, |
| | | "reranking_model": { |
| | | "reranking_provider_name": "", |
| | | "reranking_model_name": "" |
| | | }, |
| | | "weights": null, |
| | | "top_k": 1, |
| | | "score_threshold_enabled": false, |
| | | "score_threshold": null |
| | | }, |
| | | "partial_member_list": [] |
| | | }' |
| | | `} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}' \ |
| | | --header 'Authorization: Bearer {api_key}' \ |
| | | --header 'Content-Type: application/json' \ |
| | | --data-raw '{ |
| | | "name": "Test Knowledge Base", |
| | | "indexing_technique": "high_quality", |
| | | "permission": "only_me", |
| | | "embedding_model_provider": "zhipuai", |
| | | "embedding_model": "embedding-3", |
| | | "retrieval_model": { |
| | | "search_method": "keyword_search", |
| | | "reranking_enable": false, |
| | | "reranking_mode": null, |
| | | "reranking_model": { |
| | | "reranking_provider_name": "", |
| | | "reranking_model_name": "" |
| | | }, |
| | | "weights": null, |
| | | "top_k": 1, |
| | | "score_threshold_enabled": false, |
| | | "score_threshold": null |
| | | }, |
| | | "partial_member_list": [] |
| | | }' |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "id": "eaedb485-95ac-4ffd-ab1e-18da6d676a2f", |
| | | "name": "Test Knowledge Base", |
| | | "description": "", |
| | | "provider": "vendor", |
| | | "permission": "only_me", |
| | | "data_source_type": null, |
| | | "indexing_technique": "high_quality", |
| | | "app_count": 0, |
| | | "document_count": 0, |
| | | "word_count": 0, |
| | | "created_by": "e99a1635-f725-4951-a99a-1daaaa76cfc6", |
| | | "created_at": 1735620612, |
| | | "updated_by": "e99a1635-f725-4951-a99a-1daaaa76cfc6", |
| | | "updated_at": 1735622679, |
| | | "embedding_model": "embedding-3", |
| | | "embedding_model_provider": "zhipuai", |
| | | "embedding_available": null, |
| | | "retrieval_model_dict": { |
| | | "search_method": "semantic_search", |
| | | "reranking_enable": false, |
| | | "reranking_mode": null, |
| | | "reranking_model": { |
| | | "reranking_provider_name": "", |
| | | "reranking_model_name": "" |
| | | }, |
| | | "weights": null, |
| | | "top_k": 2, |
| | | "score_threshold_enabled": false, |
| | | "score_threshold": null |
| | | }, |
| | | "tags": [], |
| | | "doc_form": null, |
| | | "external_knowledge_info": { |
| | | "external_knowledge_id": null, |
| | | "external_knowledge_api_id": null, |
| | | "external_knowledge_api_name": null, |
| | | "external_knowledge_api_endpoint": null |
| | | }, |
| | | "external_retrieval_model": { |
| | | "top_k": 2, |
| | | "score_threshold": 0.0, |
| | | "score_threshold_enabled": null |
| | | }, |
| | | "partial_member_list": [] |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | |
| | | </Property> |
| | | <Property name='text' type='string' key='text'> |
| | | 文档内容(选填) |
| | | </Property> |
| | | <Property name='doc_type' type='string' key='doc_type'> |
| | | 文档类型(选填) |
| | | - <code>book</code> 图书 Book |
| | | - <code>web_page</code> 网页 Web page |
| | | - <code>paper</code> 学术论文/文章 Academic paper/article |
| | | - <code>social_media_post</code> 社交媒体帖子 Social media post |
| | | - <code>wikipedia_entry</code> 维基百科条目 Wikipedia entry |
| | | - <code>personal_document</code> 个人文档 Personal document |
| | | - <code>business_document</code> 商业文档 Business document |
| | | - <code>im_chat_log</code> 即时通讯记录 Chat log |
| | | - <code>synced_from_notion</code> Notion同步文档 Notion document |
| | | - <code>synced_from_github</code> GitHub同步文档 GitHub document |
| | | - <code>others</code> 其他文档类型 Other document types |
| | | </Property> |
| | | <Property name='doc_metadata' type='object' key='doc_metadata'> |
| | | |
| | | 文档元数据(如提供文档类型则必填)。字段因文档类型而异: |
| | | |
| | | 针对图书 For <code>book</code>: |
| | | - <code>title</code> 书名 Book title |
| | | - <code>language</code> 图书语言 Book language |
| | | - <code>author</code> 作者 Book author |
| | | - <code>publisher</code> 出版社 Publisher name |
| | | - <code>publication_date</code> 出版日期 Publication date |
| | | - <code>isbn</code> ISBN号码 ISBN number |
| | | - <code>category</code> 图书分类 Book category |
| | | |
| | | 针对网页 For <code>web_page</code>: |
| | | - <code>title</code> 页面标题 Page title |
| | | - <code>url</code> 页面网址 Page URL |
| | | - <code>language</code> 页面语言 Page language |
| | | - <code>publish_date</code> 发布日期 Publish date |
| | | - <code>author/publisher</code> 作者/发布者 Author or publisher |
| | | - <code>topic/keywords</code> 主题/关键词 Topic or keywords |
| | | - <code>description</code> 页面描述 Page description |
| | | |
| | | 请查看 [api/services/dataset_service.py](https://github.com/langgenius/dify/blob/main/api/services/dataset_service.py#L475) 了解各文档类型所需字段的详细信息。 |
| | | |
| | | 针对"其他"类型文档,接受任何有效的JSON对象 |
| | | </Property> |
| | | <Property name='process_rule' type='object' key='process_rule'> |
| | | 处理规则(选填) |
| | |
| | | - <code>separator</code> 分段标识符,目前仅允许设置一个分隔符。默认为 <code>***</code> |
| | | - <code>max_tokens</code> 最大长度 (token) 需要校验小于父级的长度 |
| | | - <code>chunk_overlap</code> 分段重叠指的是在对数据进行分段时,段与段之间存在一定的重叠部分(选填) |
| | | - <code>doc_type</code> 文档类型(选填)Type of document (optional) |
| | | - <code>book</code> 图书 |
| | | 文档记录一本书籍或出版物 |
| | | - <code>web_page</code> 网页 |
| | | 网页内容的文档记录 |
| | | - <code>paper</code> 学术论文/文章 |
| | | 学术论文或研究文章的记录 |
| | | - <code>social_media_post</code> 社交媒体帖子 |
| | | 社交媒体上的帖子内容 |
| | | - <code>wikipedia_entry</code> 维基百科条目 |
| | | 维基百科的词条内容 |
| | | - <code>personal_document</code> 个人文档 |
| | | 个人相关的文档记录 |
| | | - <code>business_document</code> 商业文档 |
| | | 商业相关的文档记录 |
| | | - <code>im_chat_log</code> 即时通讯记录 |
| | | 即时通讯的聊天记录 |
| | | - <code>synced_from_notion</code> Notion同步文档 |
| | | 从Notion同步的文档内容 |
| | | - <code>synced_from_github</code> GitHub同步文档 |
| | | 从GitHub同步的文档内容 |
| | | - <code>others</code> 其他文档类型 |
| | | 其他未列出的文档类型 |
| | | |
| | | - <code>doc_metadata</code> 文档元数据(如提供文档类型则必填 |
| | | 字段因文档类型而异 |
| | | |
| | | 针对图书类型 For <code>book</code>: |
| | | - <code>title</code> 书名 |
| | | 书籍的标题 |
| | | - <code>language</code> 图书语言 |
| | | 书籍的语言 |
| | | - <code>author</code> 作者 |
| | | 书籍的作者 |
| | | - <code>publisher</code> 出版社 |
| | | 出版社的名称 |
| | | - <code>publication_date</code> 出版日期 |
| | | 书籍的出版日期 |
| | | - <code>isbn</code> ISBN号码 |
| | | 书籍的ISBN编号 |
| | | - <code>category</code> 图书分类 |
| | | 书籍的分类类别 |
| | | |
| | | 针对网页类型 For <code>web_page</code>: |
| | | - <code>title</code> 页面标题 |
| | | 网页的标题 |
| | | - <code>url</code> 页面网址 |
| | | 网页的URL地址 |
| | | - <code>language</code> 页面语言 |
| | | 网页的语言 |
| | | - <code>publish_date</code> 发布日期 |
| | | 网页的发布日期 |
| | | - <code>author/publisher</code> 作者/发布者 |
| | | 网页的作者或发布者 |
| | | - <code>topic/keywords</code> 主题/关键词 |
| | | 网页的主题或关键词 |
| | | - <code>description</code> 页面描述 |
| | | 网页的描述信息 |
| | | |
| | | 请查看 [api/services/dataset_service.py](https://github.com/langgenius/dify/blob/main/api/services/dataset_service.py#L475) 了解各文档类型所需字段的详细信息。 |
| | | |
| | | 针对"其他"类型文档,接受任何有效的JSON对象 |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```text {{ title: 'Response' }} |
| | | 204 No Content |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "result": "success" |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | |
| | | <Property name='status' type='string' key='status'> |
| | | 搜索状态,completed |
| | | </Property> |
| | | <Property name='page' type='string' key='page'> |
| | | 页码,可选 |
| | | </Property> |
| | | <Property name='limit' type='string' key='limit'> |
| | | 返回条数,可选,默认 20,范围 1-100 |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | |
| | | "error": null, |
| | | "stopped_at": null |
| | | }], |
| | | "doc_form": "text_model", |
| | | "has_more": false, |
| | | "limit": 20, |
| | | "total": 9, |
| | | "page": 1 |
| | | "doc_form": "text_model" |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```text {{ title: 'Response' }} |
| | | 204 No Content |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "result": "success" |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | |
| | | <CodeGroup title="Response"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "data": { |
| | | "data": [{ |
| | | "id": "", |
| | | "position": 1, |
| | | "document_id": "", |
| | |
| | | "completed_at": 1695312007, |
| | | "error": null, |
| | | "stopped_at": null |
| | | }, |
| | | "doc_form": "text_model" |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks' |
| | | method='POST' |
| | | title='新增文档子分段' |
| | | name='#create_child_chunk' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | <Property name='document_id' type='string' key='document_id'> |
| | | 文档 ID |
| | | </Property> |
| | | <Property name='segment_id' type='string' key='segment_id'> |
| | | 分段 ID |
| | | </Property> |
| | | </Properties> |
| | | |
| | | ### Request Body |
| | | <Properties> |
| | | <Property name='content' type='string' key='content'> |
| | | 子分段内容 |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="POST" |
| | | label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks" |
| | | targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"content": "子分段内容"}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks' \ |
| | | --header 'Authorization: Bearer {api_key}' \ |
| | | --header 'Content-Type: application/json' \ |
| | | --data-raw '{ |
| | | "content": "子分段内容" |
| | | }' |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "data": { |
| | | "id": "", |
| | | "segment_id": "", |
| | | "content": "子分段内容", |
| | | "word_count": 25, |
| | | "tokens": 0, |
| | | "index_node_id": "", |
| | | "index_node_hash": "", |
| | | "status": "completed", |
| | | "created_by": "", |
| | | "created_at": 1695312007, |
| | | "indexing_at": 1695312007, |
| | | "completed_at": 1695312007, |
| | | "error": null, |
| | | "stopped_at": null |
| | | } |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks' |
| | | method='GET' |
| | | title='查询文档子分段' |
| | | name='#get_child_chunks' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | <Property name='document_id' type='string' key='document_id'> |
| | | 文档 ID |
| | | </Property> |
| | | <Property name='segment_id' type='string' key='segment_id'> |
| | | 分段 ID |
| | | </Property> |
| | | </Properties> |
| | | |
| | | ### Query |
| | | <Properties> |
| | | <Property name='keyword' type='string' key='keyword'> |
| | | 搜索关键词(选填) |
| | | </Property> |
| | | <Property name='page' type='integer' key='page'> |
| | | 页码(选填,默认1) |
| | | </Property> |
| | | <Property name='limit' type='integer' key='limit'> |
| | | 每页数量(选填,默认20,最大100) |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="GET" |
| | | label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks" |
| | | targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks?page=1&limit=20' \\\n--header 'Authorization: Bearer {api_key}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks?page=1&limit=20' \ |
| | | --header 'Authorization: Bearer {api_key}' |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "data": [{ |
| | | "id": "", |
| | | "segment_id": "", |
| | | "content": "子分段内容", |
| | | "word_count": 25, |
| | | "tokens": 0, |
| | | "index_node_id": "", |
| | | "index_node_hash": "", |
| | | "status": "completed", |
| | | "created_by": "", |
| | | "created_at": 1695312007, |
| | | "indexing_at": 1695312007, |
| | | "completed_at": 1695312007, |
| | | "error": null, |
| | | "stopped_at": null |
| | | }], |
| | | "total": 1, |
| | | "total_pages": 1, |
| | | "page": 1, |
| | | "limit": 20 |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' |
| | | method='DELETE' |
| | | title='删除文档子分段' |
| | | name='#delete_child_chunk' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | <Property name='document_id' type='string' key='document_id'> |
| | | 文档 ID |
| | | </Property> |
| | | <Property name='segment_id' type='string' key='segment_id'> |
| | | 分段 ID |
| | | </Property> |
| | | <Property name='child_chunk_id' type='string' key='child_chunk_id'> |
| | | 子分段 ID |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="DELETE" |
| | | label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}" |
| | | targetCode={`curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' \\\n--header 'Authorization: Bearer {api_key}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' \ |
| | | --header 'Authorization: Bearer {api_key}' |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```text {{ title: 'Response' }} |
| | | 204 No Content |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Row> |
| | | <Col> |
| | | ### 错误信息 |
| | | <Properties> |
| | | <Property name='code' type='string' key='code'> |
| | | 返回的错误代码 |
| | | </Property> |
| | | </Properties> |
| | | <Properties> |
| | | <Property name='status' type='number' key='status'> |
| | | 返回的错误状态 |
| | | </Property> |
| | | </Properties> |
| | | <Properties> |
| | | <Property name='message' type='string' key='message'> |
| | | 返回的错误信息 |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col> |
| | | <CodeGroup title="Example"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "code": "no_file_uploaded", |
| | | "message": "Please upload your file.", |
| | | "status": 400 |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' |
| | | method='PATCH' |
| | | title='更新文档子分段' |
| | | name='#update_child_chunk' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | <Property name='document_id' type='string' key='document_id'> |
| | | 文档 ID |
| | | </Property> |
| | | <Property name='segment_id' type='string' key='segment_id'> |
| | | 分段 ID |
| | | </Property> |
| | | <Property name='child_chunk_id' type='string' key='child_chunk_id'> |
| | | 子分段 ID |
| | | </Property> |
| | | </Properties> |
| | | |
| | | ### Request Body |
| | | <Properties> |
| | | <Property name='content' type='string' key='content'> |
| | | 子分段内容 |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="PATCH" |
| | | label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}" |
| | | targetCode={`curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"content": "更新的子分段内容"}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' \ |
| | | --header 'Authorization: Bearer {api_key}' \ |
| | | --header 'Content-Type: application/json' \ |
| | | --data-raw '{ |
| | | "content": "更新的子分段内容" |
| | | }' |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "data": { |
| | | "id": "", |
| | | "segment_id": "", |
| | | "content": "更新的子分段内容", |
| | | "word_count": 25, |
| | | "tokens": 0, |
| | | "index_node_id": "", |
| | | "index_node_hash": "", |
| | | "status": "completed", |
| | | "created_by": "", |
| | | "created_at": 1695312007, |
| | | "indexing_at": 1695312007, |
| | | "completed_at": 1695312007, |
| | | "error": null, |
| | | "stopped_at": null |
| | | } |
| | | "doc_form": "text_model" |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | |
| | | </Property> |
| | | <Property name='retrieval_model' type='object' key='retrieval_model'> |
| | | 检索参数(选填,如不填,按照默认方式召回) |
| | | - <code>search_method</code> (text) 检索方法:以下四个关键字之一,必填 |
| | | - <code>search_method</code> (text) 检索方法:以下三个关键字之一,必填 |
| | | - <code>keyword_search</code> 关键字检索 |
| | | - <code>semantic_search</code> 语义检索 |
| | | - <code>full_text_search</code> 全文检索 |
| | |
| | | "id": "a8c6c36f-9f5d-4d7a-8472-f5d7b75d71d2", |
| | | "data_source_type": "upload_file", |
| | | "name": "readme.txt", |
| | | "doc_type": null |
| | | } |
| | | }, |
| | | "score": 3.730463140527718e-05, |
| | |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}/metadata' |
| | | method='POST' |
| | | title='新增元数据' |
| | | name='#create_metadata' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Params |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | </Properties> |
| | | |
| | | ### Request Body |
| | | <Properties> |
| | | <Property name='segment' type='object' key='segment'> |
| | | - <code>type</code> (string) 元数据类型,必填 |
| | | - <code>name</code> (string) 元数据名称,必填 |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="POST" |
| | | label="/datasets/{dataset_id}/metadata" |
| | | targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/metadata' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json'\\\n--data-raw '{"type": "string", "name": "test"}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "id": "abc", |
| | | "type": "string", |
| | | "name": "test", |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}/metadata/{metadata_id}' |
| | | method='PATCH' |
| | | title='更新元数据' |
| | | name='#update_metadata' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | <Property name='metadata_id' type='string' key='metadata_id'> |
| | | 元数据 ID |
| | | </Property> |
| | | </Properties> |
| | | |
| | | ### Request Body |
| | | <Properties> |
| | | <Property name='segment' type='object' key='segment'> |
| | | - <code>name</code> (string) 元数据名称,必填 |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="PATCH" |
| | | label="/datasets/{dataset_id}/metadata/{metadata_id}" |
| | | targetCode={`curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}/metadata/{metadata_id}' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json'\\\n--data-raw '{"name": "test"}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "id": "abc", |
| | | "type": "string", |
| | | "name": "test", |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}/metadata/{metadata_id}' |
| | | method='DELETE' |
| | | title='删除元数据' |
| | | name='#delete_metadata' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | <Property name='metadata_id' type='string' key='metadata_id'> |
| | | 元数据 ID |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="DELETE" |
| | | label="/datasets/{dataset_id}/metadata/{metadata_id}" |
| | | targetCode={`curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/metadata/{metadata_id}' \\\n--header 'Authorization: Bearer {api_key}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}/metadata/built-in/{action}' |
| | | method='POST' |
| | | title='启用/禁用内置元数据' |
| | | name='#toggle_metadata' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | <Property name='action' type='string' key='action'> |
| | | disable/enable |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="POST" |
| | | label="/datasets/{dataset_id}/metadata/built-in/{action}" |
| | | targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/metadata/built-in/{action}' \\\n--header 'Authorization: Bearer {api_key}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}/documents/metadata' |
| | | method='POST' |
| | | title='更新文档元数据' |
| | | name='#update_documents_metadata' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | </Properties> |
| | | |
| | | ### Request Body |
| | | <Properties> |
| | | <Property name='operation_data' type='object list' key='segments'> |
| | | - <code>document_id</code> (string) 文档 ID |
| | | - <code>metadata_list</code> (list) 元数据列表 |
| | | - <code>id</code> (string) 元数据 ID |
| | | - <code>type</code> (string) 元数据类型 |
| | | - <code>name</code> (string) 元数据名称 |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="POST" |
| | | label="/datasets/{dataset_id}/documents/metadata" |
| | | targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/metadata' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json'\\\n--data-raw '{"operation_data": [{"document_id": "document_id", "metadata_list": [{"id": "id", "value": "value", "name": "name"}]}]}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/datasets/{dataset_id}/metadata' |
| | | method='GET' |
| | | title='查询知识库元数据列表' |
| | | name='#dataset_metadata_list' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Path |
| | | <Properties> |
| | | <Property name='dataset_id' type='string' key='dataset_id'> |
| | | 知识库 ID |
| | | </Property> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="GET" |
| | | label="/datasets/{dataset_id}/metadata" |
| | | targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/metadata' \\\n--header 'Authorization: Bearer {api_key}'`} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "doc_metadata": [ |
| | | { |
| | | "id": "", |
| | | "name": "name", |
| | | "type": "string", |
| | | "use_count": 0, |
| | | }, |
| | | ... |
| | | ], |
| | | "built_in_field_enabled": true |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |
| | | <Heading |
| | | url='/workspaces/current/models/model-types/text-embedding' |
| | | method='GET' |
| | | title='获取嵌入模型列表' |
| | | name='#model_type_list' |
| | | /> |
| | | <Row> |
| | | <Col> |
| | | ### Query |
| | | <Properties> |
| | | </Properties> |
| | | </Col> |
| | | <Col sticky> |
| | | <CodeGroup |
| | | title="Request" |
| | | tag="GET" |
| | | label="/datasets/{dataset_id}" |
| | | targetCode={`curl --location --location --request GET '${props.apiBaseUrl}/workspaces/current/models/model-types/text-embedding' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' `} |
| | | > |
| | | ```bash {{ title: 'cURL' }} |
| | | curl --location --request GET '${props.apiBaseUrl}/workspaces/current/models/model-types/text-embedding' \ |
| | | --header 'Authorization: Bearer {api_key}' \ |
| | | --header 'Content-Type: application/json' \ |
| | | ``` |
| | | </CodeGroup> |
| | | <CodeGroup title="Response"> |
| | | ```json {{ title: 'Response' }} |
| | | { |
| | | "data": [ |
| | | { |
| | | "provider": "zhipuai", |
| | | "label": { |
| | | "zh_Hans": "智谱 AI", |
| | | "en_US": "ZHIPU AI" |
| | | }, |
| | | "icon_small": { |
| | | "zh_Hans": "http://127.0.0.1:5001/console/api/workspaces/current/model-providers/zhipuai/icon_small/zh_Hans", |
| | | "en_US": "http://127.0.0.1:5001/console/api/workspaces/current/model-providers/zhipuai/icon_small/en_US" |
| | | }, |
| | | "icon_large": { |
| | | "zh_Hans": "http://127.0.0.1:5001/console/api/workspaces/current/model-providers/zhipuai/icon_large/zh_Hans", |
| | | "en_US": "http://127.0.0.1:5001/console/api/workspaces/current/model-providers/zhipuai/icon_large/en_US" |
| | | }, |
| | | "status": "active", |
| | | "models": [ |
| | | { |
| | | "model": "embedding-3", |
| | | "label": { |
| | | "zh_Hans": "embedding-3", |
| | | "en_US": "embedding-3" |
| | | }, |
| | | "model_type": "text-embedding", |
| | | "features": null, |
| | | "fetch_from": "predefined-model", |
| | | "model_properties": { |
| | | "context_size": 8192 |
| | | }, |
| | | "deprecated": false, |
| | | "status": "active", |
| | | "load_balancing_enabled": false |
| | | }, |
| | | { |
| | | "model": "embedding-2", |
| | | "label": { |
| | | "zh_Hans": "embedding-2", |
| | | "en_US": "embedding-2" |
| | | }, |
| | | "model_type": "text-embedding", |
| | | "features": null, |
| | | "fetch_from": "predefined-model", |
| | | "model_properties": { |
| | | "context_size": 8192 |
| | | }, |
| | | "deprecated": false, |
| | | "status": "active", |
| | | "load_balancing_enabled": false |
| | | }, |
| | | { |
| | | "model": "text_embedding", |
| | | "label": { |
| | | "zh_Hans": "text_embedding", |
| | | "en_US": "text_embedding" |
| | | }, |
| | | "model_type": "text-embedding", |
| | | "features": null, |
| | | "fetch_from": "predefined-model", |
| | | "model_properties": { |
| | | "context_size": 512 |
| | | }, |
| | | "deprecated": false, |
| | | "status": "active", |
| | | "load_balancing_enabled": false |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | </CodeGroup> |
| | | </Col> |
| | | </Row> |
| | | |
| | | <hr className='ml-0 mr-0' /> |
| | | |