feat: add public wiki embeds and ES query routing
This commit is contained in:
1 parent
e818c24769
commit
bc49df4561
16 files changed
+704
-52
No files matched your search
@@ -5,8 +5,26 @@ from pydantic import BaseModel, Field
|
||||
|
||||
from deerflow.config.runtime_paths import project_root, resolve_path
|
||||
|
||||
|
||||
class SecurityScanConfig(BaseModel):
|
||||
DEFAULT_ES_QUERY_ROUTING_PROMPT = """当用户的问题需要基于 Elasticsearch 查询语句(Query DSL)灵活构造、调整或执行查询时,必须优先使用 `es_query` 技能。
|
||||
典型场景包括:根据用户条件动态组合 bool/must/filter/should、范围、聚合、排序或分页等 ES 查询;或者用户直接提供、要求修改 ES 语句并据此查询数据。
|
||||
执行前先读取 `es_query` 技能的 SKILL.md,严格按照技能中的流程和参数调用;不要用通用搜索替代,也不要凭记忆臆测查询结果。
|
||||
仅当问题确实需要 ES 数据查询时使用;纯概念解释、普通代码说明或与 ES 无关的问题不要调用。"""
|
||||
|
||||
|
||||
class EsQueryRoutingConfig(BaseModel):
|
||||
"""Prompt steering that routes flexible Elasticsearch queries to ``es_query``."""
|
||||
|
||||
enabled: bool = Field(
|
||||
default=False,
|
||||
description="Inject the es_query routing prompt into the agent system prompt.",
|
||||
)
|
||||
prompt: str = Field(
|
||||
default=DEFAULT_ES_QUERY_ROUTING_PROMPT,
|
||||
description="Editable system-prompt instructions for deciding when and how to use es_query.",
|
||||
)
|
||||
|
||||
|
||||
class SecurityScanConfig(BaseModel):
|
||||
"""Toggle for the LLM-based skill security scanner."""
|
||||
|
||||
enabled: bool = Field(
|
||||
@@ -33,10 +51,14 @@ class SkillsConfig(BaseModel):
|
||||
default="/mnt/skills",
|
||||
description="Path where skills are mounted in the sandbox container",
|
||||
)
|
||||
security_scan: SecurityScanConfig = Field(
|
||||
default_factory=SecurityScanConfig,
|
||||
description="LLM security-scan toggle for skill content.",
|
||||
)
|
||||
security_scan: SecurityScanConfig = Field(
|
||||
default_factory=SecurityScanConfig,
|
||||
description="LLM security-scan toggle for skill content.",
|
||||
)
|
||||
es_query_routing: EsQueryRoutingConfig = Field(
|
||||
default_factory=EsQueryRoutingConfig,
|
||||
description="Optional configurable routing prompt for the es_query skill.",
|
||||
)
|
||||
|
||||
def get_skills_path(self) -> Path:
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user