agno 2.1.3__py3-none-any.whl → 2.1.5__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 (94) hide show
  1. agno/agent/agent.py +1779 -577
  2. agno/db/async_postgres/__init__.py +3 -0
  3. agno/db/async_postgres/async_postgres.py +1668 -0
  4. agno/db/async_postgres/schemas.py +124 -0
  5. agno/db/async_postgres/utils.py +289 -0
  6. agno/db/base.py +237 -2
  7. agno/db/dynamo/dynamo.py +10 -8
  8. agno/db/dynamo/schemas.py +1 -10
  9. agno/db/dynamo/utils.py +2 -2
  10. agno/db/firestore/firestore.py +2 -2
  11. agno/db/firestore/utils.py +4 -2
  12. agno/db/gcs_json/gcs_json_db.py +2 -2
  13. agno/db/in_memory/in_memory_db.py +2 -2
  14. agno/db/json/json_db.py +2 -2
  15. agno/db/migrations/v1_to_v2.py +30 -13
  16. agno/db/mongo/mongo.py +18 -6
  17. agno/db/mysql/mysql.py +35 -13
  18. agno/db/postgres/postgres.py +29 -6
  19. agno/db/redis/redis.py +2 -2
  20. agno/db/singlestore/singlestore.py +2 -2
  21. agno/db/sqlite/sqlite.py +34 -12
  22. agno/db/sqlite/utils.py +8 -3
  23. agno/eval/accuracy.py +50 -43
  24. agno/eval/performance.py +6 -3
  25. agno/eval/reliability.py +6 -3
  26. agno/eval/utils.py +33 -16
  27. agno/exceptions.py +8 -2
  28. agno/knowledge/embedder/fastembed.py +1 -1
  29. agno/knowledge/knowledge.py +260 -46
  30. agno/knowledge/reader/pdf_reader.py +4 -6
  31. agno/knowledge/reader/reader_factory.py +2 -3
  32. agno/memory/manager.py +241 -33
  33. agno/models/anthropic/claude.py +37 -0
  34. agno/os/app.py +15 -10
  35. agno/os/interfaces/a2a/router.py +3 -5
  36. agno/os/interfaces/agui/router.py +4 -1
  37. agno/os/interfaces/agui/utils.py +33 -6
  38. agno/os/interfaces/slack/router.py +2 -4
  39. agno/os/mcp.py +98 -41
  40. agno/os/router.py +23 -0
  41. agno/os/routers/evals/evals.py +52 -20
  42. agno/os/routers/evals/utils.py +14 -14
  43. agno/os/routers/knowledge/knowledge.py +130 -9
  44. agno/os/routers/knowledge/schemas.py +57 -0
  45. agno/os/routers/memory/memory.py +116 -44
  46. agno/os/routers/metrics/metrics.py +16 -6
  47. agno/os/routers/session/session.py +65 -22
  48. agno/os/schema.py +38 -0
  49. agno/os/utils.py +69 -13
  50. agno/reasoning/anthropic.py +80 -0
  51. agno/reasoning/gemini.py +73 -0
  52. agno/reasoning/openai.py +5 -0
  53. agno/reasoning/vertexai.py +76 -0
  54. agno/session/workflow.py +69 -1
  55. agno/team/team.py +934 -241
  56. agno/tools/function.py +36 -18
  57. agno/tools/google_drive.py +270 -0
  58. agno/tools/googlesheets.py +20 -5
  59. agno/tools/mcp_toolbox.py +3 -3
  60. agno/tools/scrapegraph.py +1 -1
  61. agno/utils/models/claude.py +3 -1
  62. agno/utils/print_response/workflow.py +112 -12
  63. agno/utils/streamlit.py +1 -1
  64. agno/vectordb/base.py +22 -1
  65. agno/vectordb/cassandra/cassandra.py +9 -0
  66. agno/vectordb/chroma/chromadb.py +26 -6
  67. agno/vectordb/clickhouse/clickhousedb.py +9 -1
  68. agno/vectordb/couchbase/couchbase.py +11 -0
  69. agno/vectordb/lancedb/lance_db.py +20 -0
  70. agno/vectordb/langchaindb/langchaindb.py +11 -0
  71. agno/vectordb/lightrag/lightrag.py +9 -0
  72. agno/vectordb/llamaindex/llamaindexdb.py +15 -1
  73. agno/vectordb/milvus/milvus.py +23 -0
  74. agno/vectordb/mongodb/mongodb.py +22 -0
  75. agno/vectordb/pgvector/pgvector.py +19 -0
  76. agno/vectordb/pineconedb/pineconedb.py +35 -4
  77. agno/vectordb/qdrant/qdrant.py +24 -0
  78. agno/vectordb/singlestore/singlestore.py +25 -17
  79. agno/vectordb/surrealdb/surrealdb.py +18 -1
  80. agno/vectordb/upstashdb/upstashdb.py +26 -1
  81. agno/vectordb/weaviate/weaviate.py +18 -0
  82. agno/workflow/condition.py +29 -0
  83. agno/workflow/loop.py +29 -0
  84. agno/workflow/parallel.py +141 -113
  85. agno/workflow/router.py +29 -0
  86. agno/workflow/step.py +146 -25
  87. agno/workflow/steps.py +29 -0
  88. agno/workflow/types.py +26 -1
  89. agno/workflow/workflow.py +507 -22
  90. {agno-2.1.3.dist-info → agno-2.1.5.dist-info}/METADATA +100 -41
  91. {agno-2.1.3.dist-info → agno-2.1.5.dist-info}/RECORD +94 -86
  92. {agno-2.1.3.dist-info → agno-2.1.5.dist-info}/WHEEL +0 -0
  93. {agno-2.1.3.dist-info → agno-2.1.5.dist-info}/licenses/LICENSE +0 -0
  94. {agno-2.1.3.dist-info → agno-2.1.5.dist-info}/top_level.txt +0 -0
agno/session/workflow.py CHANGED
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import time
4
4
  from dataclasses import dataclass
5
- from typing import Any, Dict, List, Mapping, Optional
5
+ from typing import Any, Dict, List, Mapping, Optional, Tuple
6
6
 
7
7
  from agno.run.workflow import WorkflowRunOutput
8
8
  from agno.utils.log import logger
@@ -75,6 +75,74 @@ class WorkflowSession:
75
75
  else:
76
76
  self.runs.append(run)
77
77
 
78
+ def get_workflow_history(self, num_runs: Optional[int] = None) -> List[Tuple[str, str]]:
79
+ """Get workflow history as structured data (input, response pairs)
80
+
81
+ Args:
82
+ num_runs: Number of recent runs to include. If None, returns all available history.
83
+ """
84
+ if not self.runs:
85
+ return []
86
+
87
+ from agno.run.base import RunStatus
88
+
89
+ # Get completed runs only (exclude current/pending run)
90
+ completed_runs = [run for run in self.runs if run.status == RunStatus.completed]
91
+
92
+ if num_runs is not None and len(completed_runs) > num_runs:
93
+ recent_runs = completed_runs[-num_runs:]
94
+ else:
95
+ recent_runs = completed_runs
96
+
97
+ if not recent_runs:
98
+ return []
99
+
100
+ # Return structured data as list of (input, response) tuples
101
+ history_data = []
102
+ for run in recent_runs:
103
+ # Get input
104
+ input_str = ""
105
+ if run.input:
106
+ input_str = str(run.input) if not isinstance(run.input, str) else run.input
107
+
108
+ # Get response
109
+ response_str = ""
110
+ if run.content:
111
+ response_str = str(run.content) if not isinstance(run.content, str) else run.content
112
+
113
+ history_data.append((input_str, response_str))
114
+
115
+ return history_data
116
+
117
+ def get_workflow_history_context(self, num_runs: Optional[int] = None) -> Optional[str]:
118
+ """Get formatted workflow history context for steps
119
+
120
+ Args:
121
+ num_runs: Number of recent runs to include. If None, returns all available history.
122
+ """
123
+ history_data = self.get_workflow_history(num_runs)
124
+
125
+ if not history_data:
126
+ return None
127
+
128
+ # Format as workflow context using the structured data
129
+ context_parts = ["<workflow_history_context>"]
130
+
131
+ for i, (input_str, response_str) in enumerate(history_data, 1):
132
+ context_parts.append(f"[run-{i}]")
133
+
134
+ if input_str:
135
+ context_parts.append(f"input: {input_str}")
136
+ if response_str:
137
+ context_parts.append(f"response: {response_str}")
138
+
139
+ context_parts.append("") # Empty line between runs
140
+
141
+ context_parts.append("</workflow_history_context>")
142
+ context_parts.append("") # Empty line before current input
143
+
144
+ return "\n".join(context_parts)
145
+
78
146
  def to_dict(self) -> Dict[str, Any]:
79
147
  """Convert to dictionary for storage, serializing runs to dicts"""
80
148