Skip to content

feat(knowledgebase): add ots query#71

Merged
OhYee merged 1 commit intomainfrom
add-ots-kb
Mar 19, 2026
Merged

feat(knowledgebase): add ots query#71
OhYee merged 1 commit intomainfrom
add-ots-kb

Conversation

@Sodawyx
Copy link
Collaborator

@Sodawyx Sodawyx commented Mar 18, 2026

添加OTSDataAPI及相关模型配置类,扩展知识库功能支持表格存储数据源。更新依赖版本并完善相关模板文件。

Co-developed-by: Aone Copilot noreply@alibaba-inc.com

Thank you for creating a pull request to contribute to Serverless Devs agentrun-sdk-python code! Before you open the request please answer the following questions to help it be more easily integrated. Please check the boxes "[ ]" with "[x]" when done too.
Please select one of the PR types below to complete


Fix bugs

Bug detail

The specific manifestation of the bug or the associated issue.

Pull request tasks

  • Add test cases for the changes
  • Passed the CI test

Update docs

Reason for update

Why do you need to update your documentation?

Pull request tasks

  • Update Chinese documentation
  • Update English documentation

Add contributor

Contributed content

  • Code
  • Document

Content detail

if content_type == 'code' || content_type == 'document':
    please tell us `PR url`,like: https://github.com/Serverless-Devs/agentrun-sdk-python/pull/1
else:
    please describe your contribution in detail

Others

Reason for update

Why do you need to update your documentation?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for OTS (Alibaba TableStore) as a new knowledge base provider to the AgentRun SDK. The implementation follows the existing patterns established for other providers (Bailian, RagFlow, ADB) and adds comprehensive configuration, retrieval, and example code for the new OTS provider.

Changes:

  • Added OTS provider support with comprehensive configuration models including metadata fields, embedding configuration, and multiple search/reranking modes
  • Implemented OTSDataAPI class with support for dense vector search, full-text search, and hybrid search with RRF/Weight/Model reranking strategies
  • Added complete example functions demonstrating OTS knowledge base creation, querying, updating, and deletion
  • Updated all necessary exports and imports across the module hierarchy
  • Added new dependency: tablestore-agent-storage>=1.0.4

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml Added tablestore-agent-storage dependency
agentrun/knowledgebase/model.py Added OTS configuration models (provider settings, embedding config, search configs, reranking configs)
agentrun/knowledgebase/knowledgebase.py Added OTS settings conversion logic for camelCase to snake_case transformation
agentrun/knowledgebase/api/data.py Implemented OTSDataAPI class with retrieve methods and configuration building
agentrun/knowledgebase/api/__data_async_template.py Added OTS async template implementation
agentrun/knowledgebase/api/init.py Exported OTSDataAPI
agentrun/knowledgebase/init.py Exported all OTS-related classes and models
agentrun/knowledgebase/__knowledgebase_async_template.py Added OTS settings conversion in async template
examples/knowledgebase.py Added complete OTS example functions and updated documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

添加OTSDataAPI及相关模型配置类,扩展知识库功能支持表格存储数据源。更新依赖版本并完善相关模板文件。

Co-developed-by: Aone Copilot <noreply@alibaba-inc.com>
Signed-off-by: Sodawyx <sodawyx@126.com>
@OhYee OhYee merged commit 9d25918 into main Mar 19, 2026
2 checks passed
@OhYee OhYee deleted the add-ots-kb branch March 19, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants