Repository navigation
feat: 新增独立 knowledge_runtime 服务支持 RAG 远程调用 #1001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7575b11
feat(shared): 导出 ContentRef 类型供 knowledge_runtime 使用
sunnights 0216e1c
feat(knowledge_runtime): 新增独立 RAG HTTP 服务
sunnights 6f8a37b
refactor(backend/rag): 重构 RAG 服务支持远程调用
sunnights 254ad33
feat(knowledge_runtime): 添加 docker 部署支持和架构文档
sunnights 92193e5
test(backend/rag): 修复 RAG 测试以匹配重构后的实现
sunnights 1fd834b
feat(knowledge_runtime): 添加 TOKEN 认证机制
sunnights 44fc8ea
refactor(config): 统一内部服务认证 token 为 INTERNAL_SERVICE_TOKEN
sunnights 58e573f
feat(knowledge_runtime): 添加部署配置并将服务加入 rag profile
sunnights f043c64
Merge remote-tracking branch 'wecode-ai/main' into zy_knowledge_runtime
sunnights 61dea3e
Merge remote-tracking branch 'wecode-ai/main' into zy_knowledge_runtime
sunnights c47abc1
fix(knowledge_runtime): 修复测试 mock、启动脚本路径解析及重试逻辑
sunnights c3b0d15
fix(knowledge_runtime): 改进异常处理、添加追踪并修复测试
sunnights 085d0bc
fix(knowledge_runtime): test_connection 使用 asyncio.to_thread 避免阻塞事件循环
sunnights File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # SPDX-FileCopyrightText: 2026 Weibo, Inc. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| FROM ghcr.io/wecode-ai/wegent-base-python3.12:latest | ||
|
|
||
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
| # Copy and install shared module first | ||
| COPY shared /app/shared | ||
| RUN uv pip install --system --no-cache /app/shared | ||
|
|
||
| # Copy and install knowledge_engine module | ||
| COPY knowledge_engine /app/knowledge_engine | ||
| RUN uv pip install --system --no-cache /app/knowledge_engine | ||
|
|
||
| # Copy pyproject.toml and install dependencies | ||
| # Remove [tool.uv.sources] section as dependencies are already installed | ||
| COPY knowledge_runtime/pyproject.toml . | ||
| RUN sed -i '/\[tool\.uv\.sources\]/,/^$/d' pyproject.toml && \ | ||
| uv pip install --system --no-cache -r pyproject.toml | ||
|
|
||
| # Copy application code | ||
| COPY knowledge_runtime/knowledge_runtime /app/knowledge_runtime | ||
|
|
||
| # Environment variables | ||
| ENV PORT=8200 | ||
| ENV HOST=0.0.0.0 | ||
|
|
||
| # Create log directory | ||
| RUN mkdir -p /app/logs | ||
|
|
||
| # Expose port | ||
| EXPOSE ${PORT} | ||
|
|
||
| # Health check | ||
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | ||
| CMD curl -f http://localhost:${PORT}/internal/rag/health || exit 1 | ||
|
|
||
| # Start command | ||
| CMD ["sh", "-c", "exec uvicorn knowledge_runtime.main:app --host ${HOST} --port ${PORT}"] | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.