agno 2.3.9__py3-none-any.whl → 2.3.11__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 +0 -12
- agno/db/base.py +5 -5
- agno/db/dynamo/dynamo.py +2 -2
- agno/db/firestore/firestore.py +2 -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/mongo/async_mongo.py +171 -69
- agno/db/mongo/mongo.py +171 -77
- agno/db/mysql/async_mysql.py +93 -69
- agno/db/mysql/mysql.py +93 -68
- agno/db/postgres/async_postgres.py +104 -78
- agno/db/postgres/postgres.py +97 -69
- agno/db/redis/redis.py +2 -2
- agno/db/singlestore/singlestore.py +91 -66
- agno/db/sqlite/async_sqlite.py +102 -79
- agno/db/sqlite/sqlite.py +97 -69
- agno/db/surrealdb/surrealdb.py +2 -2
- agno/eval/accuracy.py +11 -8
- agno/eval/agent_as_judge.py +9 -8
- agno/knowledge/chunking/fixed.py +4 -1
- agno/knowledge/embedder/openai.py +1 -1
- agno/knowledge/knowledge.py +22 -4
- agno/knowledge/utils.py +52 -7
- agno/models/base.py +34 -1
- agno/models/google/gemini.py +69 -40
- agno/models/message.py +3 -0
- agno/models/openai/chat.py +21 -0
- agno/os/routers/evals/utils.py +15 -37
- agno/os/routers/knowledge/knowledge.py +21 -9
- agno/team/team.py +14 -8
- agno/tools/function.py +37 -23
- agno/tools/shopify.py +1519 -0
- agno/tools/spotify.py +2 -5
- agno/tracing/exporter.py +2 -2
- agno/vectordb/base.py +15 -2
- agno/vectordb/pgvector/pgvector.py +8 -8
- agno/workflow/parallel.py +2 -0
- {agno-2.3.9.dist-info → agno-2.3.11.dist-info}/METADATA +1 -1
- {agno-2.3.9.dist-info → agno-2.3.11.dist-info}/RECORD +43 -42
- {agno-2.3.9.dist-info → agno-2.3.11.dist-info}/WHEEL +0 -0
- {agno-2.3.9.dist-info → agno-2.3.11.dist-info}/licenses/LICENSE +0 -0
- {agno-2.3.9.dist-info → agno-2.3.11.dist-info}/top_level.txt +0 -0
agno/tools/function.py
CHANGED
|
@@ -908,21 +908,16 @@ class FunctionCall(BaseModel):
|
|
|
908
908
|
else:
|
|
909
909
|
result = self.function.entrypoint(**entrypoint_args, **self.arguments) # type: ignore
|
|
910
910
|
|
|
911
|
-
updated_session_state = None
|
|
912
|
-
if entrypoint_args.get("run_context") is not None:
|
|
913
|
-
run_context = entrypoint_args.get("run_context")
|
|
914
|
-
updated_session_state = (
|
|
915
|
-
run_context.session_state
|
|
916
|
-
if run_context is not None and run_context.session_state is not None
|
|
917
|
-
else None
|
|
918
|
-
)
|
|
919
|
-
else:
|
|
920
|
-
if self.function._session_state is not None:
|
|
921
|
-
updated_session_state = self.function._session_state
|
|
922
|
-
|
|
923
911
|
# Handle generator case
|
|
924
912
|
if isgenerator(result):
|
|
925
913
|
self.result = result # Store generator directly, can't cache
|
|
914
|
+
# For generators, don't capture updated_session_state yet -
|
|
915
|
+
# session_state is passed by reference, so mutations made during
|
|
916
|
+
# generator iteration are already reflected in the original dict.
|
|
917
|
+
# Returning None prevents stale state from being merged later.
|
|
918
|
+
execution_result = FunctionExecutionResult(
|
|
919
|
+
status="success", result=self.result, updated_session_state=None
|
|
920
|
+
)
|
|
926
921
|
else:
|
|
927
922
|
self.result = result
|
|
928
923
|
# Only cache non-generator results
|
|
@@ -931,9 +926,21 @@ class FunctionCall(BaseModel):
|
|
|
931
926
|
cache_file = self.function._get_cache_file_path(cache_key)
|
|
932
927
|
self.function._save_to_cache(cache_file, self.result)
|
|
933
928
|
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
929
|
+
updated_session_state = None
|
|
930
|
+
if entrypoint_args.get("run_context") is not None:
|
|
931
|
+
run_context = entrypoint_args.get("run_context")
|
|
932
|
+
updated_session_state = (
|
|
933
|
+
run_context.session_state
|
|
934
|
+
if run_context is not None and run_context.session_state is not None
|
|
935
|
+
else None
|
|
936
|
+
)
|
|
937
|
+
else:
|
|
938
|
+
if self.function._session_state is not None:
|
|
939
|
+
updated_session_state = self.function._session_state
|
|
940
|
+
|
|
941
|
+
execution_result = FunctionExecutionResult(
|
|
942
|
+
status="success", result=self.result, updated_session_state=updated_session_state
|
|
943
|
+
)
|
|
937
944
|
|
|
938
945
|
except AgentRunException as e:
|
|
939
946
|
log_debug(f"{e.__class__.__name__}: {e}")
|
|
@@ -1143,14 +1150,21 @@ class FunctionCall(BaseModel):
|
|
|
1143
1150
|
cache_file = self.function._get_cache_file_path(cache_key)
|
|
1144
1151
|
self.function._save_to_cache(cache_file, self.result)
|
|
1145
1152
|
|
|
1146
|
-
updated_session_state
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1153
|
+
# For generators, don't capture updated_session_state -
|
|
1154
|
+
# session_state is passed by reference, so mutations made during
|
|
1155
|
+
# generator iteration are already reflected in the original dict.
|
|
1156
|
+
# Returning None prevents stale state from being merged later.
|
|
1157
|
+
if isgenerator(self.result) or isasyncgen(self.result):
|
|
1158
|
+
updated_session_state = None
|
|
1159
|
+
else:
|
|
1160
|
+
updated_session_state = None
|
|
1161
|
+
if entrypoint_args.get("run_context") is not None:
|
|
1162
|
+
run_context = entrypoint_args.get("run_context")
|
|
1163
|
+
updated_session_state = (
|
|
1164
|
+
run_context.session_state
|
|
1165
|
+
if run_context is not None and run_context.session_state is not None
|
|
1166
|
+
else None
|
|
1167
|
+
)
|
|
1154
1168
|
|
|
1155
1169
|
execution_result = FunctionExecutionResult(
|
|
1156
1170
|
status="success", result=self.result, updated_session_state=updated_session_state
|