glaip-sdk 0.0.4__py3-none-any.whl → 0.0.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.
- glaip_sdk/__init__.py +5 -5
- glaip_sdk/branding.py +18 -17
- glaip_sdk/cli/__init__.py +1 -1
- glaip_sdk/cli/agent_config.py +82 -0
- glaip_sdk/cli/commands/__init__.py +3 -3
- glaip_sdk/cli/commands/agents.py +570 -673
- glaip_sdk/cli/commands/configure.py +2 -2
- glaip_sdk/cli/commands/mcps.py +148 -143
- glaip_sdk/cli/commands/models.py +1 -1
- glaip_sdk/cli/commands/tools.py +250 -179
- glaip_sdk/cli/display.py +244 -0
- glaip_sdk/cli/io.py +106 -0
- glaip_sdk/cli/main.py +14 -18
- glaip_sdk/cli/resolution.py +59 -0
- glaip_sdk/cli/utils.py +305 -264
- glaip_sdk/cli/validators.py +235 -0
- glaip_sdk/client/__init__.py +3 -224
- glaip_sdk/client/agents.py +631 -191
- glaip_sdk/client/base.py +66 -4
- glaip_sdk/client/main.py +226 -0
- glaip_sdk/client/mcps.py +143 -18
- glaip_sdk/client/tools.py +146 -11
- glaip_sdk/config/constants.py +10 -1
- glaip_sdk/models.py +42 -2
- glaip_sdk/rich_components.py +29 -0
- glaip_sdk/utils/__init__.py +18 -171
- glaip_sdk/utils/agent_config.py +181 -0
- glaip_sdk/utils/client_utils.py +159 -79
- glaip_sdk/utils/display.py +100 -0
- glaip_sdk/utils/general.py +94 -0
- glaip_sdk/utils/import_export.py +140 -0
- glaip_sdk/utils/rendering/formatting.py +6 -1
- glaip_sdk/utils/rendering/renderer/__init__.py +67 -8
- glaip_sdk/utils/rendering/renderer/base.py +340 -247
- glaip_sdk/utils/rendering/renderer/debug.py +3 -2
- glaip_sdk/utils/rendering/renderer/panels.py +11 -10
- glaip_sdk/utils/rendering/steps.py +1 -1
- glaip_sdk/utils/resource_refs.py +192 -0
- glaip_sdk/utils/rich_utils.py +29 -0
- glaip_sdk/utils/serialization.py +285 -0
- glaip_sdk/utils/validation.py +273 -0
- {glaip_sdk-0.0.4.dist-info → glaip_sdk-0.0.5.dist-info}/METADATA +6 -5
- glaip_sdk-0.0.5.dist-info/RECORD +55 -0
- glaip_sdk/cli/commands/init.py +0 -93
- glaip_sdk-0.0.4.dist-info/RECORD +0 -41
- {glaip_sdk-0.0.4.dist-info → glaip_sdk-0.0.5.dist-info}/WHEEL +0 -0
- {glaip_sdk-0.0.4.dist-info → glaip_sdk-0.0.5.dist-info}/entry_points.txt +0 -0
glaip_sdk/__init__.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"""AIP SDK - Python SDK for AI Agent
|
|
1
|
+
"""GL AIP SDK - Python SDK for GDP Labs AI Agent Package.
|
|
2
2
|
|
|
3
3
|
Authors:
|
|
4
4
|
Raymond Christopher (raymond.christopher@gdplabs.id)
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from ._version import __version__
|
|
8
|
-
from .client import Client
|
|
9
|
-
from .exceptions import AIPError
|
|
10
|
-
from .models import MCP, Agent, Tool
|
|
7
|
+
from glaip_sdk._version import __version__
|
|
8
|
+
from glaip_sdk.client import Client
|
|
9
|
+
from glaip_sdk.exceptions import AIPError
|
|
10
|
+
from glaip_sdk.models import MCP, Agent, Tool
|
|
11
11
|
|
|
12
12
|
__all__ = ["Client", "Agent", "Tool", "MCP", "AIPError", "__version__"]
|
glaip_sdk/branding.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""AIP SDK Branding and Visual Identity.
|
|
2
2
|
|
|
3
|
-
Simple, friendly CLI branding for the AI Agent
|
|
3
|
+
Simple, friendly CLI branding for the GL AIP (GDP Labs AI Agent Package) SDK.
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- Package name: GL AIP (GDP Labs AI Agent Package)
|
|
6
6
|
- Version: auto-detected (AIP_VERSION env or importlib.metadata), or passed in
|
|
7
7
|
- Colors: blue / bright_blue, with NO_COLOR/AIP_NO_COLOR fallbacks
|
|
8
8
|
|
|
@@ -17,7 +17,8 @@ import platform
|
|
|
17
17
|
import sys
|
|
18
18
|
|
|
19
19
|
from rich.console import Console
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
from glaip_sdk.rich_components import AIPPanel
|
|
21
22
|
|
|
22
23
|
try:
|
|
23
24
|
# Python 3.8+ standard way to read installed package version
|
|
@@ -28,25 +29,25 @@ except Exception: # pragma: no cover
|
|
|
28
29
|
PackageNotFoundError = Exception
|
|
29
30
|
|
|
30
31
|
|
|
31
|
-
# ---- minimal, readable styles (blue
|
|
32
|
-
PRIMARY = "bright_blue"
|
|
33
|
-
BORDER =
|
|
32
|
+
# ---- minimal, readable styles (light blue + white theme) -----------------
|
|
33
|
+
PRIMARY = "bright_blue" # Light blue for main elements
|
|
34
|
+
BORDER = "bright_blue" # Light blue borders
|
|
34
35
|
TITLE_STYLE = f"bold {PRIMARY}"
|
|
35
36
|
LABEL = "bold"
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
class AIPBranding:
|
|
39
|
-
"""AIP SDK branding utilities with ASCII banner and version display."""
|
|
40
|
+
"""GL AIP SDK branding utilities with ASCII banner and version display."""
|
|
40
41
|
|
|
41
|
-
# AIP ASCII art -
|
|
42
|
+
# GL AIP ASCII art - Modern block style with enhanced visibility
|
|
42
43
|
AIP_LOGO = r"""
|
|
43
|
-
█████╗ ██╗██████╗
|
|
44
|
-
██╔══██╗██║██╔══██╗
|
|
45
|
-
███████║██║██████╔╝
|
|
46
|
-
██╔══██║██║██╔═══╝
|
|
47
|
-
██║ ██║██║██║
|
|
48
|
-
╚═╝ ╚═╝╚═╝╚═╝
|
|
49
|
-
AI
|
|
44
|
+
██████╗ ██╗ █████╗ ██╗██████╗
|
|
45
|
+
██╔════╝ ██║ ██╔══██╗██║██╔══██╗
|
|
46
|
+
██║ ███╗██║ ███████║██║██████╔╝
|
|
47
|
+
██║ ██║██║ ██╔══██║██║██╔═══╝
|
|
48
|
+
╚██████╔╝███████╗ ██║ ██║██║██║
|
|
49
|
+
╚═════╝ ╚══════╝ ╚═╝ ╚═╝╚═╝╚═╝
|
|
50
|
+
GDP Labs AI Agents Package
|
|
50
51
|
""".strip("\n")
|
|
51
52
|
|
|
52
53
|
def __init__(
|
|
@@ -108,7 +109,7 @@ AI Agent Platform
|
|
|
108
109
|
|
|
109
110
|
def display_welcome_panel(self, title: str = "Welcome to AIP") -> None:
|
|
110
111
|
banner = self.get_welcome_banner()
|
|
111
|
-
panel =
|
|
112
|
+
panel = AIPPanel(
|
|
112
113
|
banner,
|
|
113
114
|
title=f"[{TITLE_STYLE}]{title}[/{TITLE_STYLE}]",
|
|
114
115
|
border_style=BORDER,
|
|
@@ -125,7 +126,7 @@ AI Agent Platform
|
|
|
125
126
|
f"[{LABEL}]Platform:[/] {v['platform']}\n"
|
|
126
127
|
f"[{LABEL}]Architecture:[/] {v['architecture']}"
|
|
127
128
|
)
|
|
128
|
-
panel =
|
|
129
|
+
panel = AIPPanel(
|
|
129
130
|
version_text,
|
|
130
131
|
title=f"[{TITLE_STYLE}]Version Details[/{TITLE_STYLE}]",
|
|
131
132
|
border_style=BORDER,
|
glaip_sdk/cli/__init__.py
CHANGED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""CLI-specific agent configuration utilities.
|
|
2
|
+
|
|
3
|
+
This module provides CLI-only affordances for agent configuration,
|
|
4
|
+
such as merging CLI flags over imported data.
|
|
5
|
+
|
|
6
|
+
Authors:
|
|
7
|
+
Raymond Christopher (raymond.christopher@gdplabs.id)
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
from glaip_sdk.utils.agent_config import (
|
|
13
|
+
resolve_language_model_selection,
|
|
14
|
+
sanitize_agent_config,
|
|
15
|
+
)
|
|
16
|
+
from glaip_sdk.utils.import_export import merge_import_with_cli_args
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def merge_agent_config_with_cli_args(
|
|
20
|
+
import_data: dict[str, Any], cli_args: dict[str, Any]
|
|
21
|
+
) -> dict[str, Any]:
|
|
22
|
+
"""Merge imported agent data with CLI arguments, preferring CLI args.
|
|
23
|
+
|
|
24
|
+
This is a CLI-specific wrapper that handles agent-specific merging logic.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
import_data: Data loaded from import file
|
|
28
|
+
cli_args: Arguments passed via CLI
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
Merged data dictionary
|
|
32
|
+
|
|
33
|
+
Notes:
|
|
34
|
+
- CLI arguments take precedence over imported data
|
|
35
|
+
- Handles agent-specific fields like tools and agents arrays
|
|
36
|
+
- Preserves agent configuration structure
|
|
37
|
+
"""
|
|
38
|
+
return merge_import_with_cli_args(
|
|
39
|
+
import_data, cli_args, array_fields=["tools", "agents"]
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def resolve_agent_language_model_selection(
|
|
44
|
+
merged_data: dict[str, Any], cli_model: str | None
|
|
45
|
+
) -> tuple[dict[str, Any], bool]:
|
|
46
|
+
"""Resolve language model selection for agent creation/update.
|
|
47
|
+
|
|
48
|
+
This is a CLI-specific wrapper around the core LM selection logic.
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
merged_data: Merged import data and CLI args
|
|
52
|
+
cli_model: Model specified via CLI --model flag
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
Tuple of (lm_selection_dict, should_strip_lm_identity)
|
|
56
|
+
"""
|
|
57
|
+
return resolve_language_model_selection(merged_data, cli_model)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def sanitize_agent_config_for_cli(
|
|
61
|
+
agent_config: dict | None,
|
|
62
|
+
*,
|
|
63
|
+
strip_credentials: bool = True,
|
|
64
|
+
strip_lm_identity: bool = False,
|
|
65
|
+
) -> dict:
|
|
66
|
+
"""Sanitize agent_config for CLI operations.
|
|
67
|
+
|
|
68
|
+
This is a CLI-specific wrapper around the core sanitization logic.
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
agent_config: The agent configuration to sanitize
|
|
72
|
+
strip_credentials: Always drop lm_credentials (default: True)
|
|
73
|
+
strip_lm_identity: Also drop lm_provider/lm_name/lm_base_url when True
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
Sanitized agent configuration
|
|
77
|
+
"""
|
|
78
|
+
return sanitize_agent_config(
|
|
79
|
+
agent_config,
|
|
80
|
+
strip_credentials=strip_credentials,
|
|
81
|
+
strip_lm_identity=strip_lm_identity,
|
|
82
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"""CLI commands package."""
|
|
1
|
+
"""CLI commands package exports."""
|
|
2
2
|
|
|
3
|
-
from . import agents,
|
|
3
|
+
from glaip_sdk.cli.commands import agents, configure, mcps, models, tools
|
|
4
4
|
|
|
5
|
-
__all__ = ["agents", "tools", "mcps", "models", "
|
|
5
|
+
__all__ = ["agents", "tools", "mcps", "models", "configure"]
|