agno 2.3.8__py3-none-any.whl → 2.3.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agno/agent/agent.py +134 -82
- agno/db/mysql/__init__.py +2 -1
- agno/db/mysql/async_mysql.py +2888 -0
- agno/db/mysql/mysql.py +17 -8
- agno/db/mysql/utils.py +139 -6
- agno/db/postgres/async_postgres.py +10 -5
- agno/db/postgres/postgres.py +7 -2
- agno/db/schemas/evals.py +1 -0
- agno/db/singlestore/singlestore.py +5 -1
- agno/db/sqlite/async_sqlite.py +2 -2
- agno/eval/__init__.py +10 -0
- agno/eval/agent_as_judge.py +860 -0
- agno/eval/base.py +29 -0
- agno/eval/utils.py +2 -1
- agno/exceptions.py +7 -0
- agno/knowledge/embedder/openai.py +8 -8
- agno/knowledge/knowledge.py +1142 -176
- agno/media.py +22 -6
- agno/models/aws/claude.py +8 -7
- agno/models/base.py +27 -1
- agno/models/deepseek/deepseek.py +67 -0
- agno/models/google/gemini.py +65 -11
- agno/models/google/utils.py +22 -0
- agno/models/message.py +2 -0
- agno/models/openai/chat.py +4 -0
- agno/os/app.py +64 -74
- agno/os/interfaces/a2a/router.py +3 -4
- agno/os/interfaces/agui/router.py +2 -0
- agno/os/router.py +3 -1607
- agno/os/routers/agents/__init__.py +3 -0
- agno/os/routers/agents/router.py +581 -0
- agno/os/routers/agents/schema.py +261 -0
- agno/os/routers/evals/evals.py +26 -6
- agno/os/routers/evals/schemas.py +34 -2
- agno/os/routers/evals/utils.py +101 -20
- agno/os/routers/knowledge/knowledge.py +1 -1
- agno/os/routers/teams/__init__.py +3 -0
- agno/os/routers/teams/router.py +496 -0
- agno/os/routers/teams/schema.py +257 -0
- agno/os/routers/workflows/__init__.py +3 -0
- agno/os/routers/workflows/router.py +545 -0
- agno/os/routers/workflows/schema.py +75 -0
- agno/os/schema.py +1 -559
- agno/os/utils.py +139 -2
- agno/team/team.py +73 -16
- agno/tools/file_generation.py +12 -6
- agno/tools/firecrawl.py +15 -7
- agno/utils/hooks.py +64 -5
- agno/utils/http.py +2 -2
- agno/utils/media.py +11 -1
- agno/utils/print_response/agent.py +8 -0
- agno/utils/print_response/team.py +8 -0
- agno/vectordb/pgvector/pgvector.py +88 -51
- agno/workflow/parallel.py +3 -3
- agno/workflow/step.py +14 -2
- agno/workflow/types.py +38 -2
- agno/workflow/workflow.py +12 -4
- {agno-2.3.8.dist-info → agno-2.3.9.dist-info}/METADATA +7 -2
- {agno-2.3.8.dist-info → agno-2.3.9.dist-info}/RECORD +62 -49
- {agno-2.3.8.dist-info → agno-2.3.9.dist-info}/WHEEL +0 -0
- {agno-2.3.8.dist-info → agno-2.3.9.dist-info}/licenses/LICENSE +0 -0
- {agno-2.3.8.dist-info → agno-2.3.9.dist-info}/top_level.txt +0 -0
agno/eval/base.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Union
|
|
3
|
+
|
|
4
|
+
from agno.run.agent import RunInput, RunOutput
|
|
5
|
+
from agno.run.team import TeamRunInput, TeamRunOutput
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BaseEval(ABC):
|
|
9
|
+
"""Abstract base class for all evaluations."""
|
|
10
|
+
|
|
11
|
+
@abstractmethod
|
|
12
|
+
def pre_check(self, run_input: Union[RunInput, TeamRunInput]) -> None:
|
|
13
|
+
"""Perform sync pre-evals."""
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
@abstractmethod
|
|
17
|
+
async def async_pre_check(self, run_input: Union[RunInput, TeamRunInput]) -> None:
|
|
18
|
+
"""Perform async pre-evals."""
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
@abstractmethod
|
|
22
|
+
def post_check(self, run_output: Union[RunOutput, TeamRunOutput]) -> None:
|
|
23
|
+
"""Perform sync post-evals."""
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
@abstractmethod
|
|
27
|
+
async def async_post_check(self, run_output: Union[RunOutput, TeamRunOutput]) -> None:
|
|
28
|
+
"""Perform async post-evals."""
|
|
29
|
+
pass
|
agno/eval/utils.py
CHANGED
|
@@ -8,6 +8,7 @@ from agno.utils.log import log_debug, logger
|
|
|
8
8
|
|
|
9
9
|
if TYPE_CHECKING:
|
|
10
10
|
from agno.eval.accuracy import AccuracyResult
|
|
11
|
+
from agno.eval.agent_as_judge import AgentAsJudgeResult
|
|
11
12
|
from agno.eval.performance import PerformanceResult
|
|
12
13
|
from agno.eval.reliability import ReliabilityResult
|
|
13
14
|
|
|
@@ -103,7 +104,7 @@ async def async_log_eval(
|
|
|
103
104
|
|
|
104
105
|
def store_result_in_file(
|
|
105
106
|
file_path: str,
|
|
106
|
-
result: Union["AccuracyResult", "PerformanceResult", "ReliabilityResult"],
|
|
107
|
+
result: Union["AccuracyResult", "AgentAsJudgeResult", "PerformanceResult", "ReliabilityResult"],
|
|
107
108
|
eval_id: Optional[str] = None,
|
|
108
109
|
name: Optional[str] = None,
|
|
109
110
|
):
|
agno/exceptions.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
1
2
|
from enum import Enum
|
|
2
3
|
from typing import Any, Dict, List, Optional, Union
|
|
3
4
|
|
|
@@ -170,3 +171,9 @@ class OutputCheckError(Exception):
|
|
|
170
171
|
self.message = message
|
|
171
172
|
self.check_trigger = check_trigger
|
|
172
173
|
self.additional_data = additional_data
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
@dataclass
|
|
177
|
+
class RetryableModelProviderError(Exception):
|
|
178
|
+
# Guidance message to retry a model invocation after an error
|
|
179
|
+
retry_guidance_message: Optional[str] = None
|
|
@@ -4,7 +4,7 @@ from typing import Any, Dict, List, Optional, Tuple
|
|
|
4
4
|
from typing_extensions import Literal
|
|
5
5
|
|
|
6
6
|
from agno.knowledge.embedder.base import Embedder
|
|
7
|
-
from agno.utils.log import
|
|
7
|
+
from agno.utils.log import log_warning, log_info
|
|
8
8
|
|
|
9
9
|
try:
|
|
10
10
|
from openai import AsyncOpenAI
|
|
@@ -82,7 +82,7 @@ class OpenAIEmbedder(Embedder):
|
|
|
82
82
|
response: CreateEmbeddingResponse = self.response(text=text)
|
|
83
83
|
return response.data[0].embedding
|
|
84
84
|
except Exception as e:
|
|
85
|
-
|
|
85
|
+
log_warning(e)
|
|
86
86
|
return []
|
|
87
87
|
|
|
88
88
|
def get_embedding_and_usage(self, text: str) -> Tuple[List[float], Optional[Dict]]:
|
|
@@ -95,7 +95,7 @@ class OpenAIEmbedder(Embedder):
|
|
|
95
95
|
return embedding, usage.model_dump()
|
|
96
96
|
return embedding, None
|
|
97
97
|
except Exception as e:
|
|
98
|
-
|
|
98
|
+
log_warning(e)
|
|
99
99
|
return [], None
|
|
100
100
|
|
|
101
101
|
async def async_get_embedding(self, text: str) -> List[float]:
|
|
@@ -115,7 +115,7 @@ class OpenAIEmbedder(Embedder):
|
|
|
115
115
|
response: CreateEmbeddingResponse = await self.aclient.embeddings.create(**req)
|
|
116
116
|
return response.data[0].embedding
|
|
117
117
|
except Exception as e:
|
|
118
|
-
|
|
118
|
+
log_warning(e)
|
|
119
119
|
return []
|
|
120
120
|
|
|
121
121
|
async def async_get_embedding_and_usage(self, text: str):
|
|
@@ -137,7 +137,7 @@ class OpenAIEmbedder(Embedder):
|
|
|
137
137
|
usage = response.usage
|
|
138
138
|
return embedding, usage.model_dump() if usage else None
|
|
139
139
|
except Exception as e:
|
|
140
|
-
|
|
140
|
+
log_warning(f"Error getting embedding: {e}")
|
|
141
141
|
return [], None
|
|
142
142
|
|
|
143
143
|
async def async_get_embeddings_batch_and_usage(
|
|
@@ -154,7 +154,7 @@ class OpenAIEmbedder(Embedder):
|
|
|
154
154
|
"""
|
|
155
155
|
all_embeddings = []
|
|
156
156
|
all_usage = []
|
|
157
|
-
|
|
157
|
+
log_info(f"Getting embeddings and usage for {len(texts)} texts in batches of {self.batch_size} (async)")
|
|
158
158
|
|
|
159
159
|
for i in range(0, len(texts), self.batch_size):
|
|
160
160
|
batch_texts = texts[i : i + self.batch_size]
|
|
@@ -180,7 +180,7 @@ class OpenAIEmbedder(Embedder):
|
|
|
180
180
|
usage_dict = response.usage.model_dump() if response.usage else None
|
|
181
181
|
all_usage.extend([usage_dict] * len(batch_embeddings))
|
|
182
182
|
except Exception as e:
|
|
183
|
-
|
|
183
|
+
log_warning(f"Error in async batch embedding: {e}")
|
|
184
184
|
# Fallback to individual calls for this batch
|
|
185
185
|
for text in batch_texts:
|
|
186
186
|
try:
|
|
@@ -188,7 +188,7 @@ class OpenAIEmbedder(Embedder):
|
|
|
188
188
|
all_embeddings.append(embedding)
|
|
189
189
|
all_usage.append(usage)
|
|
190
190
|
except Exception as e2:
|
|
191
|
-
|
|
191
|
+
log_warning(f"Error in individual async embedding fallback: {e2}")
|
|
192
192
|
all_embeddings.append([])
|
|
193
193
|
all_usage.append(None)
|
|
194
194
|
|