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.
- agno/agent/agent.py +1779 -577
- agno/db/async_postgres/__init__.py +3 -0
- agno/db/async_postgres/async_postgres.py +1668 -0
- agno/db/async_postgres/schemas.py +124 -0
- agno/db/async_postgres/utils.py +289 -0
- agno/db/base.py +237 -2
- agno/db/dynamo/dynamo.py +10 -8
- agno/db/dynamo/schemas.py +1 -10
- agno/db/dynamo/utils.py +2 -2
- agno/db/firestore/firestore.py +2 -2
- agno/db/firestore/utils.py +4 -2
- agno/db/gcs_json/gcs_json_db.py +2 -2
- agno/db/in_memory/in_memory_db.py +2 -2
- agno/db/json/json_db.py +2 -2
- agno/db/migrations/v1_to_v2.py +30 -13
- agno/db/mongo/mongo.py +18 -6
- agno/db/mysql/mysql.py +35 -13
- agno/db/postgres/postgres.py +29 -6
- agno/db/redis/redis.py +2 -2
- agno/db/singlestore/singlestore.py +2 -2
- agno/db/sqlite/sqlite.py +34 -12
- agno/db/sqlite/utils.py +8 -3
- agno/eval/accuracy.py +50 -43
- agno/eval/performance.py +6 -3
- agno/eval/reliability.py +6 -3
- agno/eval/utils.py +33 -16
- agno/exceptions.py +8 -2
- agno/knowledge/embedder/fastembed.py +1 -1
- agno/knowledge/knowledge.py +260 -46
- agno/knowledge/reader/pdf_reader.py +4 -6
- agno/knowledge/reader/reader_factory.py +2 -3
- agno/memory/manager.py +241 -33
- agno/models/anthropic/claude.py +37 -0
- agno/os/app.py +15 -10
- agno/os/interfaces/a2a/router.py +3 -5
- agno/os/interfaces/agui/router.py +4 -1
- agno/os/interfaces/agui/utils.py +33 -6
- agno/os/interfaces/slack/router.py +2 -4
- agno/os/mcp.py +98 -41
- agno/os/router.py +23 -0
- agno/os/routers/evals/evals.py +52 -20
- agno/os/routers/evals/utils.py +14 -14
- agno/os/routers/knowledge/knowledge.py +130 -9
- agno/os/routers/knowledge/schemas.py +57 -0
- agno/os/routers/memory/memory.py +116 -44
- agno/os/routers/metrics/metrics.py +16 -6
- agno/os/routers/session/session.py +65 -22
- agno/os/schema.py +38 -0
- agno/os/utils.py +69 -13
- agno/reasoning/anthropic.py +80 -0
- agno/reasoning/gemini.py +73 -0
- agno/reasoning/openai.py +5 -0
- agno/reasoning/vertexai.py +76 -0
- agno/session/workflow.py +69 -1
- agno/team/team.py +934 -241
- agno/tools/function.py +36 -18
- agno/tools/google_drive.py +270 -0
- agno/tools/googlesheets.py +20 -5
- agno/tools/mcp_toolbox.py +3 -3
- agno/tools/scrapegraph.py +1 -1
- agno/utils/models/claude.py +3 -1
- agno/utils/print_response/workflow.py +112 -12
- agno/utils/streamlit.py +1 -1
- agno/vectordb/base.py +22 -1
- agno/vectordb/cassandra/cassandra.py +9 -0
- agno/vectordb/chroma/chromadb.py +26 -6
- agno/vectordb/clickhouse/clickhousedb.py +9 -1
- agno/vectordb/couchbase/couchbase.py +11 -0
- agno/vectordb/lancedb/lance_db.py +20 -0
- agno/vectordb/langchaindb/langchaindb.py +11 -0
- agno/vectordb/lightrag/lightrag.py +9 -0
- agno/vectordb/llamaindex/llamaindexdb.py +15 -1
- agno/vectordb/milvus/milvus.py +23 -0
- agno/vectordb/mongodb/mongodb.py +22 -0
- agno/vectordb/pgvector/pgvector.py +19 -0
- agno/vectordb/pineconedb/pineconedb.py +35 -4
- agno/vectordb/qdrant/qdrant.py +24 -0
- agno/vectordb/singlestore/singlestore.py +25 -17
- agno/vectordb/surrealdb/surrealdb.py +18 -1
- agno/vectordb/upstashdb/upstashdb.py +26 -1
- agno/vectordb/weaviate/weaviate.py +18 -0
- agno/workflow/condition.py +29 -0
- agno/workflow/loop.py +29 -0
- agno/workflow/parallel.py +141 -113
- agno/workflow/router.py +29 -0
- agno/workflow/step.py +146 -25
- agno/workflow/steps.py +29 -0
- agno/workflow/types.py +26 -1
- agno/workflow/workflow.py +507 -22
- {agno-2.1.3.dist-info → agno-2.1.5.dist-info}/METADATA +100 -41
- {agno-2.1.3.dist-info → agno-2.1.5.dist-info}/RECORD +94 -86
- {agno-2.1.3.dist-info → agno-2.1.5.dist-info}/WHEEL +0 -0
- {agno-2.1.3.dist-info → agno-2.1.5.dist-info}/licenses/LICENSE +0 -0
- {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
|
|