Редактировать roles.py

This commit is contained in:
Markov Andrey
2026-06-30 21:03:33 +00:00
parent 78a9239d9e
commit 8ea5bc7f1f

View File

@@ -60,8 +60,6 @@ class MethodologistAgent(BaseAgent):
history: List[Dict[str, str]], history: List[Dict[str, str]],
tools: Optional[List[Dict[str, Any]]] = None, tools: Optional[List[Dict[str, Any]]] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
# Формируем промпт с учётом системного промпта и контекста
# Здесь можно использовать prompt_builder, но для простоты составим вручную
messages = [] messages = []
if self.system_prompt: if self.system_prompt:
messages.append({"role": "system", "content": self.system_prompt}) messages.append({"role": "system", "content": self.system_prompt})
@@ -71,12 +69,11 @@ class MethodologistAgent(BaseAgent):
try: try:
response = await self.giga.chat( response = await self.giga.chat(
history=messages, history=messages,
query="", # уже включено в history query="",
system_prompt=None, system_prompt=None,
file_id=None, file_id=None,
temperature=self.temperature, temperature=self.temperature,
) )
# В простейшем случае возвращаем ответ как финальный
return {"type": "answer", "content": response} return {"type": "answer", "content": response}
except Exception as e: except Exception as e:
logger.error(f"Ошибка в MethodologistAgent: {e}") logger.error(f"Ошибка в MethodologistAgent: {e}")
@@ -123,7 +120,6 @@ class PersonalAssistantAgent(BaseAgent):
history: List[Dict[str, str]], history: List[Dict[str, str]],
tools: Optional[List[Dict[str, Any]]] = None, tools: Optional[List[Dict[str, Any]]] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
# Для персонального ассистента можно использовать ReAct или просто генерацию
messages = [] messages = []
if self.system_prompt: if self.system_prompt:
messages.append({"role": "system", "content": self.system_prompt}) messages.append({"role": "system", "content": self.system_prompt})