feat!: migrate to OpenAI native tool calls and fix circular deps (#fuck-gemini)
- Fix circular dependencies in agent/tools - Migrate from custom JSON to OpenAI tool calls format - Add async streaming (step_stream, complete_stream) - Simplify prompt system and remove token counting - Add 5 new API endpoints (/health, /v1/models, /api/memory/*) - Add 3 new tools (get_torrent_by_index, add_torrent_by_index, set_language) - Fix all 500 tests and add coverage config (80% threshold) - Add comprehensive docs (README, pytest guide) BREAKING: LLM interface changed, memory injection via get_memory()
This commit is contained in:
+16
-13
@@ -1,21 +1,23 @@
|
||||
"""Torrent application DTOs."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Optional, List, Dict, Any
|
||||
from typing import Any
|
||||
|
||||
|
||||
@dataclass
|
||||
class SearchTorrentsResponse:
|
||||
"""Response from searching for torrents."""
|
||||
|
||||
status: str
|
||||
torrents: Optional[List[Dict[str, Any]]] = None
|
||||
count: Optional[int] = None
|
||||
error: Optional[str] = None
|
||||
message: Optional[str] = None
|
||||
|
||||
torrents: list[dict[str, Any]] | None = None
|
||||
count: int | None = None
|
||||
error: str | None = None
|
||||
message: str | None = None
|
||||
|
||||
def to_dict(self):
|
||||
"""Convert to dict for agent compatibility."""
|
||||
result = {"status": self.status}
|
||||
|
||||
|
||||
if self.error:
|
||||
result["error"] = self.error
|
||||
result["message"] = self.message
|
||||
@@ -24,24 +26,25 @@ class SearchTorrentsResponse:
|
||||
result["torrents"] = self.torrents
|
||||
if self.count is not None:
|
||||
result["count"] = self.count
|
||||
|
||||
|
||||
return result
|
||||
|
||||
|
||||
@dataclass
|
||||
class AddTorrentResponse:
|
||||
"""Response from adding a torrent."""
|
||||
|
||||
status: str
|
||||
message: Optional[str] = None
|
||||
error: Optional[str] = None
|
||||
|
||||
message: str | None = None
|
||||
error: str | None = None
|
||||
|
||||
def to_dict(self):
|
||||
"""Convert to dict for agent compatibility."""
|
||||
result = {"status": self.status}
|
||||
|
||||
|
||||
if self.error:
|
||||
result["error"] = self.error
|
||||
if self.message:
|
||||
result["message"] = self.message
|
||||
|
||||
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user