Taiga integration

This commit is contained in:
2026-06-09 12:47:13 +03:00
parent c8599b3d13
commit 1f83dcb574
30 changed files with 1543 additions and 115 deletions
+5 -2
View File
@@ -7,6 +7,7 @@ from sqlalchemy.orm import Session
from app.character.service import CharacterService
from app.chat.notices import format_pomodoro_context, format_pomodoro_notice
from app.projects.context import format_projects_context, get_projects_snapshot
from app.db.models import ChatSession, Message
from app.llm.client import LLMClient
from app.pomodoro.service import PomodoroService
@@ -45,9 +46,11 @@ class ChatService:
def _build_system_prompt(self) -> str:
status = PomodoroService(self.db).get_status()
projects_snapshot = get_projects_snapshot(self.db)
return (
f"{self.character.get_system_prompt()}\n\n"
f"{format_pomodoro_context(status)}"
f"{format_pomodoro_context(status)}\n\n"
f"{format_projects_context(projects_snapshot)}"
)
def _build_messages(self, session: ChatSession) -> list[dict[str, Any]]:
@@ -129,7 +132,7 @@ class ChatService:
for tool_call in tool_calls:
fn = tool_call["function"]
args = LLMClient.parse_tool_arguments(fn.get("arguments", ""))
result = execute_tool(self.db, fn["name"], args)
result = await execute_tool(self.db, fn["name"], args)
tool_message = {
"role": "tool",
"tool_call_id": tool_call["id"],