Skip to content

Commit b4e6fe4

Browse files
✨Feat:Enhance prompt optimization by integrating openjiuwen and fix related bugs (#3190)
* ✨Feat:add prompt optimization * 🐛Bugfix: dockerbuild failed when running pipefail in python3_11 * 🔨Optimize: Optimize prompt optimization display page and interaction methods * 🐛Bugfix: fix dependencies replication * 🎨:Optimize frontend prompts and loading interface * 🔧 Refactor: Update imports and remove redundant ENABLE_JIUWEN_SDK import in prompt_service.py * 🔧 Refactor: Correct import path for NexentCapabilityError and enhance test coverage for prompt optimization service * 🔧 Refactor: Update import paths for exception handling and improve logging formatting in prompt_service.py * 🔧 Refactor: Simplify lazy imports in jiuwen_sdk_adapter.py and update import paths in prompt_service.py * 🔧 Refactor: Enhance Jiuwen SDK adapter handling and improve test stubs in prompt_service.py and related test files * 🧪test:Pydantic model for PromptTemplateRequest in test_prompt_template_app.py * 🔧 Refactor: Remove unnecessary dependency exclusions from pyproject.toml * 🔧 Update: Upgrade huggingface_hub dependency version in pyproject.toml * 🔧 Update: Exclude unnecessary transitive dependencies and adjust huggingface_hub version in pyproject.toml * 🔧 Test: Add mock modules for unstructured inference and set up package paths in test files * 🔧 Test: Enhance test setup by adding optional SDK mocks and cleaning up module imports in data processing tests * 🔧 Test: Consolidate mock module setup for unstructured inference across multiple test files * 🔧 Test: Remove unused optional SDK mocks from test configuration * 🔧 Refactor: Clean up imports and enhance dynamic loading of fastmcp components in Docker client * 📦update:sdk dependence update
1 parent 9de2bd5 commit b4e6fe4

40 files changed

Lines changed: 2515 additions & 194 deletions

.github/workflows/auto-unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up Python
3737
uses: actions/setup-python@v4
3838
with:
39-
python-version: '3.10'
39+
python-version: '3.11'
4040

4141
- name: Install uv
4242
run: pip install --upgrade uv

.github/workflows/sdk_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Python
2222
uses: actions/setup-python@v5
2323
with:
24-
python-version: '3.10'
24+
python-version: '3.11'
2525

2626
- name: Install build dependencies
2727
run: |

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,6 @@ sdk/benchmark/.env
6464
.venv
6565

6666
.pytest-tmp
67-
doc/mermaid
67+
doc/mermaid
68+
69+
.claude/skills/python-import-triage

backend/adapters/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from adapters.exception import JiuwenSDKError, JiuwenSDKUnavailableError, NexentCapabilityError
2+
3+
try:
4+
from adapters.jiuwen_sdk_adapter import JiuwenSDKAdapter
5+
except ModuleNotFoundError:
6+
JiuwenSDKAdapter = None # type: ignore[assignment, misc]
7+
8+
__all__ = [
9+
"JiuwenSDKError",
10+
"JiuwenSDKUnavailableError",
11+
"NexentCapabilityError",
12+
"JiuwenSDKAdapter",
13+
]

backend/adapters/exception.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class JiuwenSDKError(Exception):
2+
"""Jiuwen SDK 调用失败的通用异常"""
3+
pass
4+
5+
6+
class JiuwenSDKUnavailableError(JiuwenSDKError):
7+
"""Jiuwen SDK 不可用(依赖缺失或未启用)"""
8+
pass
9+
10+
11+
class NexentCapabilityError(Exception):
12+
"""nexent 原生模式不支持该能力"""
13+
pass

0 commit comments

Comments
 (0)