Phase6/7 runtime + Gitea smoke gate setup #1
@@ -1004,7 +1004,7 @@ async def agent_infer(agent_id: str, request: InferRequest):
|
||||
except:
|
||||
tool_args = {}
|
||||
|
||||
result = await tool_manager.execute_tool(tool_name, tool_args)
|
||||
result = await tool_manager.execute_tool(tool_name, tool_args, agent_id=request_agent_id)
|
||||
tool_result_dict = {
|
||||
"tool_call_id": tc.get("id", ""),
|
||||
"name": tool_name,
|
||||
|
||||
@@ -415,6 +415,39 @@ agents:
|
||||
- id: check_health
|
||||
type: builtin
|
||||
|
||||
|
||||
senpai:
|
||||
description: "SenpAI — Gordon Senpai, trading advisor"
|
||||
default_llm: cloud_deepseek
|
||||
system_prompt: |
|
||||
Ты — Гордон Сэнпай: советник по рынкам капитала и цифровым активам.
|
||||
Помогай мыслить как профессионал: строить систему, управлять риском, оценивать сценарии.
|
||||
tools:
|
||||
- id: web_search
|
||||
type: external
|
||||
endpoint: http://swapper-service:8890/web/search
|
||||
description: "Пошук ринкових даних"
|
||||
- id: web_extract
|
||||
type: external
|
||||
endpoint: http://swapper-service:8890/web/extract
|
||||
description: "Витягнути контент з URL"
|
||||
- id: vision
|
||||
type: llm
|
||||
model: qwen3-vl:8b
|
||||
description: "Аналіз графіків та скріншотів"
|
||||
|
||||
sofiia:
|
||||
description: "Sofiia — AI assistant for community management"
|
||||
default_llm: cloud_deepseek
|
||||
system_prompt: |
|
||||
Ти — Софія, AI-асистент для управління спільнотою DAARION.
|
||||
Допомагай з організацією, комунікаціями та координацією проектів.
|
||||
tools:
|
||||
- id: web_search
|
||||
type: external
|
||||
endpoint: http://swapper-service:8890/web/search
|
||||
description: "Пошук інформації"
|
||||
|
||||
# ============================================================================
|
||||
# Routing Rules
|
||||
# ============================================================================
|
||||
@@ -630,6 +663,23 @@ routing:
|
||||
use_context_prompt: true
|
||||
description: "Моніторинг інфраструктури"
|
||||
|
||||
|
||||
- id: senpai_agent
|
||||
priority: 5
|
||||
when:
|
||||
agent: senpai
|
||||
use_llm: cloud_deepseek
|
||||
use_context_prompt: true
|
||||
description: "SenpAI trading advisor - DeepSeek"
|
||||
|
||||
- id: sofiia_agent
|
||||
priority: 5
|
||||
when:
|
||||
agent: sofiia
|
||||
use_llm: cloud_deepseek
|
||||
use_context_prompt: true
|
||||
description: "Sofiia community assistant - DeepSeek"
|
||||
|
||||
- id: fallback_local
|
||||
priority: 100
|
||||
when: {}
|
||||
@@ -655,9 +705,3 @@ policies:
|
||||
audit_mode:
|
||||
enabled: false
|
||||
|
||||
senpai:
|
||||
description: "SenpAI — Gordon Senpai, trading advisor"
|
||||
default_llm: cloud_deepseek
|
||||
system_prompt: |
|
||||
Ты — Гордон Сэнпай: советник по рынкам капитала и цифровым активам.
|
||||
Помогай мыслить как профессионал: строить систему, управлять риском, оценивать сценарии.
|
||||
|
||||
@@ -351,9 +351,9 @@ class ToolManager:
|
||||
try:
|
||||
# Priority 1: Memory/Knowledge tools
|
||||
if tool_name == "memory_search":
|
||||
return await self._memory_search(arguments)
|
||||
return await self._memory_search(arguments, agent_id=agent_id)
|
||||
elif tool_name == "graph_query":
|
||||
return await self._graph_query(arguments)
|
||||
return await self._graph_query(arguments, agent_id=agent_id)
|
||||
# Priority 2: Web tools
|
||||
elif tool_name == "web_search":
|
||||
return await self._web_search(arguments)
|
||||
@@ -382,7 +382,7 @@ class ToolManager:
|
||||
logger.error(f"Tool execution failed: {e}")
|
||||
return ToolResult(success=False, result=None, error=str(e))
|
||||
|
||||
async def _memory_search(self, args: Dict) -> ToolResult:
|
||||
async def _memory_search(self, args: Dict, agent_id: str = None) -> ToolResult:
|
||||
"""Search in Qdrant vector memory using Router's memory_retrieval - PRIORITY 1"""
|
||||
query = args.get("query")
|
||||
|
||||
@@ -393,6 +393,7 @@ class ToolManager:
|
||||
if memory_retrieval and memory_retrieval.qdrant_client:
|
||||
results = await memory_retrieval.search_memories(
|
||||
query=query,
|
||||
agent_id=agent_id or helion,
|
||||
limit=5
|
||||
)
|
||||
|
||||
@@ -543,7 +544,7 @@ class ToolManager:
|
||||
except Exception as e:
|
||||
return ToolResult(success=False, result=None, error=str(e))
|
||||
|
||||
async def _graph_query(self, args: Dict) -> ToolResult:
|
||||
async def _graph_query(self, args: Dict, agent_id: str = None) -> ToolResult:
|
||||
"""Query knowledge graph"""
|
||||
query = args.get("query")
|
||||
entity_type = args.get("entity_type")
|
||||
|
||||
Reference in New Issue
Block a user