glaip-sdk 0.7.22__py3-none-any.whl → 0.7.24__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.
- glaip_sdk/agents/base.py +19 -0
- glaip_sdk/ptc.py +145 -0
- glaip_sdk/runner/langgraph.py +43 -3
- glaip_sdk/runner/ptc_adapter.py +98 -0
- {glaip_sdk-0.7.22.dist-info → glaip_sdk-0.7.24.dist-info}/METADATA +6 -6
- {glaip_sdk-0.7.22.dist-info → glaip_sdk-0.7.24.dist-info}/RECORD +9 -7
- {glaip_sdk-0.7.22.dist-info → glaip_sdk-0.7.24.dist-info}/WHEEL +0 -0
- {glaip_sdk-0.7.22.dist-info → glaip_sdk-0.7.24.dist-info}/entry_points.txt +0 -0
- {glaip_sdk-0.7.22.dist-info → glaip_sdk-0.7.24.dist-info}/top_level.txt +0 -0
glaip_sdk/agents/base.py
CHANGED
|
@@ -56,6 +56,7 @@ if TYPE_CHECKING:
|
|
|
56
56
|
from glaip_sdk.client.schedules import AgentScheduleManager
|
|
57
57
|
from glaip_sdk.guardrails import GuardrailManager
|
|
58
58
|
from glaip_sdk.models import AgentResponse, Model
|
|
59
|
+
from glaip_sdk.ptc import PTC
|
|
59
60
|
from glaip_sdk.registry import AgentRegistry, MCPRegistry, ToolRegistry
|
|
60
61
|
|
|
61
62
|
# Import model validation utility
|
|
@@ -135,6 +136,7 @@ class Agent:
|
|
|
135
136
|
mcps: list | None = None,
|
|
136
137
|
model: str | Model | None = _UNSET, # type: ignore[assignment]
|
|
137
138
|
guardrail: GuardrailManager | None = None,
|
|
139
|
+
ptc: PTC | None = None,
|
|
138
140
|
_client: Any = None,
|
|
139
141
|
**kwargs: Any,
|
|
140
142
|
) -> None:
|
|
@@ -153,6 +155,7 @@ class Agent:
|
|
|
153
155
|
mcps: List of MCPs.
|
|
154
156
|
model: Model identifier or Model configuration object.
|
|
155
157
|
guardrail: The guardrail manager for content safety.
|
|
158
|
+
ptc: PTC configuration for local runs (sandbox code execution).
|
|
156
159
|
_client: Internal client reference (set automatically).
|
|
157
160
|
|
|
158
161
|
**kwargs: Additional configuration parameters:
|
|
@@ -165,6 +168,7 @@ class Agent:
|
|
|
165
168
|
- tool_configs: Per-tool configuration overrides.
|
|
166
169
|
- mcp_configs: Per-MCP configuration overrides.
|
|
167
170
|
- a2a_profile: A2A profile configuration.
|
|
171
|
+
- ptc: PTC configuration (local runs only).
|
|
168
172
|
"""
|
|
169
173
|
# Instance attributes for deployed agents
|
|
170
174
|
self._id = id
|
|
@@ -181,6 +185,7 @@ class Agent:
|
|
|
181
185
|
self._mcps = mcps
|
|
182
186
|
self._model = self._validate_and_set_model(model)
|
|
183
187
|
self._guardrail = guardrail
|
|
188
|
+
self._ptc = ptc
|
|
184
189
|
self._language_model_id: str | None = None
|
|
185
190
|
# Extract parameters from kwargs with _UNSET defaults
|
|
186
191
|
self._timeout = kwargs.pop("timeout", Agent._UNSET) # type: ignore[assignment]
|
|
@@ -505,6 +510,11 @@ class Agent:
|
|
|
505
510
|
"""The guardrail manager for content safety."""
|
|
506
511
|
return self._guardrail
|
|
507
512
|
|
|
513
|
+
@property
|
|
514
|
+
def ptc(self) -> PTC | None:
|
|
515
|
+
"""PTC configuration for local runs (sandbox code execution)."""
|
|
516
|
+
return self._ptc
|
|
517
|
+
|
|
508
518
|
@property
|
|
509
519
|
def a2a_profile(self) -> dict[str, Any] | None:
|
|
510
520
|
"""A2A (Agent-to-Agent) profile configuration.
|
|
@@ -551,6 +561,15 @@ class Agent:
|
|
|
551
561
|
"""
|
|
552
562
|
logger.info("Deploying agent: %s", self.name)
|
|
553
563
|
|
|
564
|
+
if self._ptc is not None:
|
|
565
|
+
warnings.warn(
|
|
566
|
+
"PTC (Programmatic Tool Calling) is configured but not supported for remote deployments yet. "
|
|
567
|
+
"PTC will only work for local runs (agent.run(..., local=True)). "
|
|
568
|
+
"The PTC configuration will not be included in the deployed agent.",
|
|
569
|
+
UserWarning,
|
|
570
|
+
stacklevel=2,
|
|
571
|
+
)
|
|
572
|
+
|
|
554
573
|
# Resolve tools FIRST - this uploads them and populates the registry
|
|
555
574
|
tool_ids = self._resolve_tools(get_tool_registry())
|
|
556
575
|
|
glaip_sdk/ptc.py
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"""Programmatic Tool Calling (PTC) configuration for local SDK runs.
|
|
2
|
+
|
|
3
|
+
This module provides the PTC class for configuring sandboxed code execution
|
|
4
|
+
in local agent runs. PTC enables agents to call execute_ptc_code and use MCP
|
|
5
|
+
tools programmatically in an E2B sandbox.
|
|
6
|
+
|
|
7
|
+
Authors:
|
|
8
|
+
Christian Trisno Sen Long Chen (christian.t.s.l.chen@gdplabs.id)
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
from glaip_sdk.exceptions import ValidationError
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PTC:
|
|
19
|
+
"""Configuration for Programmatic Tool Calling in local runs.
|
|
20
|
+
|
|
21
|
+
PTC allows agents to execute Python code in a sandboxed E2B environment
|
|
22
|
+
with access to registered MCP tools. This is only supported for local
|
|
23
|
+
runs (local=True) and requires the glaip-sdk[local] installation.
|
|
24
|
+
|
|
25
|
+
Example:
|
|
26
|
+
>>> from glaip_sdk.ptc import PTC
|
|
27
|
+
>>> from glaip_sdk.agents import Agent
|
|
28
|
+
>>>
|
|
29
|
+
>>> ptc = PTC(enabled=True)
|
|
30
|
+
>>> agent = Agent(
|
|
31
|
+
... name="ptc_demo",
|
|
32
|
+
... instruction="Use execute_ptc_code for multi-tool workflows.",
|
|
33
|
+
... mcps=[my_mcp],
|
|
34
|
+
... ptc=ptc,
|
|
35
|
+
... )
|
|
36
|
+
>>> agent.run("Analyze the repo", local=True)
|
|
37
|
+
|
|
38
|
+
Custom timeouts and prompts:
|
|
39
|
+
>>> ptc = PTC(
|
|
40
|
+
... enabled=True,
|
|
41
|
+
... sandbox_timeout=180.0,
|
|
42
|
+
... prompt={"mode": "full", "include_example": False},
|
|
43
|
+
... )
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
enabled: Whether PTC is enabled. Must be True to activate PTC.
|
|
47
|
+
When False, all other fields are ignored (toggle-friendly).
|
|
48
|
+
sandbox_timeout: Maximum execution time in seconds for sandbox code.
|
|
49
|
+
Defaults to 120.0 seconds.
|
|
50
|
+
prompt: Prompt configuration for PTC tool description.
|
|
51
|
+
Can be a dict with "mode" and "include_example" keys.
|
|
52
|
+
Defaults to None (uses aip-agents default).
|
|
53
|
+
custom_tools: NOT SUPPORTED in v1. Raises ValidationError if provided
|
|
54
|
+
when enabled=True.
|
|
55
|
+
ptc_packages: NOT SUPPORTED in v1. Raises ValidationError if provided
|
|
56
|
+
when enabled=True.
|
|
57
|
+
|
|
58
|
+
Raises:
|
|
59
|
+
ValidationError: If custom_tools or ptc_packages are provided when
|
|
60
|
+
enabled=True (v1 only supports MCP tools).
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
def __init__(
|
|
64
|
+
self,
|
|
65
|
+
*,
|
|
66
|
+
enabled: bool = False,
|
|
67
|
+
sandbox_timeout: float = 120.0,
|
|
68
|
+
prompt: dict[str, Any] | None = None,
|
|
69
|
+
custom_tools: list[Any] | None = None,
|
|
70
|
+
ptc_packages: list[str] | None = None,
|
|
71
|
+
):
|
|
72
|
+
"""Initialize PTC configuration.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
enabled: Whether PTC is enabled. Must be True to activate.
|
|
76
|
+
sandbox_timeout: Sandbox execution timeout in seconds.
|
|
77
|
+
prompt: Prompt configuration dict.
|
|
78
|
+
custom_tools: Custom tools (NOT SUPPORTED in v1).
|
|
79
|
+
ptc_packages: Sandbox packages (NOT SUPPORTED in v1).
|
|
80
|
+
|
|
81
|
+
Raises:
|
|
82
|
+
ValidationError: If unsupported features are used when enabled=True.
|
|
83
|
+
"""
|
|
84
|
+
self.enabled = enabled
|
|
85
|
+
self.sandbox_timeout = sandbox_timeout
|
|
86
|
+
self.prompt = prompt
|
|
87
|
+
self._custom_tools = custom_tools
|
|
88
|
+
self._ptc_packages = ptc_packages
|
|
89
|
+
|
|
90
|
+
if self.enabled:
|
|
91
|
+
self._validate_v1_constraints()
|
|
92
|
+
|
|
93
|
+
def _validate_v1_constraints(self) -> None:
|
|
94
|
+
"""Validate that v1-unsupported features are not used.
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
ValidationError: If custom_tools or ptc_packages are provided.
|
|
98
|
+
"""
|
|
99
|
+
if self._custom_tools is not None:
|
|
100
|
+
msg = (
|
|
101
|
+
"PTC custom_tools are not supported in v1. "
|
|
102
|
+
"Only MCP tools are available in the sandbox. "
|
|
103
|
+
"Please remove the custom_tools parameter or wait for "
|
|
104
|
+
"custom tool support in a future release."
|
|
105
|
+
)
|
|
106
|
+
raise ValidationError(msg)
|
|
107
|
+
|
|
108
|
+
if self._ptc_packages is not None:
|
|
109
|
+
msg = (
|
|
110
|
+
"PTC ptc_packages are not supported in v1. "
|
|
111
|
+
"The sandbox uses a fixed template to maintain local/remote parity. "
|
|
112
|
+
"Please remove the ptc_packages parameter or wait for "
|
|
113
|
+
"package installation support in a future release."
|
|
114
|
+
)
|
|
115
|
+
raise ValidationError(msg)
|
|
116
|
+
|
|
117
|
+
def to_dict(self) -> dict[str, Any]:
|
|
118
|
+
"""Convert PTC config to dictionary format.
|
|
119
|
+
|
|
120
|
+
Returns:
|
|
121
|
+
Dictionary representation of PTC config.
|
|
122
|
+
"""
|
|
123
|
+
result: dict[str, Any] = {
|
|
124
|
+
"enabled": self.enabled,
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if self.enabled:
|
|
128
|
+
result["sandbox_timeout"] = self.sandbox_timeout
|
|
129
|
+
if self.prompt is not None:
|
|
130
|
+
result["prompt"] = self.prompt
|
|
131
|
+
|
|
132
|
+
return result
|
|
133
|
+
|
|
134
|
+
def __repr__(self) -> str:
|
|
135
|
+
"""Return string representation of PTC config."""
|
|
136
|
+
if not self.enabled:
|
|
137
|
+
return "PTC(enabled=False)"
|
|
138
|
+
|
|
139
|
+
parts = [f"enabled={self.enabled}"]
|
|
140
|
+
if abs(self.sandbox_timeout - 120.0) > 1e-9:
|
|
141
|
+
parts.append(f"sandbox_timeout={self.sandbox_timeout}")
|
|
142
|
+
if self.prompt is not None:
|
|
143
|
+
parts.append(f"prompt={self.prompt!r}")
|
|
144
|
+
|
|
145
|
+
return f"PTC({', '.join(parts)})"
|
glaip_sdk/runner/langgraph.py
CHANGED
|
@@ -24,6 +24,8 @@ import logging
|
|
|
24
24
|
from dataclasses import dataclass
|
|
25
25
|
from typing import TYPE_CHECKING, Any
|
|
26
26
|
|
|
27
|
+
from gllm_core.utils import LoggerManager
|
|
28
|
+
|
|
27
29
|
from glaip_sdk.client.run_rendering import AgentRunRenderingManager
|
|
28
30
|
from glaip_sdk.hitl import PauseResumeCallback
|
|
29
31
|
from glaip_sdk.models import DEFAULT_MODEL
|
|
@@ -32,13 +34,17 @@ from glaip_sdk.runner.deps import (
|
|
|
32
34
|
check_local_runtime_available,
|
|
33
35
|
get_local_runtime_missing_message,
|
|
34
36
|
)
|
|
37
|
+
from glaip_sdk.runner.ptc_adapter import (
|
|
38
|
+
normalize_ptc_for_aip_agents,
|
|
39
|
+
validate_ptc_for_local_run,
|
|
40
|
+
)
|
|
35
41
|
from glaip_sdk.utils.tool_storage_provider import build_tool_output_manager
|
|
36
|
-
from gllm_core.utils import LoggerManager
|
|
37
42
|
|
|
38
43
|
if TYPE_CHECKING:
|
|
39
|
-
from glaip_sdk.agents.base import Agent
|
|
40
44
|
from langchain_core.messages import BaseMessage
|
|
41
45
|
|
|
46
|
+
from glaip_sdk.agents.base import Agent
|
|
47
|
+
|
|
42
48
|
|
|
43
49
|
_AIP_LOGS_SWALLOWED = False
|
|
44
50
|
|
|
@@ -314,6 +320,13 @@ class LangGraphRunner(BaseRunner):
|
|
|
314
320
|
renderer.close()
|
|
315
321
|
finally:
|
|
316
322
|
raise
|
|
323
|
+
finally:
|
|
324
|
+
# Cleanup PTC sandbox and MCP sessions
|
|
325
|
+
# Isolated cleanup steps so one failure doesn't skip the other
|
|
326
|
+
try:
|
|
327
|
+
await local_agent.cleanup()
|
|
328
|
+
except Exception as e:
|
|
329
|
+
logger.warning("Failed to cleanup agent resources: %s", e)
|
|
317
330
|
|
|
318
331
|
# Use shared finalizer to avoid code duplication
|
|
319
332
|
from glaip_sdk.client.run_rendering import ( # noqa: PLC0415
|
|
@@ -356,6 +369,7 @@ class LangGraphRunner(BaseRunner):
|
|
|
356
369
|
ValueError: If agent has unsupported tools, MCPs, or sub-agents for local mode.
|
|
357
370
|
"""
|
|
358
371
|
from aip_agents.agent import LangGraphReactAgent # noqa: PLC0415
|
|
372
|
+
|
|
359
373
|
from glaip_sdk.runner.tool_adapter import LangChainToolAdapter # noqa: PLC0415
|
|
360
374
|
|
|
361
375
|
# Adapt tools for local execution
|
|
@@ -380,6 +394,14 @@ class LangGraphRunner(BaseRunner):
|
|
|
380
394
|
merged_agent_config = self._merge_agent_config(agent, normalized_config)
|
|
381
395
|
agent_config_params, agent_config_kwargs = self._apply_agent_config(merged_agent_config)
|
|
382
396
|
|
|
397
|
+
# Validate and normalize PTC configuration for local runs
|
|
398
|
+
ptc_config = validate_ptc_for_local_run(
|
|
399
|
+
agent_ptc=agent.ptc if hasattr(agent, "ptc") else None,
|
|
400
|
+
agent_config_ptc=None, # Already validated in _merge_agent_config
|
|
401
|
+
runtime_config_ptc=None, # Already validated in _normalize_runtime_config
|
|
402
|
+
)
|
|
403
|
+
normalized_ptc = normalize_ptc_for_aip_agents(ptc_config)
|
|
404
|
+
|
|
383
405
|
# Resolve model and merge its configuration into agent kwargs
|
|
384
406
|
model_string = self._resolve_local_model(agent, agent_config_kwargs)
|
|
385
407
|
|
|
@@ -396,7 +418,7 @@ class LangGraphRunner(BaseRunner):
|
|
|
396
418
|
shared_tool_output_manager=tool_output_manager,
|
|
397
419
|
)
|
|
398
420
|
|
|
399
|
-
# Build the LangGraphReactAgent with tools, sub-agents, and
|
|
421
|
+
# Build the LangGraphReactAgent with tools, sub-agents, configs, and PTC
|
|
400
422
|
local_agent = LangGraphReactAgent(
|
|
401
423
|
name=agent.name,
|
|
402
424
|
instruction=agent.instruction,
|
|
@@ -407,6 +429,7 @@ class LangGraphRunner(BaseRunner):
|
|
|
407
429
|
tool_configs=tool_configs if tool_configs else None,
|
|
408
430
|
tool_output_manager=tool_output_manager,
|
|
409
431
|
guardrail=agent.guardrail,
|
|
432
|
+
ptc_config=normalized_ptc,
|
|
410
433
|
**agent_config_params,
|
|
411
434
|
**agent_config_kwargs,
|
|
412
435
|
)
|
|
@@ -456,6 +479,7 @@ class LangGraphRunner(BaseRunner):
|
|
|
456
479
|
from aip_agents.agent.hitl.manager import ( # noqa: PLC0415
|
|
457
480
|
ApprovalManager,
|
|
458
481
|
)
|
|
482
|
+
|
|
459
483
|
from glaip_sdk.hitl import LocalPromptHandler # noqa: PLC0415
|
|
460
484
|
|
|
461
485
|
local_agent.hitl_manager = ApprovalManager(
|
|
@@ -573,6 +597,14 @@ class LangGraphRunner(BaseRunner):
|
|
|
573
597
|
if not runtime_config:
|
|
574
598
|
return {}
|
|
575
599
|
|
|
600
|
+
# Check for unsupported runtime_config.ptc (v1 constraint)
|
|
601
|
+
if "ptc" in runtime_config:
|
|
602
|
+
validate_ptc_for_local_run(
|
|
603
|
+
agent_ptc=None,
|
|
604
|
+
agent_config_ptc=None,
|
|
605
|
+
runtime_config_ptc=runtime_config["ptc"],
|
|
606
|
+
)
|
|
607
|
+
|
|
576
608
|
# 1. Extract global configs and normalize keys
|
|
577
609
|
global_tool_configs = normalize_local_config_keys(runtime_config.get("tool_configs", {}))
|
|
578
610
|
global_mcp_configs = normalize_local_config_keys(runtime_config.get("mcp_configs", {}))
|
|
@@ -732,6 +764,14 @@ class LangGraphRunner(BaseRunner):
|
|
|
732
764
|
# Get runtime agent_config
|
|
733
765
|
runtime_agent_config = normalized_config.get("agent_config", {})
|
|
734
766
|
|
|
767
|
+
# Check for unsupported agent_config.ptc (local runs constraint)
|
|
768
|
+
if "ptc" in agent_agent_config or "ptc" in runtime_agent_config:
|
|
769
|
+
validate_ptc_for_local_run(
|
|
770
|
+
agent_ptc=None,
|
|
771
|
+
agent_config_ptc=agent_agent_config.get("ptc") or runtime_agent_config.get("ptc"),
|
|
772
|
+
runtime_config_ptc=None,
|
|
773
|
+
)
|
|
774
|
+
|
|
735
775
|
# Merge: agent definition < runtime config
|
|
736
776
|
return merge_configs(agent_agent_config, runtime_agent_config)
|
|
737
777
|
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""PTC adapter for local runner integration.
|
|
2
|
+
|
|
3
|
+
This module provides validation and normalization of PTC configuration
|
|
4
|
+
for use in the local LangGraph runner. It ensures PTC is configured
|
|
5
|
+
correctly and rejects unsupported configuration sources.
|
|
6
|
+
|
|
7
|
+
Authors:
|
|
8
|
+
Christian Trisno Sen Long Chen (christian.t.s.l.chen@gdplabs.id)
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from typing import TYPE_CHECKING, Any
|
|
14
|
+
|
|
15
|
+
from glaip_sdk.exceptions import ValidationError
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from glaip_sdk.ptc import PTC
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def validate_ptc_for_local_run(
|
|
22
|
+
agent_ptc: PTC | None,
|
|
23
|
+
agent_config_ptc: Any | None,
|
|
24
|
+
runtime_config_ptc: Any | None,
|
|
25
|
+
) -> PTC | None:
|
|
26
|
+
"""Validate PTC configuration for local runs.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
agent_ptc: PTC object from Agent.ptc parameter.
|
|
30
|
+
agent_config_ptc: PTC from agent_config (should be None for local).
|
|
31
|
+
runtime_config_ptc: PTC from runtime_config (should be None for v1).
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
Validated PTC object if enabled, None otherwise.
|
|
35
|
+
|
|
36
|
+
Raises:
|
|
37
|
+
ValidationError: If agent_config.ptc or runtime_config.ptc are provided,
|
|
38
|
+
or if agent_ptc is not a PTC instance when provided.
|
|
39
|
+
"""
|
|
40
|
+
if agent_config_ptc is not None:
|
|
41
|
+
msg = (
|
|
42
|
+
"PTC configuration via agent_config.ptc is not supported for local runs. "
|
|
43
|
+
"Please configure PTC using the Agent.ptc parameter instead: "
|
|
44
|
+
"Agent(name='...', ptc=PTC(enabled=True), ...)"
|
|
45
|
+
)
|
|
46
|
+
raise ValidationError(msg)
|
|
47
|
+
|
|
48
|
+
if runtime_config_ptc is not None:
|
|
49
|
+
msg = (
|
|
50
|
+
"PTC configuration via runtime_config.ptc is not supported in v1. "
|
|
51
|
+
"PTC configuration must be set at Agent initialization time using "
|
|
52
|
+
"the Agent.ptc parameter and cannot be overridden at runtime. "
|
|
53
|
+
"This preserves local/remote parity and prevents ambiguous precedence."
|
|
54
|
+
)
|
|
55
|
+
raise ValidationError(msg)
|
|
56
|
+
|
|
57
|
+
if agent_ptc is None:
|
|
58
|
+
return None
|
|
59
|
+
|
|
60
|
+
from glaip_sdk.ptc import PTC # noqa: PLC0415
|
|
61
|
+
|
|
62
|
+
if not isinstance(agent_ptc, PTC):
|
|
63
|
+
msg = (
|
|
64
|
+
f"Agent.ptc must be a PTC instance, got {type(agent_ptc).__name__}. "
|
|
65
|
+
"Example: Agent(name='...', ptc=PTC(enabled=True), ...)"
|
|
66
|
+
)
|
|
67
|
+
raise ValidationError(msg)
|
|
68
|
+
|
|
69
|
+
if not agent_ptc.enabled:
|
|
70
|
+
return None
|
|
71
|
+
|
|
72
|
+
return agent_ptc
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def normalize_ptc_for_aip_agents(ptc: PTC | None) -> Any:
|
|
76
|
+
"""Normalize PTC config for aip-agents LangGraphReactAgent.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
ptc: Validated PTC object or None.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
PTCSandboxConfig for aip-agents or None if PTC disabled.
|
|
83
|
+
"""
|
|
84
|
+
if ptc is None or not ptc.enabled:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
from aip_agents.ptc import PromptConfig, PTCSandboxConfig # noqa: PLC0415
|
|
88
|
+
|
|
89
|
+
# Build PromptConfig if prompt dict is provided.
|
|
90
|
+
prompt_config = None
|
|
91
|
+
if ptc.prompt is not None:
|
|
92
|
+
prompt_config = PromptConfig(**ptc.prompt)
|
|
93
|
+
|
|
94
|
+
return PTCSandboxConfig(
|
|
95
|
+
enabled=ptc.enabled,
|
|
96
|
+
sandbox_timeout=ptc.sandbox_timeout,
|
|
97
|
+
prompt=prompt_config,
|
|
98
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: glaip-sdk
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.24
|
|
4
4
|
Summary: Python SDK and CLI for GL AIP (GDP Labs AI Agent Package) - Build, run, and manage AI agents
|
|
5
5
|
Author-email: Raymond Christopher <raymond.christopher@gdplabs.id>
|
|
6
6
|
License: MIT
|
|
@@ -20,15 +20,15 @@ Requires-Dist: gllm-core-binary>=0.1.0
|
|
|
20
20
|
Requires-Dist: langchain-core>=0.3.0
|
|
21
21
|
Requires-Dist: gllm-tools-binary>=0.1.3
|
|
22
22
|
Provides-Extra: local
|
|
23
|
-
Requires-Dist: aip-agents-binary[local]>=0.
|
|
23
|
+
Requires-Dist: aip-agents-binary[local]>=0.6.2; (python_version >= "3.11" and python_version < "3.13") and extra == "local"
|
|
24
24
|
Provides-Extra: memory
|
|
25
|
-
Requires-Dist: aip-agents-binary[memory]>=0.
|
|
25
|
+
Requires-Dist: aip-agents-binary[memory]>=0.6.2; (python_version >= "3.11" and python_version < "3.13") and extra == "memory"
|
|
26
26
|
Provides-Extra: privacy
|
|
27
|
-
Requires-Dist: aip-agents-binary[privacy]>=0.
|
|
27
|
+
Requires-Dist: aip-agents-binary[privacy]>=0.6.2; (python_version >= "3.11" and python_version < "3.13") and extra == "privacy"
|
|
28
28
|
Provides-Extra: guardrails
|
|
29
|
-
Requires-Dist: aip-agents-binary[guardrails]>=0.
|
|
29
|
+
Requires-Dist: aip-agents-binary[guardrails]>=0.6.2; (python_version >= "3.11" and python_version < "3.13") and extra == "guardrails"
|
|
30
30
|
Provides-Extra: pipeline
|
|
31
|
-
Requires-Dist: gllm-pipeline-binary==0.4.
|
|
31
|
+
Requires-Dist: gllm-pipeline-binary==0.4.23; extra == "pipeline"
|
|
32
32
|
Requires-Dist: gllm-inference-binary<0.6.0,>=0.5.0; extra == "pipeline"
|
|
33
33
|
Provides-Extra: dev
|
|
34
34
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
@@ -3,9 +3,10 @@ glaip_sdk/_version.py,sha256=5CHGCxx_36fgmMWuEx6jJ2CzzM-i9eBFyQWFwBi23XE,2259
|
|
|
3
3
|
glaip_sdk/branding.py,sha256=uF_-c-cg_rFjzJr0NibLiE1Dvv0DpXBXN63wl-Ej88c,11651
|
|
4
4
|
glaip_sdk/exceptions.py,sha256=iAChFClkytXRBLP0vZq1_YjoZxA9i4m4bW1gDLiGR1g,2321
|
|
5
5
|
glaip_sdk/icons.py,sha256=J5THz0ReAmDwIiIooh1_G3Le-mwTJyEjhJDdJ13KRxM,524
|
|
6
|
+
glaip_sdk/ptc.py,sha256=KbitfKSBTgcbgfL4Csy8WQziFx8tYDjO58K3EAPHjfE,5108
|
|
6
7
|
glaip_sdk/rich_components.py,sha256=44Z0V1ZQleVh9gUDGwRR5mriiYFnVGOhm7fFxZYbP8c,4052
|
|
7
8
|
glaip_sdk/agents/__init__.py,sha256=VfYov56edbWuySXFEbWJ_jLXgwnFzPk1KB-9-mfsUCc,776
|
|
8
|
-
glaip_sdk/agents/base.py,sha256=
|
|
9
|
+
glaip_sdk/agents/base.py,sha256=84Ifr3sJ0RT4_iYVTYUWCzUzNMwkyTUUIYTncsvqm-g,52219
|
|
9
10
|
glaip_sdk/agents/component.py,sha256=3cLLCL_x5OTwcEJx0zdst6RTEXOoAS3cTMkYtAOQb6I,7636
|
|
10
11
|
glaip_sdk/cli/__init__.py,sha256=xCCfuF1Yc7mpCDcfhHZTX0vizvtrDSLeT8MJ3V7m5A0,156
|
|
11
12
|
glaip_sdk/cli/account_store.py,sha256=u_memecwEQssustZs2wYBrHbEmKUlDfmmL-zO1F3n3A,19034
|
|
@@ -153,8 +154,9 @@ glaip_sdk/registry/tool.py,sha256=c0Ja4rFYMOKs_1yjDLDZxCId4IjQzprwXzX0iIL8Fio,14
|
|
|
153
154
|
glaip_sdk/runner/__init__.py,sha256=orJ3nLR9P-n1qMaAMWZ_xRS4368YnDpdltg-bX5BlUk,2210
|
|
154
155
|
glaip_sdk/runner/base.py,sha256=KIjcSAyDCP9_mn2H4rXR5gu1FZlwD9pe0gkTBmr6Yi4,2663
|
|
155
156
|
glaip_sdk/runner/deps.py,sha256=Lv8LdIF6H4JGzzvLmi-MgG72RJYgB-MsQNRx8yY7cl4,3956
|
|
156
|
-
glaip_sdk/runner/langgraph.py,sha256=
|
|
157
|
+
glaip_sdk/runner/langgraph.py,sha256=2SHQA62wXSXGwPBo5ngPF6LPncFHw-dqidbwFhLnWBU,42383
|
|
157
158
|
glaip_sdk/runner/logging_config.py,sha256=OrQgW23t42qQRqEXKH8U4bFg4JG5EEkUJTlbvtU65iE,2528
|
|
159
|
+
glaip_sdk/runner/ptc_adapter.py,sha256=GGN74y1ykbxbqLIWgUIWCHlfkOqFUqOmjKzmJPQ8nmA,3029
|
|
158
160
|
glaip_sdk/runner/mcp_adapter/__init__.py,sha256=Rdttfg3N6kg3-DaTCKqaGXKByZyBt0Mwf6FV8s_5kI8,462
|
|
159
161
|
glaip_sdk/runner/mcp_adapter/base_mcp_adapter.py,sha256=ic56fKgb3zgVZZQm3ClWUZi7pE1t4EVq8mOg6AM6hdA,1374
|
|
160
162
|
glaip_sdk/runner/mcp_adapter/langchain_mcp_adapter.py,sha256=b58GuadPz7q7aXoJyTYs0eeJ_oqp-wLR1tcr_5cbV1s,9723
|
|
@@ -218,8 +220,8 @@ glaip_sdk/utils/rendering/steps/format.py,sha256=Chnq7OBaj8XMeBntSBxrX5zSmrYeGcO
|
|
|
218
220
|
glaip_sdk/utils/rendering/steps/manager.py,sha256=BiBmTeQMQhjRMykgICXsXNYh1hGsss-fH9BIGVMWFi0,13194
|
|
219
221
|
glaip_sdk/utils/rendering/viewer/__init__.py,sha256=XrxmE2cMAozqrzo1jtDFm8HqNtvDcYi2mAhXLXn5CjI,457
|
|
220
222
|
glaip_sdk/utils/rendering/viewer/presenter.py,sha256=mlLMTjnyeyPVtsyrAbz1BJu9lFGQSlS-voZ-_Cuugv0,5725
|
|
221
|
-
glaip_sdk-0.7.
|
|
222
|
-
glaip_sdk-0.7.
|
|
223
|
-
glaip_sdk-0.7.
|
|
224
|
-
glaip_sdk-0.7.
|
|
225
|
-
glaip_sdk-0.7.
|
|
223
|
+
glaip_sdk-0.7.24.dist-info/METADATA,sha256=BH1anEyTyFGgwmY7qWbw64bNp2y4hmcau7lXnLBpKj0,8686
|
|
224
|
+
glaip_sdk-0.7.24.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
225
|
+
glaip_sdk-0.7.24.dist-info/entry_points.txt,sha256=NkhO6FfgX9Zrjn63GuKphf-dLw7KNJvucAcXc7P3aMk,54
|
|
226
|
+
glaip_sdk-0.7.24.dist-info/top_level.txt,sha256=td7yXttiYX2s94-4wFhv-5KdT0rSZ-pnJRSire341hw,10
|
|
227
|
+
glaip_sdk-0.7.24.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|