aip-agents-binary 0.6.5__py3-none-macosx_13_0_arm64.whl → 0.6.6__py3-none-macosx_13_0_arm64.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.
- aip_agents/agent/langgraph_react_agent.py +66 -19
- aip_agents/examples/hello_world_ptc_custom_tools.py +83 -0
- aip_agents/examples/hello_world_ptc_custom_tools.pyi +7 -0
- aip_agents/examples/tools/multiply_tool.py +43 -0
- aip_agents/examples/tools/multiply_tool.pyi +18 -0
- aip_agents/ptc/__init__.py +42 -3
- aip_agents/ptc/__init__.pyi +5 -1
- aip_agents/ptc/custom_tools.py +473 -0
- aip_agents/ptc/custom_tools.pyi +184 -0
- aip_agents/ptc/custom_tools_payload.py +400 -0
- aip_agents/ptc/custom_tools_payload.pyi +31 -0
- aip_agents/ptc/custom_tools_templates/__init__.py +1 -0
- aip_agents/ptc/custom_tools_templates/__init__.pyi +0 -0
- aip_agents/ptc/custom_tools_templates/custom_build_function.py.template +23 -0
- aip_agents/ptc/custom_tools_templates/custom_init.py.template +15 -0
- aip_agents/ptc/custom_tools_templates/custom_invoke.py.template +60 -0
- aip_agents/ptc/custom_tools_templates/custom_registry.py.template +87 -0
- aip_agents/ptc/custom_tools_templates/custom_sources_init.py.template +7 -0
- aip_agents/ptc/custom_tools_templates/custom_wrapper.py.template +19 -0
- aip_agents/ptc/exceptions.py +18 -0
- aip_agents/ptc/exceptions.pyi +15 -0
- aip_agents/ptc/executor.py +151 -33
- aip_agents/ptc/executor.pyi +34 -8
- aip_agents/ptc/naming.py +13 -1
- aip_agents/ptc/naming.pyi +9 -0
- aip_agents/ptc/prompt_builder.py +118 -16
- aip_agents/ptc/prompt_builder.pyi +12 -8
- aip_agents/ptc/sandbox_bridge.py +206 -8
- aip_agents/ptc/sandbox_bridge.pyi +18 -5
- aip_agents/ptc/tool_def_helpers.py +101 -0
- aip_agents/ptc/tool_def_helpers.pyi +38 -0
- aip_agents/ptc/tool_enrichment.py +163 -0
- aip_agents/ptc/tool_enrichment.pyi +60 -0
- aip_agents/sandbox/defaults.py +197 -1
- aip_agents/sandbox/defaults.pyi +28 -0
- aip_agents/sandbox/e2b_runtime.py +28 -0
- aip_agents/sandbox/e2b_runtime.pyi +7 -1
- aip_agents/sandbox/template_builder.py +2 -2
- aip_agents/tools/execute_ptc_code.py +59 -10
- aip_agents/tools/execute_ptc_code.pyi +5 -5
- {aip_agents_binary-0.6.5.dist-info → aip_agents_binary-0.6.6.dist-info}/METADATA +3 -3
- {aip_agents_binary-0.6.5.dist-info → aip_agents_binary-0.6.6.dist-info}/RECORD +44 -24
- {aip_agents_binary-0.6.5.dist-info → aip_agents_binary-0.6.6.dist-info}/WHEEL +0 -0
- {aip_agents_binary-0.6.5.dist-info → aip_agents_binary-0.6.6.dist-info}/top_level.txt +0 -0
|
@@ -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
|
|
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
|
|
2743
|
-
|
|
2744
|
-
|
|
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
|
|
2748
|
-
|
|
2749
|
-
|
|
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
|
-
|
|
2752
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
#
|
|
2794
|
-
|
|
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(
|
|
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,7 @@
|
|
|
1
|
+
from aip_agents.agent import LangGraphReactAgent as LangGraphReactAgent
|
|
2
|
+
from aip_agents.examples.tools.multiply_tool import MultiplyTool as MultiplyTool
|
|
3
|
+
from aip_agents.ptc import PTCCustomToolConfig as PTCCustomToolConfig, PTCSandboxConfig as PTCSandboxConfig, PromptConfig as PromptConfig, file_tool as file_tool, package_tool as package_tool
|
|
4
|
+
from aip_agents.tools.time_tool import TimeTool as TimeTool
|
|
5
|
+
|
|
6
|
+
async def main() -> None:
|
|
7
|
+
"""Run a hello-world PTC flow with custom tools."""
|
|
@@ -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)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from langchain_core.tools import BaseTool
|
|
2
|
+
from pydantic import BaseModel
|
|
3
|
+
|
|
4
|
+
class MultiplyToolInput(BaseModel):
|
|
5
|
+
"""Input schema for the MultiplyTool."""
|
|
6
|
+
a: int
|
|
7
|
+
b: int
|
|
8
|
+
|
|
9
|
+
class MultiplyToolConfig(BaseModel):
|
|
10
|
+
"""Configuration for MultiplyTool."""
|
|
11
|
+
offset: int
|
|
12
|
+
|
|
13
|
+
class MultiplyTool(BaseTool):
|
|
14
|
+
"""Tool to multiply two integers."""
|
|
15
|
+
name: str
|
|
16
|
+
description: str
|
|
17
|
+
args_schema: type[BaseModel]
|
|
18
|
+
tool_config_schema: type[BaseModel]
|
aip_agents/ptc/__init__.py
CHANGED
|
@@ -1,22 +1,61 @@
|
|
|
1
|
-
"""PTC (Programmatic Tool Calling) core module
|
|
1
|
+
"""PTC (Programmatic Tool Calling) core module.
|
|
2
2
|
|
|
3
|
-
This module provides
|
|
4
|
-
|
|
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",
|
aip_agents/ptc/__init__.pyi
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
from aip_agents.ptc.custom_tools import PTCCustomToolConfig as PTCCustomToolConfig, PTCCustomToolValidationError as PTCCustomToolValidationError, PTCFileToolDef as PTCFileToolDef, PTCPackageToolDef as PTCPackageToolDef, PTCToolDef as PTCToolDef, enrich_tool_def_with_metadata as enrich_tool_def_with_metadata, extract_tool_metadata as extract_tool_metadata, validate_custom_tool_config as validate_custom_tool_config
|
|
2
|
+
from aip_agents.ptc.custom_tools_payload import CustomToolPayloadResult as CustomToolPayloadResult, build_custom_tools_payload as build_custom_tools_payload
|
|
1
3
|
from aip_agents.ptc.exceptions import PTCError as PTCError, PTCToolError as PTCToolError
|
|
2
4
|
from aip_agents.ptc.prompt_builder import PromptConfig as PromptConfig, build_ptc_prompt as build_ptc_prompt, compute_ptc_prompt_hash as compute_ptc_prompt_hash
|
|
5
|
+
from aip_agents.ptc.tool_def_helpers import file_tool as file_tool, package_tool as package_tool
|
|
6
|
+
from aip_agents.ptc.tool_enrichment import build_tool_lookup as build_tool_lookup, enrich_custom_tools_from_agent as enrich_custom_tools_from_agent, match_tool_by_name as match_tool_by_name
|
|
3
7
|
|
|
4
|
-
__all__ = ['PTCError', 'PTCToolError', 'PTCSandboxConfig', 'PTCSandboxExecutor', 'PromptConfig', 'build_ptc_prompt', 'compute_ptc_prompt_hash', 'build_sandbox_payload', 'wrap_ptc_code']
|
|
8
|
+
__all__ = ['PTCError', 'PTCToolError', 'PTCCustomToolValidationError', 'PTCSandboxConfig', 'PTCSandboxExecutor', 'PTCCustomToolConfig', 'PTCToolDef', 'PTCPackageToolDef', 'PTCFileToolDef', 'validate_custom_tool_config', 'extract_tool_metadata', 'enrich_tool_def_with_metadata', 'build_tool_lookup', 'match_tool_by_name', 'enrich_custom_tools_from_agent', 'package_tool', 'file_tool', 'CustomToolPayloadResult', 'build_custom_tools_payload', 'PromptConfig', 'build_ptc_prompt', 'compute_ptc_prompt_hash', 'build_sandbox_payload', 'wrap_ptc_code']
|
|
5
9
|
|
|
6
10
|
# Names in __all__ with no definition:
|
|
7
11
|
# PTCSandboxConfig
|