aip-agents-binary 0.6.3__py3-none-any.whl → 0.6.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 (317) hide show
  1. aip_agents/agent/__init__.py +44 -4
  2. aip_agents/agent/base_langgraph_agent.py +26 -6
  3. aip_agents/agent/langgraph_memory_enhancer_agent.py +368 -34
  4. aip_agents/agent/langgraph_react_agent.py +30 -6
  5. aip_agents/mcp/client/__init__.py +38 -2
  6. aip_agents/mcp/client/transports.py +5 -1
  7. aip_agents/memory/adapters/base_adapter.py +94 -0
  8. aip_agents/sentry/sentry.py +29 -8
  9. aip_agents/tools/memory_search/__init__.py +8 -1
  10. aip_agents/tools/memory_search/mem0.py +108 -1
  11. aip_agents/tools/memory_search/schema.py +33 -0
  12. aip_agents/tools/memory_search_tool.py +8 -0
  13. {aip_agents_binary-0.6.3.dist-info → aip_agents_binary-0.6.5.dist-info}/METADATA +4 -16
  14. aip_agents_binary-0.6.5.dist-info/RECORD +314 -0
  15. aip_agents/__init__.pyi +0 -19
  16. aip_agents/a2a/__init__.pyi +0 -3
  17. aip_agents/a2a/server/__init__.pyi +0 -4
  18. aip_agents/a2a/server/base_executor.pyi +0 -73
  19. aip_agents/a2a/server/google_adk_executor.pyi +0 -51
  20. aip_agents/a2a/server/langflow_executor.pyi +0 -43
  21. aip_agents/a2a/server/langgraph_executor.pyi +0 -47
  22. aip_agents/a2a/types.pyi +0 -132
  23. aip_agents/agent/__init__.pyi +0 -9
  24. aip_agents/agent/base_agent.pyi +0 -221
  25. aip_agents/agent/base_langgraph_agent.pyi +0 -233
  26. aip_agents/agent/google_adk_agent.pyi +0 -141
  27. aip_agents/agent/google_adk_constants.pyi +0 -3
  28. aip_agents/agent/hitl/__init__.pyi +0 -6
  29. aip_agents/agent/hitl/config.pyi +0 -15
  30. aip_agents/agent/hitl/langgraph_hitl_mixin.pyi +0 -42
  31. aip_agents/agent/hitl/manager.pyi +0 -200
  32. aip_agents/agent/hitl/models.pyi +0 -3
  33. aip_agents/agent/hitl/prompt/__init__.pyi +0 -4
  34. aip_agents/agent/hitl/prompt/base.pyi +0 -24
  35. aip_agents/agent/hitl/prompt/deferred.pyi +0 -30
  36. aip_agents/agent/hitl/registry.pyi +0 -101
  37. aip_agents/agent/interface.pyi +0 -81
  38. aip_agents/agent/interfaces.pyi +0 -44
  39. aip_agents/agent/langflow_agent.pyi +0 -133
  40. aip_agents/agent/langgraph_memory_enhancer_agent.pyi +0 -49
  41. aip_agents/agent/langgraph_react_agent.pyi +0 -170
  42. aip_agents/agent/system_instruction_context.pyi +0 -13
  43. aip_agents/clients/__init__.pyi +0 -4
  44. aip_agents/clients/langflow/__init__.pyi +0 -4
  45. aip_agents/clients/langflow/client.pyi +0 -140
  46. aip_agents/clients/langflow/types.pyi +0 -7
  47. aip_agents/constants.pyi +0 -7
  48. aip_agents/examples/__init__.pyi +0 -0
  49. aip_agents/examples/compare_streaming_client.pyi +0 -48
  50. aip_agents/examples/compare_streaming_server.pyi +0 -18
  51. aip_agents/examples/demo_memory_recall.py +0 -401
  52. aip_agents/examples/demo_memory_recall.pyi +0 -58
  53. aip_agents/examples/hello_world_a2a_google_adk_client.pyi +0 -9
  54. aip_agents/examples/hello_world_a2a_google_adk_client_agent.pyi +0 -9
  55. aip_agents/examples/hello_world_a2a_google_adk_client_streaming.pyi +0 -9
  56. aip_agents/examples/hello_world_a2a_google_adk_server.pyi +0 -15
  57. aip_agents/examples/hello_world_a2a_langchain_client.pyi +0 -5
  58. aip_agents/examples/hello_world_a2a_langchain_client_agent.pyi +0 -5
  59. aip_agents/examples/hello_world_a2a_langchain_client_lm_invoker.pyi +0 -5
  60. aip_agents/examples/hello_world_a2a_langchain_client_streaming.pyi +0 -5
  61. aip_agents/examples/hello_world_a2a_langchain_reference_client_streaming.pyi +0 -5
  62. aip_agents/examples/hello_world_a2a_langchain_reference_server.pyi +0 -15
  63. aip_agents/examples/hello_world_a2a_langchain_server.pyi +0 -15
  64. aip_agents/examples/hello_world_a2a_langchain_server_lm_invoker.pyi +0 -15
  65. aip_agents/examples/hello_world_a2a_langflow_client.pyi +0 -9
  66. aip_agents/examples/hello_world_a2a_langflow_server.pyi +0 -14
  67. aip_agents/examples/hello_world_a2a_langgraph_artifact_client.pyi +0 -5
  68. aip_agents/examples/hello_world_a2a_langgraph_artifact_client_streaming.pyi +0 -5
  69. aip_agents/examples/hello_world_a2a_langgraph_artifact_server.pyi +0 -16
  70. aip_agents/examples/hello_world_a2a_langgraph_client.pyi +0 -9
  71. aip_agents/examples/hello_world_a2a_langgraph_client_agent.pyi +0 -9
  72. aip_agents/examples/hello_world_a2a_langgraph_client_agent_lm_invoker.pyi +0 -2
  73. aip_agents/examples/hello_world_a2a_langgraph_client_streaming.pyi +0 -9
  74. aip_agents/examples/hello_world_a2a_langgraph_client_streaming_lm_invoker.pyi +0 -5
  75. aip_agents/examples/hello_world_a2a_langgraph_client_streaming_tool_streaming.pyi +0 -5
  76. aip_agents/examples/hello_world_a2a_langgraph_server.pyi +0 -14
  77. aip_agents/examples/hello_world_a2a_langgraph_server_lm_invoker.pyi +0 -15
  78. aip_agents/examples/hello_world_a2a_langgraph_server_tool_streaming.pyi +0 -15
  79. aip_agents/examples/hello_world_a2a_mcp_langgraph.pyi +0 -48
  80. aip_agents/examples/hello_world_a2a_three_level_agent_hierarchy_client.pyi +0 -48
  81. aip_agents/examples/hello_world_a2a_three_level_agent_hierarchy_server.pyi +0 -45
  82. aip_agents/examples/hello_world_a2a_with_metadata_langchain_client.pyi +0 -5
  83. aip_agents/examples/hello_world_a2a_with_metadata_langchain_server_lm_invoker.pyi +0 -15
  84. aip_agents/examples/hello_world_google_adk.pyi +0 -5
  85. aip_agents/examples/hello_world_google_adk_mcp_http.pyi +0 -5
  86. aip_agents/examples/hello_world_google_adk_mcp_http_stream.pyi +0 -5
  87. aip_agents/examples/hello_world_google_adk_mcp_sse.pyi +0 -5
  88. aip_agents/examples/hello_world_google_adk_mcp_sse_stream.pyi +0 -5
  89. aip_agents/examples/hello_world_google_adk_mcp_stdio.pyi +0 -5
  90. aip_agents/examples/hello_world_google_adk_mcp_stdio_stream.pyi +0 -5
  91. aip_agents/examples/hello_world_google_adk_stream.pyi +0 -5
  92. aip_agents/examples/hello_world_langchain.pyi +0 -5
  93. aip_agents/examples/hello_world_langchain_lm_invoker.pyi +0 -2
  94. aip_agents/examples/hello_world_langchain_mcp_http.pyi +0 -5
  95. aip_agents/examples/hello_world_langchain_mcp_http_interactive.pyi +0 -16
  96. aip_agents/examples/hello_world_langchain_mcp_http_stream.pyi +0 -5
  97. aip_agents/examples/hello_world_langchain_mcp_multi_server.pyi +0 -18
  98. aip_agents/examples/hello_world_langchain_mcp_sse.pyi +0 -5
  99. aip_agents/examples/hello_world_langchain_mcp_sse_stream.pyi +0 -5
  100. aip_agents/examples/hello_world_langchain_mcp_stdio.pyi +0 -5
  101. aip_agents/examples/hello_world_langchain_mcp_stdio_stream.pyi +0 -5
  102. aip_agents/examples/hello_world_langchain_stream.pyi +0 -5
  103. aip_agents/examples/hello_world_langchain_stream_lm_invoker.pyi +0 -5
  104. aip_agents/examples/hello_world_langflow_agent.pyi +0 -35
  105. aip_agents/examples/hello_world_langgraph.pyi +0 -5
  106. aip_agents/examples/hello_world_langgraph_gl_connector_twitter.pyi +0 -5
  107. aip_agents/examples/hello_world_langgraph_mcp_http.pyi +0 -5
  108. aip_agents/examples/hello_world_langgraph_mcp_http_stream.pyi +0 -5
  109. aip_agents/examples/hello_world_langgraph_mcp_sse.pyi +0 -5
  110. aip_agents/examples/hello_world_langgraph_mcp_sse_stream.pyi +0 -5
  111. aip_agents/examples/hello_world_langgraph_mcp_stdio.pyi +0 -5
  112. aip_agents/examples/hello_world_langgraph_mcp_stdio_stream.pyi +0 -5
  113. aip_agents/examples/hello_world_langgraph_stream.pyi +0 -5
  114. aip_agents/examples/hello_world_langgraph_stream_lm_invoker.pyi +0 -5
  115. aip_agents/examples/hello_world_model_switch_cli.pyi +0 -30
  116. aip_agents/examples/hello_world_multi_agent_adk.pyi +0 -6
  117. aip_agents/examples/hello_world_multi_agent_langchain.pyi +0 -5
  118. aip_agents/examples/hello_world_multi_agent_langgraph.pyi +0 -5
  119. aip_agents/examples/hello_world_multi_agent_langgraph_lm_invoker.pyi +0 -5
  120. aip_agents/examples/hello_world_pii_logger.pyi +0 -5
  121. aip_agents/examples/hello_world_ptc.pyi +0 -5
  122. aip_agents/examples/hello_world_sentry.pyi +0 -21
  123. aip_agents/examples/hello_world_step_limits.pyi +0 -17
  124. aip_agents/examples/hello_world_stock_a2a_server.pyi +0 -17
  125. aip_agents/examples/hello_world_tool_output_client.pyi +0 -5
  126. aip_agents/examples/hello_world_tool_output_server.pyi +0 -19
  127. aip_agents/examples/hitl_demo.pyi +0 -67
  128. aip_agents/examples/pii_demo_langgraph_client.pyi +0 -5
  129. aip_agents/examples/pii_demo_langgraph_server.pyi +0 -20
  130. aip_agents/examples/pii_demo_multi_agent_client.pyi +0 -5
  131. aip_agents/examples/pii_demo_multi_agent_server.pyi +0 -40
  132. aip_agents/examples/todolist_planning_a2a_langchain_client.pyi +0 -5
  133. aip_agents/examples/todolist_planning_a2a_langgraph_server.pyi +0 -19
  134. aip_agents/examples/tools/__init__.pyi +0 -9
  135. aip_agents/examples/tools/adk_arithmetic_tools.pyi +0 -24
  136. aip_agents/examples/tools/adk_weather_tool.pyi +0 -18
  137. aip_agents/examples/tools/data_generator_tool.pyi +0 -15
  138. aip_agents/examples/tools/data_visualization_tool.pyi +0 -19
  139. aip_agents/examples/tools/image_artifact_tool.pyi +0 -26
  140. aip_agents/examples/tools/langchain_arithmetic_tools.pyi +0 -17
  141. aip_agents/examples/tools/langchain_currency_exchange_tool.pyi +0 -20
  142. aip_agents/examples/tools/langchain_graph_artifact_tool.pyi +0 -25
  143. aip_agents/examples/tools/langchain_weather_tool.pyi +0 -19
  144. aip_agents/examples/tools/langgraph_streaming_tool.pyi +0 -43
  145. aip_agents/examples/tools/mock_retrieval_tool.pyi +0 -13
  146. aip_agents/examples/tools/pii_demo_tools.pyi +0 -54
  147. aip_agents/examples/tools/random_chart_tool.pyi +0 -20
  148. aip_agents/examples/tools/serper_tool.pyi +0 -16
  149. aip_agents/examples/tools/stock_tools.pyi +0 -36
  150. aip_agents/examples/tools/table_generator_tool.pyi +0 -22
  151. aip_agents/examples/tools/time_tool.pyi +0 -15
  152. aip_agents/examples/tools/weather_forecast_tool.pyi +0 -14
  153. aip_agents/guardrails/__init__.pyi +0 -6
  154. aip_agents/guardrails/engines/__init__.pyi +0 -4
  155. aip_agents/guardrails/engines/base.pyi +0 -61
  156. aip_agents/guardrails/engines/nemo.pyi +0 -46
  157. aip_agents/guardrails/engines/phrase_matcher.pyi +0 -48
  158. aip_agents/guardrails/exceptions.pyi +0 -23
  159. aip_agents/guardrails/manager.pyi +0 -42
  160. aip_agents/guardrails/middleware.pyi +0 -87
  161. aip_agents/guardrails/schemas.pyi +0 -43
  162. aip_agents/guardrails/utils.pyi +0 -19
  163. aip_agents/mcp/__init__.pyi +0 -0
  164. aip_agents/mcp/client/__init__.pyi +0 -5
  165. aip_agents/mcp/client/base_mcp_client.pyi +0 -148
  166. aip_agents/mcp/client/connection_manager.pyi +0 -51
  167. aip_agents/mcp/client/google_adk/__init__.pyi +0 -3
  168. aip_agents/mcp/client/google_adk/client.pyi +0 -75
  169. aip_agents/mcp/client/langchain/__init__.pyi +0 -3
  170. aip_agents/mcp/client/langchain/client.pyi +0 -48
  171. aip_agents/mcp/client/persistent_session.pyi +0 -122
  172. aip_agents/mcp/client/session_pool.pyi +0 -101
  173. aip_agents/mcp/client/transports.pyi +0 -132
  174. aip_agents/mcp/utils/__init__.pyi +0 -0
  175. aip_agents/mcp/utils/config_validator.pyi +0 -82
  176. aip_agents/memory/__init__.pyi +0 -5
  177. aip_agents/memory/adapters/__init__.pyi +0 -4
  178. aip_agents/memory/adapters/base_adapter.pyi +0 -150
  179. aip_agents/memory/adapters/mem0.pyi +0 -22
  180. aip_agents/memory/base.pyi +0 -60
  181. aip_agents/memory/constants.pyi +0 -25
  182. aip_agents/memory/factory.pyi +0 -24
  183. aip_agents/memory/guidance.pyi +0 -3
  184. aip_agents/memory/simple_memory.pyi +0 -23
  185. aip_agents/middleware/__init__.pyi +0 -5
  186. aip_agents/middleware/base.pyi +0 -75
  187. aip_agents/middleware/manager.pyi +0 -84
  188. aip_agents/middleware/todolist.pyi +0 -125
  189. aip_agents/ptc/__init__.pyi +0 -10
  190. aip_agents/ptc/doc_gen.pyi +0 -40
  191. aip_agents/ptc/exceptions.pyi +0 -22
  192. aip_agents/ptc/executor.pyi +0 -73
  193. aip_agents/ptc/mcp/__init__.pyi +0 -7
  194. aip_agents/ptc/mcp/sandbox_bridge.pyi +0 -47
  195. aip_agents/ptc/mcp/templates/__init__.pyi +0 -0
  196. aip_agents/ptc/naming.pyi +0 -76
  197. aip_agents/ptc/payload.pyi +0 -15
  198. aip_agents/ptc/prompt_builder.pyi +0 -55
  199. aip_agents/ptc/ptc_helper.pyi +0 -1
  200. aip_agents/ptc/sandbox_bridge.pyi +0 -25
  201. aip_agents/ptc/template_utils.pyi +0 -13
  202. aip_agents/ptc/templates/__init__.pyi +0 -0
  203. aip_agents/sandbox/__init__.pyi +0 -5
  204. aip_agents/sandbox/defaults.pyi +0 -2
  205. aip_agents/sandbox/e2b_runtime.pyi +0 -51
  206. aip_agents/sandbox/template_builder.pyi +0 -36
  207. aip_agents/sandbox/types.pyi +0 -14
  208. aip_agents/sandbox/validation.pyi +0 -20
  209. aip_agents/schema/__init__.pyi +0 -9
  210. aip_agents/schema/a2a.pyi +0 -40
  211. aip_agents/schema/agent.pyi +0 -65
  212. aip_agents/schema/hitl.pyi +0 -89
  213. aip_agents/schema/langgraph.pyi +0 -28
  214. aip_agents/schema/model_id.pyi +0 -54
  215. aip_agents/schema/step_limit.pyi +0 -63
  216. aip_agents/schema/storage.pyi +0 -21
  217. aip_agents/sentry/__init__.pyi +0 -3
  218. aip_agents/sentry/sentry.pyi +0 -48
  219. aip_agents/storage/__init__.pyi +0 -8
  220. aip_agents/storage/base.pyi +0 -58
  221. aip_agents/storage/clients/__init__.pyi +0 -3
  222. aip_agents/storage/clients/minio_client.pyi +0 -137
  223. aip_agents/storage/config.pyi +0 -29
  224. aip_agents/storage/providers/__init__.pyi +0 -5
  225. aip_agents/storage/providers/base.pyi +0 -88
  226. aip_agents/storage/providers/memory.pyi +0 -79
  227. aip_agents/storage/providers/object_storage.pyi +0 -98
  228. aip_agents/tools/__init__.pyi +0 -11
  229. aip_agents/tools/browser_use/__init__.pyi +0 -14
  230. aip_agents/tools/browser_use/action_parser.pyi +0 -18
  231. aip_agents/tools/browser_use/browser_use_tool.pyi +0 -50
  232. aip_agents/tools/browser_use/llm_config.pyi +0 -52
  233. aip_agents/tools/browser_use/minio_storage.pyi +0 -109
  234. aip_agents/tools/browser_use/schemas.pyi +0 -32
  235. aip_agents/tools/browser_use/session.pyi +0 -4
  236. aip_agents/tools/browser_use/session_errors.pyi +0 -53
  237. aip_agents/tools/browser_use/steel_session_recording.pyi +0 -63
  238. aip_agents/tools/browser_use/streaming.pyi +0 -81
  239. aip_agents/tools/browser_use/structured_data_parser.pyi +0 -86
  240. aip_agents/tools/browser_use/structured_data_recovery.pyi +0 -43
  241. aip_agents/tools/browser_use/types.pyi +0 -45
  242. aip_agents/tools/code_sandbox/__init__.pyi +0 -3
  243. aip_agents/tools/code_sandbox/constant.pyi +0 -4
  244. aip_agents/tools/code_sandbox/e2b_cloud_sandbox_extended.pyi +0 -102
  245. aip_agents/tools/code_sandbox/e2b_sandbox_tool.pyi +0 -29
  246. aip_agents/tools/constants.pyi +0 -138
  247. aip_agents/tools/date_range_tool.pyi +0 -21
  248. aip_agents/tools/document_loader/__init__.pyi +0 -7
  249. aip_agents/tools/document_loader/base_reader.pyi +0 -75
  250. aip_agents/tools/document_loader/docx_reader_tool.pyi +0 -10
  251. aip_agents/tools/document_loader/excel_reader_tool.pyi +0 -26
  252. aip_agents/tools/document_loader/pdf_reader_tool.pyi +0 -11
  253. aip_agents/tools/document_loader/pdf_splitter.pyi +0 -18
  254. aip_agents/tools/execute_ptc_code.pyi +0 -90
  255. aip_agents/tools/gl_connector/__init__.pyi +0 -3
  256. aip_agents/tools/gl_connector/tool.pyi +0 -74
  257. aip_agents/tools/gl_connector_tools.pyi +0 -39
  258. aip_agents/tools/memory_search/__init__.pyi +0 -5
  259. aip_agents/tools/memory_search/base.pyi +0 -69
  260. aip_agents/tools/memory_search/mem0.pyi +0 -19
  261. aip_agents/tools/memory_search/schema.pyi +0 -15
  262. aip_agents/tools/memory_search_tool.pyi +0 -3
  263. aip_agents/tools/time_tool.pyi +0 -16
  264. aip_agents/tools/tool_config_injector.pyi +0 -26
  265. aip_agents/tools/web_search/__init__.pyi +0 -3
  266. aip_agents/tools/web_search/serper_tool.pyi +0 -19
  267. aip_agents/types/__init__.pyi +0 -36
  268. aip_agents/types/a2a_events.pyi +0 -3
  269. aip_agents/utils/__init__.pyi +0 -11
  270. aip_agents/utils/a2a_connector.pyi +0 -146
  271. aip_agents/utils/artifact_helpers.pyi +0 -203
  272. aip_agents/utils/constants.pyi +0 -10
  273. aip_agents/utils/datetime/__init__.pyi +0 -4
  274. aip_agents/utils/datetime/normalization.pyi +0 -95
  275. aip_agents/utils/datetime/timezone.pyi +0 -48
  276. aip_agents/utils/env_loader.pyi +0 -10
  277. aip_agents/utils/event_handler_registry.pyi +0 -23
  278. aip_agents/utils/file_prompt_utils.pyi +0 -21
  279. aip_agents/utils/final_response_builder.pyi +0 -34
  280. aip_agents/utils/formatter_llm_client.pyi +0 -71
  281. aip_agents/utils/langgraph/__init__.pyi +0 -3
  282. aip_agents/utils/langgraph/converter.pyi +0 -49
  283. aip_agents/utils/langgraph/tool_managers/__init__.pyi +0 -5
  284. aip_agents/utils/langgraph/tool_managers/a2a_tool_manager.pyi +0 -35
  285. aip_agents/utils/langgraph/tool_managers/base_tool_manager.pyi +0 -48
  286. aip_agents/utils/langgraph/tool_managers/delegation_tool_manager.pyi +0 -56
  287. aip_agents/utils/langgraph/tool_output_management.pyi +0 -329
  288. aip_agents/utils/logger.pyi +0 -60
  289. aip_agents/utils/metadata/__init__.pyi +0 -5
  290. aip_agents/utils/metadata/activity_metadata_helper.pyi +0 -25
  291. aip_agents/utils/metadata/activity_narrative/__init__.pyi +0 -7
  292. aip_agents/utils/metadata/activity_narrative/builder.pyi +0 -35
  293. aip_agents/utils/metadata/activity_narrative/constants.pyi +0 -10
  294. aip_agents/utils/metadata/activity_narrative/context.pyi +0 -32
  295. aip_agents/utils/metadata/activity_narrative/formatters.pyi +0 -48
  296. aip_agents/utils/metadata/activity_narrative/utils.pyi +0 -12
  297. aip_agents/utils/metadata/schemas/__init__.pyi +0 -4
  298. aip_agents/utils/metadata/schemas/activity_schema.pyi +0 -18
  299. aip_agents/utils/metadata/schemas/thinking_schema.pyi +0 -20
  300. aip_agents/utils/metadata/thinking_metadata_helper.pyi +0 -4
  301. aip_agents/utils/metadata_helper.pyi +0 -117
  302. aip_agents/utils/name_preprocessor/__init__.pyi +0 -6
  303. aip_agents/utils/name_preprocessor/base_name_preprocessor.pyi +0 -52
  304. aip_agents/utils/name_preprocessor/google_name_preprocessor.pyi +0 -38
  305. aip_agents/utils/name_preprocessor/name_preprocessor.pyi +0 -41
  306. aip_agents/utils/name_preprocessor/openai_name_preprocessor.pyi +0 -34
  307. aip_agents/utils/pii/__init__.pyi +0 -5
  308. aip_agents/utils/pii/pii_handler.pyi +0 -96
  309. aip_agents/utils/pii/pii_helper.pyi +0 -78
  310. aip_agents/utils/pii/uuid_deanonymizer_mapping.pyi +0 -73
  311. aip_agents/utils/reference_helper.pyi +0 -81
  312. aip_agents/utils/sse_chunk_transformer.pyi +0 -166
  313. aip_agents/utils/step_limit_manager.pyi +0 -112
  314. aip_agents/utils/token_usage_helper.pyi +0 -60
  315. aip_agents_binary-0.6.3.dist-info/RECORD +0 -614
  316. {aip_agents_binary-0.6.3.dist-info → aip_agents_binary-0.6.5.dist-info}/WHEEL +0 -0
  317. {aip_agents_binary-0.6.3.dist-info → aip_agents_binary-0.6.5.dist-info}/top_level.txt +0 -0
@@ -1,75 +0,0 @@
1
- from _typeshed import Incomplete
2
- from aip_agents.mcp.client.base_mcp_client import BaseMCPClient as BaseMCPClient
3
- from aip_agents.utils.logger import get_logger as get_logger
4
- from gllm_tools.mcp.client.config import MCPConfiguration as MCPConfiguration
5
- from google.adk.tools import FunctionTool
6
- from mcp.types import EmbeddedResource, ImageContent
7
-
8
- NonTextContent = ImageContent | EmbeddedResource
9
- logger: Incomplete
10
-
11
- class GoogleADKMCPClient(BaseMCPClient):
12
- '''Google ADK MCP Client with Persistent Sessions.
13
-
14
- This client extends BaseMCPClient to provide Google ADK-specific tool conversion
15
- while maintaining persistent MCP sessions and connection reuse across tool calls.
16
- It converts MCP tools into ADK FunctionTool instances for seamless integration.
17
-
18
- The client handles:
19
- - Converting MCP tools to ADK FunctionTool instances using persistent sessions
20
- - Managing MCP server connections with automatic reconnection
21
- - Converting MCP resources to ADK-compatible formats
22
- - Handling tool execution with proper error formatting for ADK agents
23
-
24
- Example:
25
- ```python
26
- from aip_agents.mcp.client.google_adk.client import GoogleADKMCPClient
27
- from gllm_tools.mcp.client.config import MCPConfiguration
28
-
29
- servers = {
30
- "filesystem": MCPConfiguration(
31
- command="npx",
32
- args=["-y", "@modelcontextprotocol/server-filesystem", "/path/to/folder"]
33
- )
34
- }
35
-
36
- client = GoogleADKMCPClient(servers)
37
- await client.initialize() # Initialize persistent sessions
38
- tools = await client.get_tools() # Returns list of ADK FunctionTool instances
39
- ```
40
- '''
41
- RESOURCE_FETCH_TIMEOUT: int
42
- def __init__(self, servers: dict[str, MCPConfiguration]) -> None:
43
- """Initialize Google ADK MCP client.
44
-
45
- Args:
46
- servers (dict[str, MCPConfiguration]): Dictionary of MCP server configurations
47
- """
48
- async def initialize(self) -> None:
49
- """Initialize persistent MCP sessions for Google ADK integration.
50
-
51
- This method ensures all MCP servers are connected with persistent sessions
52
- and prepares the client for ADK tool conversion.
53
-
54
- Raises:
55
- Exception: If session initialization fails
56
- """
57
- async def get_tools(self, server: str | None = None) -> list[FunctionTool]:
58
- """Get ADK-compatible FunctionTool instances with smart caching.
59
-
60
- Converts MCP tools to ADK format and caches them for better performance
61
- on repeated access. Cache is keyed by server parameter.
62
-
63
- Args:
64
- server (str | None): Optional server name to filter tools from a specific server.
65
- If None, returns tools from all configured servers.
66
-
67
- Returns:
68
- list[FunctionTool]: List of cached ADK FunctionTool instances.
69
- """
70
- async def cleanup(self) -> None:
71
- """Clean up Google ADK MCP client resources.
72
-
73
- This method ensures all persistent sessions are properly closed and
74
- ADK-specific resources are cleaned up.
75
- """
@@ -1,3 +0,0 @@
1
- from aip_agents.mcp.client.langchain.client import LangchainMCPClient as LangchainMCPClient
2
-
3
- __all__ = ['LangchainMCPClient']
@@ -1,48 +0,0 @@
1
- from _typeshed import Incomplete
2
- from aip_agents.mcp.client.base_mcp_client import BaseMCPClient as BaseMCPClient
3
- from aip_agents.utils.logger import get_logger as get_logger
4
- from gllm_tools.mcp.client.config import MCPConfiguration as MCPConfiguration
5
- from langchain_core.tools import StructuredTool
6
- from mcp.types import EmbeddedResource, ImageContent
7
-
8
- NonTextContent = ImageContent | EmbeddedResource
9
- logger: Incomplete
10
-
11
- class LangchainMCPClient(BaseMCPClient):
12
- """Langchain MCP Client with Session Persistence.
13
-
14
- This client extends BaseMCPClient to provide LangChain-specific tool conversion
15
- while maintaining persistent MCP sessions and connection reuse across tool calls.
16
- """
17
- RESOURCE_FETCH_TIMEOUT: int
18
- def __init__(self, servers: dict[str, MCPConfiguration]) -> None:
19
- """Initialize LangChain MCP client.
20
-
21
- Args:
22
- servers (dict[str, MCPConfiguration]): Dictionary of MCP server configurations
23
- """
24
- async def initialize(self) -> None:
25
- """Initialize all sessions for LangChain client.
26
-
27
- This method initializes the base MCP sessions and prepares for tool caching.
28
-
29
- Raises:
30
- Exception: If base initialization fails
31
- """
32
- async def get_tools(self, server: str | None = None) -> list[StructuredTool]:
33
- """Get LangChain StructuredTools with smart caching.
34
-
35
- Converts MCP tools to LangChain format and caches them for better performance
36
- on repeated access. Cache is keyed by server parameter.
37
-
38
- Args:
39
- server (str | None): Optional server name to filter tools. If None, returns all tools.
40
-
41
- Returns:
42
- list[StructuredTool]: List of cached LangChain StructuredTool instances
43
- """
44
- async def cleanup(self) -> None:
45
- """Cleanup LangChain MCP resources.
46
-
47
- This method extends base class cleanup and clears the LangChain tool cache.
48
- """
@@ -1,122 +0,0 @@
1
- from _typeshed import Incomplete
2
- from aip_agents.mcp.client.connection_manager import MCPConnectionManager as MCPConnectionManager
3
- from aip_agents.mcp.utils.config_validator import validate_allowed_tools_list as validate_allowed_tools_list
4
- from aip_agents.utils.logger import get_logger as get_logger
5
- from collections.abc import Awaitable as Awaitable
6
- from gllm_tools.mcp.client.config import MCPConfiguration
7
- from mcp import ClientSession
8
- from mcp.types import CallToolResult, Tool as Tool
9
- from typing import Any
10
-
11
- logger: Incomplete
12
-
13
- class PersistentMCPSession:
14
- """Persistent MCP session that reuses connections.
15
-
16
- This session wrapper manages the connection lifecycle and caches tools
17
- to avoid repeated initialization overhead. It provides automatic reconnection
18
- and thread-safe operations.
19
-
20
- Tool Filtering:
21
- When allowed_tools is configured, tools are filtered inline during list_tools()
22
- and permission checked in call_tool() using set lookup.
23
- """
24
- server_name: Incomplete
25
- config: Incomplete
26
- connection_manager: Incomplete
27
- client_session: ClientSession | None
28
- tools: list[Tool]
29
- def __init__(self, server_name: str, config: MCPConfiguration, allowed_tools: list[str] | None = None) -> None:
30
- """Initialize persistent session.
31
-
32
- Args:
33
- server_name: Name of the MCP server
34
- config: MCP server configuration
35
- allowed_tools: Optional list of tool names to allow. None or empty means all tools allowed.
36
- """
37
- async def initialize(self) -> None:
38
- """Initialize session once and cache tools.
39
-
40
- This method is idempotent and can be called multiple times safely.
41
-
42
- Raises:
43
- Exception: If session initialization fails
44
- """
45
- async def call_tool(self, name: str, arguments: dict[str, Any]) -> CallToolResult:
46
- """Call MCP tool using persistent session.
47
-
48
- Args:
49
- name (str): Tool name
50
- arguments (dict[str, Any]): Tool arguments
51
-
52
- Returns:
53
- CallToolResult: Tool call result
54
-
55
- Raises:
56
- Exception: If tool call fails
57
- """
58
- async def read_resource(self, uri: str) -> Any:
59
- """Read an MCP resource using persistent session.
60
-
61
- Args:
62
- uri (str): The URI of the resource to read
63
-
64
- Returns:
65
- Any: The resource content
66
-
67
- Raises:
68
- Exception: If resource reading fails
69
- """
70
- async def list_tools(self) -> list[Tool]:
71
- """Get cached tools list with allowed tools filtering applied.
72
-
73
- Returns:
74
- list[Tool]: a copy of list of available tools, filtered to only allowed tools if configured
75
- """
76
- def get_tools_count(self) -> int:
77
- """Get count of allowed tools.
78
-
79
- Returns:
80
- Count of allowed tools
81
- """
82
- async def ensure_connected(self) -> None:
83
- """Ensure connection is healthy, reconnect if needed.
84
-
85
- This method provides automatic reconnection capability.
86
-
87
- Raises:
88
- Exception: If reconnection fails
89
- """
90
- async def disconnect(self) -> None:
91
- """Disconnect session gracefully.
92
-
93
- This method cleans up all resources and connections.
94
- Always succeeds, even if the session was already in an error state.
95
- """
96
- @property
97
- def is_initialized(self) -> bool:
98
- """Check if session is initialized.
99
-
100
- Returns:
101
- bool: True if initialized and connected, False otherwise
102
- """
103
- @property
104
- def allowed_tools(self) -> list[str] | None:
105
- """Return the configured allowed tools, sorted if present.
106
-
107
- Returns:
108
- Sorted list of allowed tool names, or None if unrestricted.
109
- """
110
- def update_allowed_tools(self, allowed_tools: list[str] | None) -> bool:
111
- """Update the list of allowed tools for this session.
112
-
113
- Args:
114
- allowed_tools: New list of allowed tool names or None for no restriction.
115
- None and empty list both mean 'no restrictions, allow all tools'.
116
-
117
- Returns:
118
- bool: True if the configuration changed, False otherwise.
119
-
120
- Raises:
121
- ValueError: If allowed_tools contains invalid entries.
122
- """
@@ -1,101 +0,0 @@
1
- from _typeshed import Incomplete
2
- from aip_agents.mcp.client.persistent_session import PersistentMCPSession as PersistentMCPSession
3
- from aip_agents.mcp.utils.config_validator import validate_allowed_tools_config as validate_allowed_tools_config, validate_allowed_tools_list as validate_allowed_tools_list
4
- from aip_agents.utils.logger import get_logger as get_logger
5
- from gllm_tools.mcp.client.config import MCPConfiguration
6
- from mcp.types import Tool as Tool
7
-
8
- logger: Incomplete
9
-
10
- class MCPSessionPool:
11
- """Manages pool of persistent MCP sessions.
12
-
13
- This pool provides centralized management of MCP sessions, including
14
- initialization, tool collection, and resource cleanup. Sessions are
15
- reused across the agent lifecycle.
16
- """
17
- sessions: dict[str, PersistentMCPSession]
18
- def __init__(self) -> None:
19
- """Initialize empty session pool."""
20
- async def get_or_create_session(self, server_name: str, config: MCPConfiguration, allowed_tools: list[str] | None = None) -> PersistentMCPSession:
21
- """Get existing session or create new one.
22
-
23
- Args:
24
- server_name (str): Name of the MCP server
25
- config (MCPConfiguration): MCP server configuration
26
- allowed_tools (list[str] | None): Optional list of tool names to allow. None means all tools allowed.
27
-
28
- Returns:
29
- PersistentMCPSession: Persistent MCP session
30
-
31
- Raises:
32
- Exception: If session creation fails
33
- """
34
- async def initialize_all_sessions(self, server_configs: dict[str, MCPConfiguration]) -> None:
35
- """Initialize all sessions and cache tools.
36
-
37
- This method initializes all configured MCP servers concurrently
38
- for better performance.
39
-
40
- Args:
41
- server_configs (dict[str, MCPConfiguration]): Dictionary of server configurations
42
-
43
- Raises:
44
- Exception: If any session initialization fails
45
- """
46
- def get_all_active_sessions(self) -> dict[str, PersistentMCPSession]:
47
- """Get all active sessions.
48
-
49
- Returns:
50
- dict[str, PersistentMCPSession]: Dictionary of active sessions by server name
51
- """
52
- @property
53
- def active_sessions(self) -> list[str]:
54
- """Get list of active session names.
55
-
56
- Returns:
57
- list[str]: List of active session names
58
- """
59
- async def get_all_tools(self) -> list[Tool]:
60
- """Get all cached tools from all active sessions.
61
-
62
- Returns:
63
- list[Tool]: List of all available tools across all sessions
64
- """
65
- async def close_session(self, server_name: str) -> None:
66
- """Close specific session.
67
-
68
- Args:
69
- server_name (str): Name of the server session to close
70
- """
71
- async def close_all_sessions(self) -> None:
72
- """Close all sessions gracefully.
73
-
74
- This method ensures all resources are cleaned up properly.
75
- """
76
- @property
77
- def is_initialized(self) -> bool:
78
- """Check if session pool is initialized.
79
-
80
- Returns:
81
- bool: True if initialized, False otherwise
82
- """
83
- @property
84
- def session_count(self) -> int:
85
- """Get number of active sessions.
86
-
87
- Returns:
88
- int: Number of active sessions
89
- """
90
- def get_session(self, server_name: str) -> PersistentMCPSession:
91
- """Get specific session by name.
92
-
93
- Args:
94
- server_name (str): Name of the server
95
-
96
- Returns:
97
- PersistentMCPSession: The requested session
98
-
99
- Raises:
100
- KeyError: If session doesn't exist
101
- """
@@ -1,132 +0,0 @@
1
- from _typeshed import Incomplete
2
- from abc import ABC, abstractmethod
3
- from aip_agents.utils.logger import get_logger as get_logger
4
- from collections.abc import AsyncIterator as AsyncIterator
5
- from enum import StrEnum
6
- from gllm_tools.mcp.client.config import MCPConfiguration
7
- from typing import Any, Protocol
8
-
9
- class TransportContext(Protocol):
10
- """Protocol defining the interface for async context managers used in MCP transport connections."""
11
- async def __aenter__(self) -> None:
12
- """Enter the async context, establishing the connection and returning read/write streams."""
13
- async def __aexit__(self, _exc_type, _exc_val, _exc_tb) -> None:
14
- """Exit the async context, performing cleanup and closing the connection.
15
-
16
- Args:
17
- _exc_type: Exception type if an exception occurred.
18
- _exc_val: Exception value if an exception occurred.
19
- _exc_tb: Exception traceback if an exception occurred.
20
- """
21
-
22
- logger: Incomplete
23
- DEFAULT_TIMEOUT: float
24
-
25
- class TransportType(StrEnum):
26
- """Enum for supported MCP transport types."""
27
- HTTP: str
28
- SSE: str
29
- STDIO: str
30
-
31
- class Transport(ABC):
32
- """Abstract base class for MCP transports."""
33
- server_name: Incomplete
34
- config: Incomplete
35
- ctx: Any
36
- def __init__(self, server_name: str, config: MCPConfiguration) -> None:
37
- """Initialize the transport.
38
-
39
- Args:
40
- server_name (str): Name of the MCP server.
41
- config (MCPConfiguration): Configuration for the transport.
42
- """
43
- @abstractmethod
44
- async def connect(self) -> tuple[AsyncIterator[bytes], AsyncIterator[bytes], TransportContext]:
45
- """Establish connection and return read/write streams and context manager.
46
-
47
- Returns:
48
- tuple[AsyncIterator[bytes], AsyncIterator[bytes], Any]:
49
- (read_stream, write_stream, ctx)
50
- Where:
51
- - read_stream: AsyncIterator[bytes] for reading from the server.
52
- - write_stream: AsyncIterator[bytes] for writing to the server.
53
- - ctx: The async context manager instance for cleanup via __aexit__.
54
-
55
- Raises:
56
- ValueError: If required config (e.g., URL or command) is missing.
57
- ConnectionError: If connection establishment fails.
58
- """
59
- async def close(self) -> None:
60
- """Clean up the transport connection."""
61
-
62
- class SSETransport(Transport):
63
- """SSE transport handler."""
64
- ctx: Incomplete
65
- async def connect(self) -> tuple[AsyncIterator[bytes], AsyncIterator[bytes], TransportContext]:
66
- """Connect using SSE transport.
67
-
68
- Builds SSE URL from config, initializes client with timeout, and enters context.
69
-
70
- Returns:
71
- tuple[AsyncIterator[bytes], AsyncIterator[bytes], Any]: (read_stream, write_stream, ctx)
72
-
73
- Raises:
74
- ValueError: If URL is missing.
75
- ConnectionError: If SSE connection fails.
76
- """
77
-
78
- class HTTPTransport(Transport):
79
- """Streamable HTTP transport handler."""
80
- def __init__(self, server_name: str, config: MCPConfiguration) -> None:
81
- """Initialize the HTTP transport.
82
-
83
- Args:
84
- server_name (str): Name of the MCP server.
85
- config (MCPConfiguration): Configuration for the transport.
86
- """
87
- async def close(self) -> None:
88
- """Clean up the transport connection and any owned HTTP client."""
89
- ctx: Incomplete
90
- async def connect(self) -> tuple[AsyncIterator[bytes], AsyncIterator[bytes], TransportContext]:
91
- """Connect using streamable HTTP transport.
92
-
93
- Builds MCP URL from config, initializes client with timeout, and enters context.
94
-
95
- Returns:
96
- tuple[AsyncIterator[bytes], AsyncIterator[bytes], Any]: (read_stream, write_stream, ctx)
97
-
98
- Raises:
99
- ValueError: If URL is missing.
100
- ConnectionError: If HTTP connection fails.
101
- """
102
-
103
- class StdioTransport(Transport):
104
- """STDIO transport handler."""
105
- ctx: Incomplete
106
- async def connect(self) -> tuple[AsyncIterator[bytes], AsyncIterator[bytes], TransportContext]:
107
- """Connect using STDIO transport.
108
-
109
- Initializes stdio client from command/args/env in config and enters context.
110
-
111
- Returns:
112
- tuple[AsyncIterator[bytes], AsyncIterator[bytes], Any]: (read_stream, write_stream, ctx)
113
-
114
- Raises:
115
- ValueError: If command is missing.
116
- ConnectionError: If STDIO connection fails.
117
- """
118
-
119
- def create_transport(server_name: str, config: MCPConfiguration, transport_type: TransportType | str) -> Transport:
120
- """Factory to create the appropriate transport instance.
121
-
122
- Args:
123
- server_name (str): Server name
124
- config (MCPConfiguration): Config
125
- transport_type (str): Transport type ('http', 'sse', 'stdio')
126
-
127
- Returns:
128
- Transport: Concrete transport instance
129
-
130
- Raises:
131
- ValueError: If transport_type is unsupported.
132
- """
File without changes
@@ -1,82 +0,0 @@
1
- from _typeshed import Incomplete
2
- from aip_agents.utils.logger import get_logger as get_logger
3
- from typing import Any
4
-
5
- logger: Incomplete
6
-
7
- def validate_allowed_tools_list(allowed_tools: list[str] | None, context: str) -> list[str] | None:
8
- '''Validate that allowed_tools is a list of strings or None.
9
-
10
- This function validates the type and contents of allowed_tools parameter.
11
- It can be used to validate allowed_tools from any source (config dict, function parameter, etc).
12
-
13
- Args:
14
- allowed_tools: The allowed_tools value to validate (can be any type)
15
- context: Context string for error messages (e.g., "Server \'my_server\'", "\'allowed_tools\' parameter")
16
-
17
- Returns:
18
- Validated list of allowed tool names, or None if allowed_tools is None or empty.
19
- None/empty means no restriction (all tools allowed).
20
-
21
- Raises:
22
- ValueError: If allowed_tools is not None/list or contains non-string elements
23
-
24
- Examples:
25
- >>> validate_allowed_tools_list(None, "test")
26
- None
27
- >>> validate_allowed_tools_list([], "test")
28
- None
29
- >>> validate_allowed_tools_list(["tool1", "tool2"], "test")
30
- [\'tool1\', \'tool2\']
31
- >>> validate_allowed_tools_list("invalid", "test") # doctest: +SKIP
32
- ValueError: test: \'allowed_tools\' must be a list of strings, got str
33
- '''
34
- def validate_allowed_tools_config(config: dict[str, Any], server_name: str) -> list[str] | None:
35
- '''Validate and extract allowed_tools configuration from server config.
36
-
37
- This function validates that the allowed_tools field, if present, is a list of strings.
38
- It returns a normalized list of allowed tool names, or None if not specified/empty.
39
-
40
- Args:
41
- config: Server configuration dictionary that may contain \'allowed_tools\' field
42
- server_name: Name of the server (for error messages)
43
-
44
- Returns:
45
- List of allowed tool names, or None if allowed_tools is not specified or is empty.
46
- None means no restriction (all tools allowed).
47
-
48
- Raises:
49
- ValueError: If allowed_tools is present but not a list
50
- ValueError: If allowed_tools contains non-string elements
51
-
52
- Examples:
53
- >>> validate_allowed_tools_config({"url": "..."}, "my_server")
54
- None
55
- >>> validate_allowed_tools_config({"url": "...", "allowed_tools": []}, "my_server")
56
- None
57
- >>> validate_allowed_tools_config({"url": "...", "allowed_tools": ["tool1", "tool2"]}, "my_server")
58
- [\'tool1\', \'tool2\']
59
- '''
60
- def validate_mcp_server_config(config: dict[str, Any], server_name: str) -> dict[str, Any]:
61
- '''Validate complete MCP server configuration including allowed_tools.
62
-
63
- This function performs comprehensive validation on an MCP server configuration,
64
- ensuring all required fields are present and allowed_tools (if present) is valid.
65
- Unknown configuration fields (such as any leftover disabled_tools) are silently ignored.
66
-
67
- Args:
68
- config: Server configuration dictionary
69
- server_name: Name of the server (for error messages)
70
-
71
- Returns:
72
- Validated configuration dictionary (same as input, after validation)
73
-
74
- Raises:
75
- ValueError: If configuration is invalid
76
-
77
- Examples:
78
- >>> validate_mcp_server_config({"url": "http://localhost:8080"}, "my_server")
79
- {\'url\': \'http://localhost:8080\'}
80
- >>> validate_mcp_server_config({"command": "python", "args": ["server.py"]}, "my_server")
81
- {\'command\': \'python\', \'args\': [\'server.py\']}
82
- '''
@@ -1,5 +0,0 @@
1
- from aip_agents.memory.base import BaseMemory as BaseMemory
2
- from aip_agents.memory.constants import MemoryMethod as MemoryMethod
3
- from aip_agents.memory.factory import MemoryFactory as MemoryFactory
4
-
5
- __all__ = ['BaseMemory', 'MemoryMethod', 'MemoryFactory']
@@ -1,4 +0,0 @@
1
- from aip_agents.memory.adapters.base_adapter import BaseMemoryAdapter as BaseMemoryAdapter
2
- from aip_agents.memory.adapters.mem0 import Mem0Memory as Mem0Memory
3
-
4
- __all__ = ['Mem0Memory', 'BaseMemoryAdapter']