aip-agents-binary 0.6.4__py3-none-manylinux_2_31_x86_64.whl → 0.6.6__py3-none-manylinux_2_31_x86_64.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.

Potentially problematic release.


This version of aip-agents-binary might be problematic. Click here for more details.

Files changed (330) hide show
  1. aip_agents/agent/__init__.py +44 -4
  2. aip_agents/agent/langgraph_react_agent.py +66 -19
  3. aip_agents/examples/hello_world_ptc_custom_tools.py +83 -0
  4. aip_agents/examples/tools/multiply_tool.py +43 -0
  5. aip_agents/mcp/client/__init__.py +38 -2
  6. aip_agents/ptc/__init__.py +42 -3
  7. aip_agents/ptc/custom_tools.py +473 -0
  8. aip_agents/ptc/custom_tools_payload.py +400 -0
  9. aip_agents/ptc/custom_tools_templates/__init__.py +1 -0
  10. aip_agents/ptc/custom_tools_templates/custom_build_function.py.template +23 -0
  11. aip_agents/ptc/custom_tools_templates/custom_init.py.template +15 -0
  12. aip_agents/ptc/custom_tools_templates/custom_invoke.py.template +60 -0
  13. aip_agents/ptc/custom_tools_templates/custom_registry.py.template +87 -0
  14. aip_agents/ptc/custom_tools_templates/custom_sources_init.py.template +7 -0
  15. aip_agents/ptc/custom_tools_templates/custom_wrapper.py.template +19 -0
  16. aip_agents/ptc/exceptions.py +18 -0
  17. aip_agents/ptc/executor.py +151 -33
  18. aip_agents/ptc/naming.py +13 -1
  19. aip_agents/ptc/prompt_builder.py +118 -16
  20. aip_agents/ptc/sandbox_bridge.py +206 -8
  21. aip_agents/ptc/tool_def_helpers.py +101 -0
  22. aip_agents/ptc/tool_enrichment.py +163 -0
  23. aip_agents/sandbox/defaults.py +197 -1
  24. aip_agents/sandbox/e2b_runtime.py +28 -0
  25. aip_agents/sandbox/template_builder.py +2 -2
  26. aip_agents/sentry/sentry.py +29 -8
  27. aip_agents/tools/execute_ptc_code.py +59 -10
  28. {aip_agents_binary-0.6.4.dist-info → aip_agents_binary-0.6.6.dist-info}/METADATA +3 -3
  29. aip_agents_binary-0.6.6.dist-info/RECORD +327 -0
  30. aip_agents/__init__.pyi +0 -19
  31. aip_agents/a2a/__init__.pyi +0 -3
  32. aip_agents/a2a/server/__init__.pyi +0 -4
  33. aip_agents/a2a/server/base_executor.pyi +0 -73
  34. aip_agents/a2a/server/google_adk_executor.pyi +0 -51
  35. aip_agents/a2a/server/langflow_executor.pyi +0 -43
  36. aip_agents/a2a/server/langgraph_executor.pyi +0 -47
  37. aip_agents/a2a/types.pyi +0 -132
  38. aip_agents/agent/__init__.pyi +0 -9
  39. aip_agents/agent/base_agent.pyi +0 -221
  40. aip_agents/agent/base_langgraph_agent.pyi +0 -233
  41. aip_agents/agent/google_adk_agent.pyi +0 -141
  42. aip_agents/agent/google_adk_constants.pyi +0 -3
  43. aip_agents/agent/hitl/__init__.pyi +0 -6
  44. aip_agents/agent/hitl/config.pyi +0 -15
  45. aip_agents/agent/hitl/langgraph_hitl_mixin.pyi +0 -42
  46. aip_agents/agent/hitl/manager.pyi +0 -200
  47. aip_agents/agent/hitl/models.pyi +0 -3
  48. aip_agents/agent/hitl/prompt/__init__.pyi +0 -4
  49. aip_agents/agent/hitl/prompt/base.pyi +0 -24
  50. aip_agents/agent/hitl/prompt/deferred.pyi +0 -30
  51. aip_agents/agent/hitl/registry.pyi +0 -101
  52. aip_agents/agent/interface.pyi +0 -81
  53. aip_agents/agent/interfaces.pyi +0 -44
  54. aip_agents/agent/langflow_agent.pyi +0 -133
  55. aip_agents/agent/langgraph_memory_enhancer_agent.pyi +0 -50
  56. aip_agents/agent/langgraph_react_agent.pyi +0 -170
  57. aip_agents/agent/system_instruction_context.pyi +0 -13
  58. aip_agents/clients/__init__.pyi +0 -4
  59. aip_agents/clients/langflow/__init__.pyi +0 -4
  60. aip_agents/clients/langflow/client.pyi +0 -140
  61. aip_agents/clients/langflow/types.pyi +0 -7
  62. aip_agents/constants.pyi +0 -7
  63. aip_agents/examples/__init__.pyi +0 -0
  64. aip_agents/examples/compare_streaming_client.pyi +0 -48
  65. aip_agents/examples/compare_streaming_server.pyi +0 -18
  66. aip_agents/examples/hello_world_a2a_google_adk_client.pyi +0 -9
  67. aip_agents/examples/hello_world_a2a_google_adk_client_agent.pyi +0 -9
  68. aip_agents/examples/hello_world_a2a_google_adk_client_streaming.pyi +0 -9
  69. aip_agents/examples/hello_world_a2a_google_adk_server.pyi +0 -15
  70. aip_agents/examples/hello_world_a2a_langchain_client.pyi +0 -5
  71. aip_agents/examples/hello_world_a2a_langchain_client_agent.pyi +0 -5
  72. aip_agents/examples/hello_world_a2a_langchain_client_lm_invoker.pyi +0 -5
  73. aip_agents/examples/hello_world_a2a_langchain_client_streaming.pyi +0 -5
  74. aip_agents/examples/hello_world_a2a_langchain_reference_client_streaming.pyi +0 -5
  75. aip_agents/examples/hello_world_a2a_langchain_reference_server.pyi +0 -15
  76. aip_agents/examples/hello_world_a2a_langchain_server.pyi +0 -15
  77. aip_agents/examples/hello_world_a2a_langchain_server_lm_invoker.pyi +0 -15
  78. aip_agents/examples/hello_world_a2a_langflow_client.pyi +0 -9
  79. aip_agents/examples/hello_world_a2a_langflow_server.pyi +0 -14
  80. aip_agents/examples/hello_world_a2a_langgraph_artifact_client.pyi +0 -5
  81. aip_agents/examples/hello_world_a2a_langgraph_artifact_client_streaming.pyi +0 -5
  82. aip_agents/examples/hello_world_a2a_langgraph_artifact_server.pyi +0 -16
  83. aip_agents/examples/hello_world_a2a_langgraph_client.pyi +0 -9
  84. aip_agents/examples/hello_world_a2a_langgraph_client_agent.pyi +0 -9
  85. aip_agents/examples/hello_world_a2a_langgraph_client_agent_lm_invoker.pyi +0 -2
  86. aip_agents/examples/hello_world_a2a_langgraph_client_streaming.pyi +0 -9
  87. aip_agents/examples/hello_world_a2a_langgraph_client_streaming_lm_invoker.pyi +0 -5
  88. aip_agents/examples/hello_world_a2a_langgraph_client_streaming_tool_streaming.pyi +0 -5
  89. aip_agents/examples/hello_world_a2a_langgraph_server.pyi +0 -14
  90. aip_agents/examples/hello_world_a2a_langgraph_server_lm_invoker.pyi +0 -15
  91. aip_agents/examples/hello_world_a2a_langgraph_server_tool_streaming.pyi +0 -15
  92. aip_agents/examples/hello_world_a2a_mcp_langgraph.pyi +0 -48
  93. aip_agents/examples/hello_world_a2a_three_level_agent_hierarchy_client.pyi +0 -48
  94. aip_agents/examples/hello_world_a2a_three_level_agent_hierarchy_server.pyi +0 -45
  95. aip_agents/examples/hello_world_a2a_with_metadata_langchain_client.pyi +0 -5
  96. aip_agents/examples/hello_world_a2a_with_metadata_langchain_server_lm_invoker.pyi +0 -15
  97. aip_agents/examples/hello_world_google_adk.pyi +0 -5
  98. aip_agents/examples/hello_world_google_adk_mcp_http.pyi +0 -5
  99. aip_agents/examples/hello_world_google_adk_mcp_http_stream.pyi +0 -5
  100. aip_agents/examples/hello_world_google_adk_mcp_sse.pyi +0 -5
  101. aip_agents/examples/hello_world_google_adk_mcp_sse_stream.pyi +0 -5
  102. aip_agents/examples/hello_world_google_adk_mcp_stdio.pyi +0 -5
  103. aip_agents/examples/hello_world_google_adk_mcp_stdio_stream.pyi +0 -5
  104. aip_agents/examples/hello_world_google_adk_stream.pyi +0 -5
  105. aip_agents/examples/hello_world_langchain.pyi +0 -5
  106. aip_agents/examples/hello_world_langchain_lm_invoker.pyi +0 -2
  107. aip_agents/examples/hello_world_langchain_mcp_http.pyi +0 -5
  108. aip_agents/examples/hello_world_langchain_mcp_http_interactive.pyi +0 -16
  109. aip_agents/examples/hello_world_langchain_mcp_http_stream.pyi +0 -5
  110. aip_agents/examples/hello_world_langchain_mcp_multi_server.pyi +0 -18
  111. aip_agents/examples/hello_world_langchain_mcp_sse.pyi +0 -5
  112. aip_agents/examples/hello_world_langchain_mcp_sse_stream.pyi +0 -5
  113. aip_agents/examples/hello_world_langchain_mcp_stdio.pyi +0 -5
  114. aip_agents/examples/hello_world_langchain_mcp_stdio_stream.pyi +0 -5
  115. aip_agents/examples/hello_world_langchain_stream.pyi +0 -5
  116. aip_agents/examples/hello_world_langchain_stream_lm_invoker.pyi +0 -5
  117. aip_agents/examples/hello_world_langflow_agent.pyi +0 -35
  118. aip_agents/examples/hello_world_langgraph.pyi +0 -5
  119. aip_agents/examples/hello_world_langgraph_gl_connector_twitter.pyi +0 -5
  120. aip_agents/examples/hello_world_langgraph_mcp_http.pyi +0 -5
  121. aip_agents/examples/hello_world_langgraph_mcp_http_stream.pyi +0 -5
  122. aip_agents/examples/hello_world_langgraph_mcp_sse.pyi +0 -5
  123. aip_agents/examples/hello_world_langgraph_mcp_sse_stream.pyi +0 -5
  124. aip_agents/examples/hello_world_langgraph_mcp_stdio.pyi +0 -5
  125. aip_agents/examples/hello_world_langgraph_mcp_stdio_stream.pyi +0 -5
  126. aip_agents/examples/hello_world_langgraph_stream.pyi +0 -5
  127. aip_agents/examples/hello_world_langgraph_stream_lm_invoker.pyi +0 -5
  128. aip_agents/examples/hello_world_model_switch_cli.pyi +0 -30
  129. aip_agents/examples/hello_world_multi_agent_adk.pyi +0 -6
  130. aip_agents/examples/hello_world_multi_agent_langchain.pyi +0 -5
  131. aip_agents/examples/hello_world_multi_agent_langgraph.pyi +0 -5
  132. aip_agents/examples/hello_world_multi_agent_langgraph_lm_invoker.pyi +0 -5
  133. aip_agents/examples/hello_world_pii_logger.pyi +0 -5
  134. aip_agents/examples/hello_world_ptc.pyi +0 -5
  135. aip_agents/examples/hello_world_sentry.pyi +0 -21
  136. aip_agents/examples/hello_world_step_limits.pyi +0 -17
  137. aip_agents/examples/hello_world_stock_a2a_server.pyi +0 -17
  138. aip_agents/examples/hello_world_tool_output_client.pyi +0 -5
  139. aip_agents/examples/hello_world_tool_output_server.pyi +0 -19
  140. aip_agents/examples/hitl_demo.pyi +0 -67
  141. aip_agents/examples/pii_demo_langgraph_client.pyi +0 -5
  142. aip_agents/examples/pii_demo_langgraph_server.pyi +0 -20
  143. aip_agents/examples/pii_demo_multi_agent_client.pyi +0 -5
  144. aip_agents/examples/pii_demo_multi_agent_server.pyi +0 -40
  145. aip_agents/examples/todolist_planning_a2a_langchain_client.pyi +0 -5
  146. aip_agents/examples/todolist_planning_a2a_langgraph_server.pyi +0 -19
  147. aip_agents/examples/tools/__init__.pyi +0 -9
  148. aip_agents/examples/tools/adk_arithmetic_tools.pyi +0 -24
  149. aip_agents/examples/tools/adk_weather_tool.pyi +0 -18
  150. aip_agents/examples/tools/data_generator_tool.pyi +0 -15
  151. aip_agents/examples/tools/data_visualization_tool.pyi +0 -19
  152. aip_agents/examples/tools/image_artifact_tool.pyi +0 -26
  153. aip_agents/examples/tools/langchain_arithmetic_tools.pyi +0 -17
  154. aip_agents/examples/tools/langchain_currency_exchange_tool.pyi +0 -20
  155. aip_agents/examples/tools/langchain_graph_artifact_tool.pyi +0 -25
  156. aip_agents/examples/tools/langchain_weather_tool.pyi +0 -19
  157. aip_agents/examples/tools/langgraph_streaming_tool.pyi +0 -43
  158. aip_agents/examples/tools/mock_retrieval_tool.pyi +0 -13
  159. aip_agents/examples/tools/pii_demo_tools.pyi +0 -54
  160. aip_agents/examples/tools/random_chart_tool.pyi +0 -20
  161. aip_agents/examples/tools/serper_tool.pyi +0 -16
  162. aip_agents/examples/tools/stock_tools.pyi +0 -36
  163. aip_agents/examples/tools/table_generator_tool.pyi +0 -22
  164. aip_agents/examples/tools/time_tool.pyi +0 -15
  165. aip_agents/examples/tools/weather_forecast_tool.pyi +0 -14
  166. aip_agents/guardrails/__init__.pyi +0 -6
  167. aip_agents/guardrails/engines/__init__.pyi +0 -4
  168. aip_agents/guardrails/engines/base.pyi +0 -61
  169. aip_agents/guardrails/engines/nemo.pyi +0 -46
  170. aip_agents/guardrails/engines/phrase_matcher.pyi +0 -48
  171. aip_agents/guardrails/exceptions.pyi +0 -23
  172. aip_agents/guardrails/manager.pyi +0 -42
  173. aip_agents/guardrails/middleware.pyi +0 -87
  174. aip_agents/guardrails/schemas.pyi +0 -43
  175. aip_agents/guardrails/utils.pyi +0 -19
  176. aip_agents/mcp/__init__.pyi +0 -0
  177. aip_agents/mcp/client/__init__.pyi +0 -5
  178. aip_agents/mcp/client/base_mcp_client.pyi +0 -148
  179. aip_agents/mcp/client/connection_manager.pyi +0 -51
  180. aip_agents/mcp/client/google_adk/__init__.pyi +0 -3
  181. aip_agents/mcp/client/google_adk/client.pyi +0 -75
  182. aip_agents/mcp/client/langchain/__init__.pyi +0 -3
  183. aip_agents/mcp/client/langchain/client.pyi +0 -48
  184. aip_agents/mcp/client/persistent_session.pyi +0 -122
  185. aip_agents/mcp/client/session_pool.pyi +0 -101
  186. aip_agents/mcp/client/transports.pyi +0 -132
  187. aip_agents/mcp/utils/__init__.pyi +0 -0
  188. aip_agents/mcp/utils/config_validator.pyi +0 -82
  189. aip_agents/memory/__init__.pyi +0 -5
  190. aip_agents/memory/adapters/__init__.pyi +0 -4
  191. aip_agents/memory/adapters/base_adapter.pyi +0 -176
  192. aip_agents/memory/adapters/mem0.pyi +0 -22
  193. aip_agents/memory/base.pyi +0 -60
  194. aip_agents/memory/constants.pyi +0 -25
  195. aip_agents/memory/factory.pyi +0 -24
  196. aip_agents/memory/guidance.pyi +0 -3
  197. aip_agents/memory/simple_memory.pyi +0 -23
  198. aip_agents/middleware/__init__.pyi +0 -5
  199. aip_agents/middleware/base.pyi +0 -75
  200. aip_agents/middleware/manager.pyi +0 -84
  201. aip_agents/middleware/todolist.pyi +0 -125
  202. aip_agents/ptc/__init__.pyi +0 -10
  203. aip_agents/ptc/doc_gen.pyi +0 -40
  204. aip_agents/ptc/exceptions.pyi +0 -22
  205. aip_agents/ptc/executor.pyi +0 -73
  206. aip_agents/ptc/mcp/__init__.pyi +0 -7
  207. aip_agents/ptc/mcp/sandbox_bridge.pyi +0 -47
  208. aip_agents/ptc/mcp/templates/__init__.pyi +0 -0
  209. aip_agents/ptc/naming.pyi +0 -76
  210. aip_agents/ptc/payload.pyi +0 -15
  211. aip_agents/ptc/prompt_builder.pyi +0 -55
  212. aip_agents/ptc/ptc_helper.pyi +0 -1
  213. aip_agents/ptc/sandbox_bridge.pyi +0 -25
  214. aip_agents/ptc/template_utils.pyi +0 -13
  215. aip_agents/ptc/templates/__init__.pyi +0 -0
  216. aip_agents/sandbox/__init__.pyi +0 -5
  217. aip_agents/sandbox/defaults.pyi +0 -2
  218. aip_agents/sandbox/e2b_runtime.pyi +0 -51
  219. aip_agents/sandbox/template_builder.pyi +0 -36
  220. aip_agents/sandbox/types.pyi +0 -14
  221. aip_agents/sandbox/validation.pyi +0 -20
  222. aip_agents/schema/__init__.pyi +0 -9
  223. aip_agents/schema/a2a.pyi +0 -40
  224. aip_agents/schema/agent.pyi +0 -65
  225. aip_agents/schema/hitl.pyi +0 -89
  226. aip_agents/schema/langgraph.pyi +0 -28
  227. aip_agents/schema/model_id.pyi +0 -54
  228. aip_agents/schema/step_limit.pyi +0 -63
  229. aip_agents/schema/storage.pyi +0 -21
  230. aip_agents/sentry/__init__.pyi +0 -3
  231. aip_agents/sentry/sentry.pyi +0 -48
  232. aip_agents/storage/__init__.pyi +0 -8
  233. aip_agents/storage/base.pyi +0 -58
  234. aip_agents/storage/clients/__init__.pyi +0 -3
  235. aip_agents/storage/clients/minio_client.pyi +0 -137
  236. aip_agents/storage/config.pyi +0 -29
  237. aip_agents/storage/providers/__init__.pyi +0 -5
  238. aip_agents/storage/providers/base.pyi +0 -88
  239. aip_agents/storage/providers/memory.pyi +0 -79
  240. aip_agents/storage/providers/object_storage.pyi +0 -98
  241. aip_agents/tools/__init__.pyi +0 -11
  242. aip_agents/tools/browser_use/__init__.pyi +0 -14
  243. aip_agents/tools/browser_use/action_parser.pyi +0 -18
  244. aip_agents/tools/browser_use/browser_use_tool.pyi +0 -50
  245. aip_agents/tools/browser_use/llm_config.pyi +0 -52
  246. aip_agents/tools/browser_use/minio_storage.pyi +0 -109
  247. aip_agents/tools/browser_use/schemas.pyi +0 -32
  248. aip_agents/tools/browser_use/session.pyi +0 -4
  249. aip_agents/tools/browser_use/session_errors.pyi +0 -53
  250. aip_agents/tools/browser_use/steel_session_recording.pyi +0 -63
  251. aip_agents/tools/browser_use/streaming.pyi +0 -81
  252. aip_agents/tools/browser_use/structured_data_parser.pyi +0 -86
  253. aip_agents/tools/browser_use/structured_data_recovery.pyi +0 -43
  254. aip_agents/tools/browser_use/types.pyi +0 -45
  255. aip_agents/tools/code_sandbox/__init__.pyi +0 -3
  256. aip_agents/tools/code_sandbox/constant.pyi +0 -4
  257. aip_agents/tools/code_sandbox/e2b_cloud_sandbox_extended.pyi +0 -102
  258. aip_agents/tools/code_sandbox/e2b_sandbox_tool.pyi +0 -29
  259. aip_agents/tools/constants.pyi +0 -138
  260. aip_agents/tools/date_range_tool.pyi +0 -21
  261. aip_agents/tools/document_loader/__init__.pyi +0 -7
  262. aip_agents/tools/document_loader/base_reader.pyi +0 -75
  263. aip_agents/tools/document_loader/docx_reader_tool.pyi +0 -10
  264. aip_agents/tools/document_loader/excel_reader_tool.pyi +0 -26
  265. aip_agents/tools/document_loader/pdf_reader_tool.pyi +0 -11
  266. aip_agents/tools/document_loader/pdf_splitter.pyi +0 -18
  267. aip_agents/tools/execute_ptc_code.pyi +0 -90
  268. aip_agents/tools/gl_connector/__init__.pyi +0 -3
  269. aip_agents/tools/gl_connector/tool.pyi +0 -74
  270. aip_agents/tools/gl_connector_tools.pyi +0 -39
  271. aip_agents/tools/memory_search/__init__.pyi +0 -5
  272. aip_agents/tools/memory_search/base.pyi +0 -69
  273. aip_agents/tools/memory_search/mem0.pyi +0 -29
  274. aip_agents/tools/memory_search/schema.pyi +0 -25
  275. aip_agents/tools/memory_search_tool.pyi +0 -3
  276. aip_agents/tools/time_tool.pyi +0 -16
  277. aip_agents/tools/tool_config_injector.pyi +0 -26
  278. aip_agents/tools/web_search/__init__.pyi +0 -3
  279. aip_agents/tools/web_search/serper_tool.pyi +0 -19
  280. aip_agents/types/__init__.pyi +0 -36
  281. aip_agents/types/a2a_events.pyi +0 -3
  282. aip_agents/utils/__init__.pyi +0 -11
  283. aip_agents/utils/a2a_connector.pyi +0 -146
  284. aip_agents/utils/artifact_helpers.pyi +0 -203
  285. aip_agents/utils/constants.pyi +0 -10
  286. aip_agents/utils/datetime/__init__.pyi +0 -4
  287. aip_agents/utils/datetime/normalization.pyi +0 -95
  288. aip_agents/utils/datetime/timezone.pyi +0 -48
  289. aip_agents/utils/env_loader.pyi +0 -10
  290. aip_agents/utils/event_handler_registry.pyi +0 -23
  291. aip_agents/utils/file_prompt_utils.pyi +0 -21
  292. aip_agents/utils/final_response_builder.pyi +0 -34
  293. aip_agents/utils/formatter_llm_client.pyi +0 -71
  294. aip_agents/utils/langgraph/__init__.pyi +0 -3
  295. aip_agents/utils/langgraph/converter.pyi +0 -49
  296. aip_agents/utils/langgraph/tool_managers/__init__.pyi +0 -5
  297. aip_agents/utils/langgraph/tool_managers/a2a_tool_manager.pyi +0 -35
  298. aip_agents/utils/langgraph/tool_managers/base_tool_manager.pyi +0 -48
  299. aip_agents/utils/langgraph/tool_managers/delegation_tool_manager.pyi +0 -56
  300. aip_agents/utils/langgraph/tool_output_management.pyi +0 -329
  301. aip_agents/utils/logger.pyi +0 -60
  302. aip_agents/utils/metadata/__init__.pyi +0 -5
  303. aip_agents/utils/metadata/activity_metadata_helper.pyi +0 -25
  304. aip_agents/utils/metadata/activity_narrative/__init__.pyi +0 -7
  305. aip_agents/utils/metadata/activity_narrative/builder.pyi +0 -35
  306. aip_agents/utils/metadata/activity_narrative/constants.pyi +0 -10
  307. aip_agents/utils/metadata/activity_narrative/context.pyi +0 -32
  308. aip_agents/utils/metadata/activity_narrative/formatters.pyi +0 -48
  309. aip_agents/utils/metadata/activity_narrative/utils.pyi +0 -12
  310. aip_agents/utils/metadata/schemas/__init__.pyi +0 -4
  311. aip_agents/utils/metadata/schemas/activity_schema.pyi +0 -18
  312. aip_agents/utils/metadata/schemas/thinking_schema.pyi +0 -20
  313. aip_agents/utils/metadata/thinking_metadata_helper.pyi +0 -4
  314. aip_agents/utils/metadata_helper.pyi +0 -117
  315. aip_agents/utils/name_preprocessor/__init__.pyi +0 -6
  316. aip_agents/utils/name_preprocessor/base_name_preprocessor.pyi +0 -52
  317. aip_agents/utils/name_preprocessor/google_name_preprocessor.pyi +0 -38
  318. aip_agents/utils/name_preprocessor/name_preprocessor.pyi +0 -41
  319. aip_agents/utils/name_preprocessor/openai_name_preprocessor.pyi +0 -34
  320. aip_agents/utils/pii/__init__.pyi +0 -5
  321. aip_agents/utils/pii/pii_handler.pyi +0 -96
  322. aip_agents/utils/pii/pii_helper.pyi +0 -78
  323. aip_agents/utils/pii/uuid_deanonymizer_mapping.pyi +0 -73
  324. aip_agents/utils/reference_helper.pyi +0 -81
  325. aip_agents/utils/sse_chunk_transformer.pyi +0 -166
  326. aip_agents/utils/step_limit_manager.pyi +0 -112
  327. aip_agents/utils/token_usage_helper.pyi +0 -60
  328. aip_agents_binary-0.6.4.dist-info/RECORD +0 -612
  329. {aip_agents_binary-0.6.4.dist-info → aip_agents_binary-0.6.6.dist-info}/WHEEL +0 -0
  330. {aip_agents_binary-0.6.4.dist-info → aip_agents_binary-0.6.6.dist-info}/top_level.txt +0 -0
@@ -6,13 +6,25 @@ Author:
6
6
  Christian Trisno Sen Long Chen (christian.t.s.l.chen@gdplabs.id)
7
7
  """
8
8
 
9
+ from __future__ import annotations
10
+
11
+ from typing import TYPE_CHECKING, Any
12
+
9
13
  from aip_agents.agent.base_agent import BaseAgent
14
+
15
+ if TYPE_CHECKING:
16
+ from aip_agents.agent.google_adk_agent import GoogleADKAgent
17
+ from aip_agents.agent.langflow_agent import LangflowAgent
10
18
  from aip_agents.agent.base_langgraph_agent import BaseLangGraphAgent
11
- from aip_agents.agent.google_adk_agent import GoogleADKAgent
12
19
  from aip_agents.agent.interface import AgentInterface
13
- from aip_agents.agent.langflow_agent import LangflowAgent
14
- from aip_agents.agent.langgraph_memory_enhancer_agent import LangGraphMemoryEnhancerAgent
15
- from aip_agents.agent.langgraph_react_agent import LangChainAgent, LangGraphAgent, LangGraphReactAgent
20
+ from aip_agents.agent.langgraph_memory_enhancer_agent import (
21
+ LangGraphMemoryEnhancerAgent,
22
+ )
23
+ from aip_agents.agent.langgraph_react_agent import (
24
+ LangChainAgent,
25
+ LangGraphAgent,
26
+ LangGraphReactAgent,
27
+ )
16
28
 
17
29
  __all__ = [
18
30
  "AgentInterface",
@@ -25,3 +37,31 @@ __all__ = [
25
37
  "LangflowAgent",
26
38
  "LangGraphMemoryEnhancerAgent",
27
39
  ]
40
+
41
+
42
+ def __getattr__(name: str) -> Any:
43
+ """Lazy import of heavy agent implementations.
44
+
45
+ This avoids importing heavy dependencies (Google ADK, etc.)
46
+ when they are not needed.
47
+
48
+ Args:
49
+ name: Attribute name to import.
50
+
51
+ Returns:
52
+ The requested class.
53
+
54
+ Raises:
55
+ AttributeError: If attribute is not found.
56
+ """
57
+ if name == "GoogleADKAgent":
58
+ from aip_agents.agent.google_adk_agent import (
59
+ GoogleADKAgent as _GoogleADKAgent,
60
+ )
61
+
62
+ return _GoogleADKAgent
63
+ elif name == "LangflowAgent":
64
+ from aip_agents.agent.langflow_agent import LangflowAgent as _LangflowAgent
65
+
66
+ return _LangflowAgent
67
+ raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
@@ -2723,12 +2723,35 @@ class LangGraphReactAgent(LangGraphHitLMixin, BaseLangGraphAgent):
2723
2723
  # Attempt to sync PTC tool if MCP client is available
2724
2724
  self._sync_ptc_tool()
2725
2725
 
2726
+ def _enrich_custom_tool_metadata(self) -> None:
2727
+ """Enrich custom tool definitions with metadata from agent's tools.
2728
+
2729
+ This method matches custom tool definitions in ptc_config with actual tool
2730
+ objects from self.tools and enriches them with description and input_schema.
2731
+ Called at PTC sync time to ensure tool definitions have accurate metadata.
2732
+
2733
+ The matching is done by comparing tool names (both original and sanitized).
2734
+
2735
+ Note: This method modifies self._ptc_config.custom_tools.tools in-place.
2736
+ """
2737
+ if not self._ptc_config:
2738
+ return
2739
+
2740
+ # Lazy import to avoid circular dependencies
2741
+ from aip_agents.ptc import enrich_custom_tools_from_agent
2742
+
2743
+ enrich_custom_tools_from_agent(
2744
+ self._ptc_config.custom_tools,
2745
+ self.tools,
2746
+ agent_name=self.name,
2747
+ )
2748
+
2726
2749
  def _sync_ptc_tool(self) -> None:
2727
- """Build and register the execute_ptc_code tool when MCP servers are available.
2750
+ """Build and register the execute_ptc_code tool when MCP or custom tools are available.
2728
2751
 
2729
2752
  This method is called after enable_ptc() and after MCP servers are added.
2730
2753
  It creates the execute_ptc_code tool using the current MCP client
2731
- configuration and adds it to the agent's resolved tools.
2754
+ configuration and/or custom tools config and adds it to the agent's resolved tools.
2732
2755
 
2733
2756
  The tool is only created once. Subsequent calls are no-ops if the tool
2734
2757
  has already been synced.
@@ -2739,27 +2762,40 @@ class LangGraphReactAgent(LangGraphHitLMixin, BaseLangGraphAgent):
2739
2762
  if self._ptc_tool_synced:
2740
2763
  return
2741
2764
 
2742
- # Check if we have MCP servers configured
2743
- if not self.mcp_config:
2744
- logger.debug(f"Agent '{self.name}': PTC tool sync deferred - no MCP servers configured")
2745
- return
2765
+ # Check if we have custom tools enabled
2766
+ has_custom_tools = self._ptc_config.custom_tools.enabled and self._ptc_config.custom_tools.tools
2767
+ has_mcp_servers = bool(self.mcp_config)
2746
2768
 
2747
- if not self.mcp_client:
2748
- logger.debug(f"Agent '{self.name}': PTC tool sync deferred - no MCP client yet")
2749
- return
2769
+ if has_mcp_servers:
2770
+ if not self.mcp_client:
2771
+ logger.debug(f"Agent '{self.name}': PTC tool sync deferred - no MCP client yet")
2772
+ return
2750
2773
 
2751
- if not self.mcp_client.is_initialized:
2752
- logger.debug(f"Agent '{self.name}': PTC tool sync deferred - MCP client not initialized")
2774
+ if not self.mcp_client.is_initialized:
2775
+ logger.debug(f"Agent '{self.name}': PTC tool sync deferred - MCP client not initialized")
2776
+ return
2777
+
2778
+ mcp_client_to_use = self.mcp_client
2779
+ elif has_custom_tools:
2780
+ mcp_client_to_use = None
2781
+ else:
2753
2782
  return
2754
2783
 
2784
+ # Enrich custom tool definitions with metadata from actual tool objects
2785
+ if has_custom_tools:
2786
+ self._enrich_custom_tool_metadata()
2787
+
2755
2788
  # Lazy import to avoid circular dependencies
2756
2789
  from aip_agents.tools.execute_ptc_code import create_execute_ptc_code_tool
2757
2790
 
2758
- logger.info(f"Agent '{self.name}': Syncing PTC tool with MCP client")
2791
+ if has_custom_tools and not mcp_client_to_use:
2792
+ logger.info(f"Agent '{self.name}': Syncing PTC tool with custom tools only (no MCP)")
2793
+ else:
2794
+ logger.info(f"Agent '{self.name}': Syncing PTC tool with MCP client")
2759
2795
 
2760
2796
  # Create the execute_ptc_code tool with agent's tool configs
2761
2797
  self._ptc_tool = create_execute_ptc_code_tool(
2762
- self.mcp_client, self._ptc_config, agent_tool_configs=self.tool_configs
2798
+ mcp_client_to_use, self._ptc_config, agent_tool_configs=self.tool_configs
2763
2799
  )
2764
2800
 
2765
2801
  # Rebuild graph to include PTC tool
@@ -2776,28 +2812,39 @@ class LangGraphReactAgent(LangGraphHitLMixin, BaseLangGraphAgent):
2776
2812
 
2777
2813
  This method builds and injects a PTC usage block into the agent's
2778
2814
  instruction when PTC is enabled. The prompt is refreshed when MCP
2779
- configuration changes (detected via hash).
2815
+ or custom tools configuration changes (detected via hash).
2780
2816
  """
2781
2817
  if not self._ptc_config or not self._ptc_config.enabled:
2782
2818
  return
2783
2819
 
2784
- if not self.mcp_client:
2820
+ # Check if we have custom tools enabled
2821
+ has_custom_tools = self._ptc_config.custom_tools.enabled and self._ptc_config.custom_tools.tools
2822
+
2823
+ # For custom-only configs, allow None mcp_client
2824
+ # For MCP-only or MCP+custom, require mcp_client
2825
+ if not has_custom_tools and not self.mcp_client:
2785
2826
  return
2786
2827
 
2787
2828
  # Lazy import to avoid circular dependencies
2788
2829
  from aip_agents.ptc.prompt_builder import build_ptc_prompt, compute_ptc_prompt_hash
2789
2830
 
2790
- # Get prompt config from PTC sandbox config
2831
+ # Get prompt config and custom tools config from PTC sandbox config
2791
2832
  prompt_config = self._ptc_config.prompt if self._ptc_config else None
2833
+ custom_tools_config = self._ptc_config.custom_tools if self._ptc_config else None
2792
2834
 
2793
- # Check if MCP config has changed
2794
- current_hash = compute_ptc_prompt_hash(self.mcp_client, config=prompt_config)
2835
+ # Use mcp_client if available, None for custom-only
2836
+ mcp_client_to_use = self.mcp_client if self.mcp_client else None
2837
+
2838
+ # Check if MCP or custom tools config has changed
2839
+ current_hash = compute_ptc_prompt_hash(
2840
+ mcp_client_to_use, config=prompt_config, custom_tools_config=custom_tools_config
2841
+ )
2795
2842
  if current_hash == self._ptc_prompt_hash:
2796
2843
  logger.debug(f"Agent '{self.name}': PTC prompt unchanged, skipping refresh")
2797
2844
  return
2798
2845
 
2799
2846
  # Build and inject the prompt
2800
- ptc_prompt = build_ptc_prompt(self.mcp_client, config=prompt_config)
2847
+ ptc_prompt = build_ptc_prompt(mcp_client_to_use, config=prompt_config, custom_tools_config=custom_tools_config)
2801
2848
 
2802
2849
  # Rebuild instruction from original + PTC guidance
2803
2850
  self.instruction = f"{self._original_instruction}\n\n{ptc_prompt}"
@@ -0,0 +1,83 @@
1
+ """Minimal PTC hello world example with custom tools.
2
+
3
+ Author: Putu Ravindra Wiguna (putu.r.wiguna@gdplabs.id)
4
+
5
+ Required environment variables:
6
+ - OPENAI_API_KEY
7
+ - E2B_API_KEY
8
+ """
9
+
10
+ import asyncio
11
+ import json
12
+ from pathlib import Path
13
+
14
+ from langchain_openai import ChatOpenAI
15
+
16
+ from aip_agents.agent import LangGraphReactAgent
17
+ from aip_agents.examples.tools.multiply_tool import MultiplyTool
18
+ from aip_agents.ptc import PromptConfig, PTCCustomToolConfig, PTCSandboxConfig, file_tool, package_tool
19
+ from aip_agents.tools.time_tool import TimeTool
20
+
21
+
22
+ async def main() -> None:
23
+ """Run a hello-world PTC flow with custom tools."""
24
+ repo_root = Path.cwd()
25
+ multiply_tool_path = repo_root / "aip_agents/examples/tools/multiply_tool.py"
26
+
27
+ instruction = (
28
+ "You are a helpful assistant with access to execute_ptc_code. "
29
+ "Use execute_ptc_code to run Python and print output. "
30
+ "Custom tools are available under tools.custom (import with "
31
+ "'from tools.custom import <tool_name>')."
32
+ )
33
+
34
+ agent = LangGraphReactAgent(
35
+ name="ptc_custom_tools_hello_world",
36
+ instruction=instruction,
37
+ model=ChatOpenAI(model="gpt-5.2"),
38
+ tools=[TimeTool(), MultiplyTool()],
39
+ tool_configs={"multiply": {"offset": 20}},
40
+ ptc_config=PTCSandboxConfig(
41
+ enabled=True,
42
+ sandbox_timeout=180.0,
43
+ prompt=PromptConfig(mode="auto"),
44
+ custom_tools=PTCCustomToolConfig(
45
+ enabled=True,
46
+ bundle_roots=[str(repo_root)],
47
+ requirements=[],
48
+ tools=[
49
+ package_tool(
50
+ "time_tool",
51
+ import_path="aip_agents.tools.time_tool",
52
+ class_name="TimeTool",
53
+ ),
54
+ file_tool(
55
+ "multiply",
56
+ file_path=str(multiply_tool_path),
57
+ class_name="MultiplyTool",
58
+ ),
59
+ ],
60
+ ),
61
+ ),
62
+ )
63
+
64
+ try:
65
+ # Pass tool config at runtime via metadata
66
+ # The multiply tool will use offset=10, so multiply(a=6, b=7) returns 6*7+10=52
67
+ print("execute_ptc_code output: ", end="")
68
+ last_chunk = None
69
+ async for chunk in agent.arun_sse_stream(
70
+ query=("Use execute_ptc_code to import from tools.custom. Print time_tool() and multiply(a=6, b=7)."),
71
+ metadata={"tool_configs": {"multiply": {"offset": 10}}},
72
+ ):
73
+ last_chunk = chunk
74
+ print(json.dumps(chunk))
75
+ print("-" * 20)
76
+ finally:
77
+ await agent.cleanup()
78
+
79
+ print("execute_ptc_code output: ", last_chunk["content"])
80
+
81
+
82
+ if __name__ == "__main__":
83
+ asyncio.run(main())
@@ -0,0 +1,43 @@
1
+ """Tool to multiply two integers.
2
+
3
+ Author: Putu Ravindra Wiguna (putu.r.wiguna@gdplabs.id)
4
+ """
5
+
6
+ from langchain_core.tools import BaseTool
7
+ from pydantic import BaseModel, Field
8
+
9
+
10
+ class MultiplyToolInput(BaseModel):
11
+ """Input schema for the MultiplyTool."""
12
+
13
+ a: int = Field(..., description="First factor.")
14
+ b: int = Field(..., description="Second factor.")
15
+
16
+
17
+ class MultiplyToolConfig(BaseModel):
18
+ """Configuration for MultiplyTool."""
19
+
20
+ offset: int = Field(default=0, description="Offset to add to the result.")
21
+
22
+
23
+ class MultiplyTool(BaseTool):
24
+ """Tool to multiply two integers."""
25
+
26
+ name: str = "multiply"
27
+ description: str = "Multiply two integers."
28
+ args_schema: type[BaseModel] = MultiplyToolInput
29
+ tool_config_schema: type[BaseModel] = MultiplyToolConfig
30
+
31
+ def _run(self, a: int, b: int) -> int:
32
+ """Return the product of two integers."""
33
+ offset = 0
34
+ if hasattr(self, "get_tool_config"):
35
+ config = self.get_tool_config()
36
+ if config:
37
+ offset = getattr(config, "offset", 0)
38
+
39
+ return a * b + offset
40
+
41
+ async def _arun(self, a: int, b: int) -> int:
42
+ """Return the product of two integers asynchronously."""
43
+ return self._run(a=a, b=b)
@@ -7,8 +7,44 @@ Authors:
7
7
  Putu Ravindra Wiguna (putu.r.wiguna@gdplabs.id)
8
8
  """
9
9
 
10
+ from __future__ import annotations
11
+
12
+ from typing import TYPE_CHECKING, Any
13
+
10
14
  from aip_agents.mcp.client.base_mcp_client import BaseMCPClient
11
- from aip_agents.mcp.client.google_adk.client import GoogleADKMCPClient
12
- from aip_agents.mcp.client.langchain.client import LangchainMCPClient
15
+
16
+ if TYPE_CHECKING:
17
+ from aip_agents.mcp.client.google_adk.client import GoogleADKMCPClient
18
+ from aip_agents.mcp.client.langchain.client import LangchainMCPClient
13
19
 
14
20
  __all__ = ["GoogleADKMCPClient", "LangchainMCPClient", "BaseMCPClient"]
21
+
22
+
23
+ def __getattr__(name: str) -> Any:
24
+ """Lazy import of MCP client implementations.
25
+
26
+ This avoids importing heavy dependencies (Google ADK, Vertex AI, etc.)
27
+ when they are not needed.
28
+
29
+ Args:
30
+ name: Attribute name to import.
31
+
32
+ Returns:
33
+ The requested class.
34
+
35
+ Raises:
36
+ AttributeError: If attribute is not found.
37
+ """
38
+ if name == "GoogleADKMCPClient":
39
+ from aip_agents.mcp.client.google_adk.client import (
40
+ GoogleADKMCPClient as _GoogleADKMCPClient,
41
+ )
42
+
43
+ return _GoogleADKMCPClient
44
+ elif name == "LangchainMCPClient":
45
+ from aip_agents.mcp.client.langchain.client import (
46
+ LangchainMCPClient as _LangchainMCPClient,
47
+ )
48
+
49
+ return _LangchainMCPClient
50
+ raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
@@ -1,22 +1,61 @@
1
- """PTC (Programmatic Tool Calling) core module (MCP-only).
1
+ """PTC (Programmatic Tool Calling) core module.
2
2
 
3
- This module provides the core PTC functionality for MCP tools, including
4
- executor, prompt builder, and sandbox bridge.
3
+ This module provides core PTC functionality, including executor, prompt builder,
4
+ sandbox bridge, and custom tool configuration validation.
5
5
 
6
6
  Authors:
7
7
  Putu Ravindra Wiguna (putu.r.wiguna@gdplabs.id)
8
8
  """
9
9
 
10
+ from aip_agents.ptc.custom_tools import (
11
+ PTCCustomToolConfig,
12
+ PTCCustomToolValidationError,
13
+ PTCFileToolDef,
14
+ PTCPackageToolDef,
15
+ PTCToolDef,
16
+ enrich_tool_def_with_metadata,
17
+ extract_tool_metadata,
18
+ validate_custom_tool_config,
19
+ )
20
+ from aip_agents.ptc.custom_tools_payload import (
21
+ CustomToolPayloadResult,
22
+ build_custom_tools_payload,
23
+ )
10
24
  from aip_agents.ptc.exceptions import PTCError, PTCToolError
11
25
  from aip_agents.ptc.prompt_builder import PromptConfig, build_ptc_prompt, compute_ptc_prompt_hash
26
+ from aip_agents.ptc.tool_def_helpers import file_tool, package_tool
27
+ from aip_agents.ptc.tool_enrichment import (
28
+ build_tool_lookup,
29
+ enrich_custom_tools_from_agent,
30
+ match_tool_by_name,
31
+ )
12
32
 
13
33
  __all__ = [
14
34
  # Exceptions
15
35
  "PTCError",
16
36
  "PTCToolError",
37
+ "PTCCustomToolValidationError",
17
38
  # Executor
18
39
  "PTCSandboxConfig",
19
40
  "PTCSandboxExecutor",
41
+ # Custom tools
42
+ "PTCCustomToolConfig",
43
+ "PTCToolDef",
44
+ "PTCPackageToolDef",
45
+ "PTCFileToolDef",
46
+ "validate_custom_tool_config",
47
+ "extract_tool_metadata",
48
+ "enrich_tool_def_with_metadata",
49
+ # Tool enrichment
50
+ "build_tool_lookup",
51
+ "match_tool_by_name",
52
+ "enrich_custom_tools_from_agent",
53
+ # Tool definition helpers
54
+ "package_tool",
55
+ "file_tool",
56
+ # Custom tools payload
57
+ "CustomToolPayloadResult",
58
+ "build_custom_tools_payload",
20
59
  # Prompt builder
21
60
  "PromptConfig",
22
61
  "build_ptc_prompt",