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.
Files changed (62) hide show
  1. agno/agent/agent.py +134 -82
  2. agno/db/mysql/__init__.py +2 -1
  3. agno/db/mysql/async_mysql.py +2888 -0
  4. agno/db/mysql/mysql.py +17 -8
  5. agno/db/mysql/utils.py +139 -6
  6. agno/db/postgres/async_postgres.py +10 -5
  7. agno/db/postgres/postgres.py +7 -2
  8. agno/db/schemas/evals.py +1 -0
  9. agno/db/singlestore/singlestore.py +5 -1
  10. agno/db/sqlite/async_sqlite.py +2 -2
  11. agno/eval/__init__.py +10 -0
  12. agno/eval/agent_as_judge.py +860 -0
  13. agno/eval/base.py +29 -0
  14. agno/eval/utils.py +2 -1
  15. agno/exceptions.py +7 -0
  16. agno/knowledge/embedder/openai.py +8 -8
  17. agno/knowledge/knowledge.py +1142 -176
  18. agno/media.py +22 -6
  19. agno/models/aws/claude.py +8 -7
  20. agno/models/base.py +27 -1
  21. agno/models/deepseek/deepseek.py +67 -0
  22. agno/models/google/gemini.py +65 -11
  23. agno/models/google/utils.py +22 -0
  24. agno/models/message.py +2 -0
  25. agno/models/openai/chat.py +4 -0
  26. agno/os/app.py +64 -74
  27. agno/os/interfaces/a2a/router.py +3 -4
  28. agno/os/interfaces/agui/router.py +2 -0
  29. agno/os/router.py +3 -1607
  30. agno/os/routers/agents/__init__.py +3 -0
  31. agno/os/routers/agents/router.py +581 -0
  32. agno/os/routers/agents/schema.py +261 -0
  33. agno/os/routers/evals/evals.py +26 -6
  34. agno/os/routers/evals/schemas.py +34 -2
  35. agno/os/routers/evals/utils.py +101 -20
  36. agno/os/routers/knowledge/knowledge.py +1 -1
  37. agno/os/routers/teams/__init__.py +3 -0
  38. agno/os/routers/teams/router.py +496 -0
  39. agno/os/routers/teams/schema.py +257 -0
  40. agno/os/routers/workflows/__init__.py +3 -0
  41. agno/os/routers/workflows/router.py +545 -0
  42. agno/os/routers/workflows/schema.py +75 -0
  43. agno/os/schema.py +1 -559
  44. agno/os/utils.py +139 -2
  45. agno/team/team.py +73 -16
  46. agno/tools/file_generation.py +12 -6
  47. agno/tools/firecrawl.py +15 -7
  48. agno/utils/hooks.py +64 -5
  49. agno/utils/http.py +2 -2
  50. agno/utils/media.py +11 -1
  51. agno/utils/print_response/agent.py +8 -0
  52. agno/utils/print_response/team.py +8 -0
  53. agno/vectordb/pgvector/pgvector.py +88 -51
  54. agno/workflow/parallel.py +3 -3
  55. agno/workflow/step.py +14 -2
  56. agno/workflow/types.py +38 -2
  57. agno/workflow/workflow.py +12 -4
  58. {agno-2.3.8.dist-info → agno-2.3.9.dist-info}/METADATA +7 -2
  59. {agno-2.3.8.dist-info → agno-2.3.9.dist-info}/RECORD +62 -49
  60. {agno-2.3.8.dist-info → agno-2.3.9.dist-info}/WHEEL +0 -0
  61. {agno-2.3.8.dist-info → agno-2.3.9.dist-info}/licenses/LICENSE +0 -0
  62. {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 logger
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
- logger.warning(e)
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
- logger.warning(e)
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
- logger.warning(e)
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
- logger.warning(e)
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
- logger.info(f"Getting embeddings and usage for {len(texts)} texts in batches of {self.batch_size} (async)")
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
- logger.warning(f"Error in async batch embedding: {e}")
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
- logger.warning(f"Error in individual async embedding fallback: {e2}")
191
+ log_warning(f"Error in individual async embedding fallback: {e2}")
192
192
  all_embeddings.append([])
193
193
  all_usage.append(None)
194
194