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.
Files changed (43) hide show
  1. agno/agent/agent.py +0 -12
  2. agno/db/base.py +5 -5
  3. agno/db/dynamo/dynamo.py +2 -2
  4. agno/db/firestore/firestore.py +2 -2
  5. agno/db/gcs_json/gcs_json_db.py +2 -2
  6. agno/db/in_memory/in_memory_db.py +2 -2
  7. agno/db/json/json_db.py +2 -2
  8. agno/db/mongo/async_mongo.py +171 -69
  9. agno/db/mongo/mongo.py +171 -77
  10. agno/db/mysql/async_mysql.py +93 -69
  11. agno/db/mysql/mysql.py +93 -68
  12. agno/db/postgres/async_postgres.py +104 -78
  13. agno/db/postgres/postgres.py +97 -69
  14. agno/db/redis/redis.py +2 -2
  15. agno/db/singlestore/singlestore.py +91 -66
  16. agno/db/sqlite/async_sqlite.py +102 -79
  17. agno/db/sqlite/sqlite.py +97 -69
  18. agno/db/surrealdb/surrealdb.py +2 -2
  19. agno/eval/accuracy.py +11 -8
  20. agno/eval/agent_as_judge.py +9 -8
  21. agno/knowledge/chunking/fixed.py +4 -1
  22. agno/knowledge/embedder/openai.py +1 -1
  23. agno/knowledge/knowledge.py +22 -4
  24. agno/knowledge/utils.py +52 -7
  25. agno/models/base.py +34 -1
  26. agno/models/google/gemini.py +69 -40
  27. agno/models/message.py +3 -0
  28. agno/models/openai/chat.py +21 -0
  29. agno/os/routers/evals/utils.py +15 -37
  30. agno/os/routers/knowledge/knowledge.py +21 -9
  31. agno/team/team.py +14 -8
  32. agno/tools/function.py +37 -23
  33. agno/tools/shopify.py +1519 -0
  34. agno/tools/spotify.py +2 -5
  35. agno/tracing/exporter.py +2 -2
  36. agno/vectordb/base.py +15 -2
  37. agno/vectordb/pgvector/pgvector.py +8 -8
  38. agno/workflow/parallel.py +2 -0
  39. {agno-2.3.9.dist-info → agno-2.3.11.dist-info}/METADATA +1 -1
  40. {agno-2.3.9.dist-info → agno-2.3.11.dist-info}/RECORD +43 -42
  41. {agno-2.3.9.dist-info → agno-2.3.11.dist-info}/WHEEL +0 -0
  42. {agno-2.3.9.dist-info → agno-2.3.11.dist-info}/licenses/LICENSE +0 -0
  43. {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
- execution_result = FunctionExecutionResult(
935
- status="success", result=self.result, updated_session_state=updated_session_state
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 = None
1147
- if entrypoint_args.get("run_context") is not None:
1148
- run_context = entrypoint_args.get("run_context")
1149
- updated_session_state = (
1150
- run_context.session_state
1151
- if run_context is not None and run_context.session_state is not None
1152
- else None
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