diff --git a/docreader/splitter/splitter.py b/docreader/splitter/splitter.py index abb4851b..c3c7128f 100644 --- a/docreader/splitter/splitter.py +++ b/docreader/splitter/splitter.py @@ -198,8 +198,6 @@ class TextSplitter(BaseModel, Generic[T]): # handle the last chunk assert cur_chunk - if cur_headers and cur_len < self.chunk_size: - cur_chunk.insert(0, (cur_chunk[0][0], cur_chunk[0][1], cur_headers)) chunks.append( ( cur_chunk[0][0], diff --git a/docs/API.md b/docs/API.md index cb83625c..e4c03e25 100644 --- a/docs/API.md +++ b/docs/API.md @@ -334,7 +334,6 @@ curl --location 'http://localhost:8080/api/v1/tenants' \ | GET | `/knowledge-bases/:id` | 获取知识库详情 | | PUT | `/knowledge-bases/:id` | 更新知识库 | | DELETE | `/knowledge-bases/:id` | 删除知识库 | -| GET | `/knowledge-bases/:id/hybrid-search` | 混合搜索知识库内容 | | POST | `/knowledge-bases/copy` | 拷贝知识库 | #### POST `/knowledge-bases` - 创建知识库 @@ -641,51 +640,6 @@ curl --location --request DELETE 'http://localhost:8080/api/v1/knowledge-bases/b } ``` -#### GET `/knowledge-bases/:id/hybrid-search` - 混合搜索知识库内容 - -**请求**: - -```curl -curl --location --request GET 'http://localhost:8080/api/v1/knowledge-bases/kb-00000001/hybrid-search' \ ---header 'Content-Type: application/json' \ ---header 'X-API-Key: sk-vQHV2NZI_LK5W7wHQvH3yGYExX8YnhaHwZipUYbiZKCYJbBQ' \ ---data '{ - "query_text": "彗星", - "vector_threshold": 0.1, - "keyword_threshold": 0.1, - "match_count": 1 -}' -``` - -**响应**: - -```json -{ - "data": [ - { - "id": "7d955251-3f79-4fd5-a6aa-02f81e044091", - "content": "有几位后来xxxxx", - "knowledge_id": "a6790b93-4700-4676-bd48-0d4804e1456b", - "chunk_index": 3, - "knowledge_title": "彗星.txt", - "start_at": 2287, - "end_at": 2760, - "seq": 3, - "score": 0.7402352891601821, - "match_type": 2, - "sub_chunk_id": null, - "metadata": {}, - "chunk_type": "text", - "parent_chunk_id": "", - "image_info": "", - "knowledge_filename": "彗星.txt", - "knowledge_source": "" - } - ], - "success": true -} -``` -
### 知识管理API