glaip-sdk 0.0.2__py3-none-any.whl → 0.0.3__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 +2 -2
- glaip_sdk/_version.py +51 -0
- glaip_sdk/cli/commands/agents.py +201 -109
- glaip_sdk/cli/commands/configure.py +29 -87
- glaip_sdk/cli/commands/init.py +16 -7
- glaip_sdk/cli/commands/mcps.py +73 -153
- glaip_sdk/cli/commands/tools.py +185 -49
- glaip_sdk/cli/main.py +30 -27
- glaip_sdk/cli/utils.py +126 -13
- glaip_sdk/client/__init__.py +54 -2
- glaip_sdk/client/agents.py +175 -237
- glaip_sdk/client/base.py +62 -2
- glaip_sdk/client/mcps.py +63 -20
- glaip_sdk/client/tools.py +95 -28
- glaip_sdk/config/constants.py +10 -3
- glaip_sdk/exceptions.py +13 -0
- glaip_sdk/models.py +20 -4
- glaip_sdk/utils/__init__.py +116 -18
- glaip_sdk/utils/client_utils.py +284 -0
- glaip_sdk/utils/rendering/__init__.py +1 -0
- glaip_sdk/utils/rendering/formatting.py +211 -0
- glaip_sdk/utils/rendering/models.py +53 -0
- glaip_sdk/utils/rendering/renderer/__init__.py +38 -0
- glaip_sdk/utils/rendering/renderer/base.py +827 -0
- glaip_sdk/utils/rendering/renderer/config.py +33 -0
- glaip_sdk/utils/rendering/renderer/console.py +54 -0
- glaip_sdk/utils/rendering/renderer/debug.py +82 -0
- glaip_sdk/utils/rendering/renderer/panels.py +123 -0
- glaip_sdk/utils/rendering/renderer/progress.py +118 -0
- glaip_sdk/utils/rendering/renderer/stream.py +198 -0
- glaip_sdk/utils/rendering/steps.py +168 -0
- glaip_sdk/utils/run_renderer.py +22 -1086
- {glaip_sdk-0.0.2.dist-info → glaip_sdk-0.0.3.dist-info}/METADATA +8 -36
- glaip_sdk-0.0.3.dist-info/RECORD +40 -0
- glaip_sdk/cli/config.py +0 -592
- glaip_sdk/utils.py +0 -167
- glaip_sdk-0.0.2.dist-info/RECORD +0 -28
- {glaip_sdk-0.0.2.dist-info → glaip_sdk-0.0.3.dist-info}/WHEEL +0 -0
- {glaip_sdk-0.0.2.dist-info → glaip_sdk-0.0.3.dist-info}/entry_points.txt +0 -0
glaip_sdk/utils.py
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"""Utility functions for AIP SDK.
|
|
2
|
-
|
|
3
|
-
Authors:
|
|
4
|
-
Raymond Christopher (raymond.christopher@gdplabs.id)
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
from typing import Any
|
|
8
|
-
from uuid import UUID
|
|
9
|
-
|
|
10
|
-
try:
|
|
11
|
-
from rich import box
|
|
12
|
-
from rich.console import Console
|
|
13
|
-
from rich.panel import Panel
|
|
14
|
-
from rich.text import Text
|
|
15
|
-
|
|
16
|
-
RICH_AVAILABLE = True
|
|
17
|
-
except ImportError:
|
|
18
|
-
RICH_AVAILABLE = False
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def is_uuid(value: str) -> bool:
|
|
22
|
-
"""Check if a string is a valid UUID.
|
|
23
|
-
|
|
24
|
-
Args:
|
|
25
|
-
value: String to check
|
|
26
|
-
|
|
27
|
-
Returns:
|
|
28
|
-
True if value is a valid UUID, False otherwise
|
|
29
|
-
"""
|
|
30
|
-
try:
|
|
31
|
-
UUID(value)
|
|
32
|
-
return True
|
|
33
|
-
except (ValueError, TypeError):
|
|
34
|
-
return False
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def sanitize_name(name: str) -> str:
|
|
38
|
-
"""Sanitize a name for resource creation.
|
|
39
|
-
|
|
40
|
-
Args:
|
|
41
|
-
name: Raw name input
|
|
42
|
-
|
|
43
|
-
Returns:
|
|
44
|
-
Sanitized name suitable for resource creation
|
|
45
|
-
"""
|
|
46
|
-
# Remove special characters and normalize
|
|
47
|
-
import re
|
|
48
|
-
|
|
49
|
-
sanitized = re.sub(r"[^a-zA-Z0-9\-_]", "-", name.strip())
|
|
50
|
-
sanitized = re.sub(r"-+", "-", sanitized) # Collapse multiple dashes
|
|
51
|
-
return sanitized.lower().strip("-")
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def format_file_size(size_bytes: int) -> str:
|
|
55
|
-
"""Format file size in human readable format.
|
|
56
|
-
|
|
57
|
-
Args:
|
|
58
|
-
size_bytes: Size in bytes
|
|
59
|
-
|
|
60
|
-
Returns:
|
|
61
|
-
Human readable size string (e.g., "1.5 MB")
|
|
62
|
-
"""
|
|
63
|
-
for unit in ["B", "KB", "MB", "GB"]:
|
|
64
|
-
if size_bytes < 1024.0:
|
|
65
|
-
return f"{size_bytes:.1f} {unit}"
|
|
66
|
-
size_bytes /= 1024.0
|
|
67
|
-
return f"{size_bytes:.1f} TB"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
def progress_bar(iterable, description: str = "Processing"):
|
|
71
|
-
"""Simple progress bar using click.
|
|
72
|
-
|
|
73
|
-
Args:
|
|
74
|
-
iterable: Iterable to process
|
|
75
|
-
description: Progress description
|
|
76
|
-
|
|
77
|
-
Yields:
|
|
78
|
-
Items from iterable with progress display
|
|
79
|
-
"""
|
|
80
|
-
try:
|
|
81
|
-
import click
|
|
82
|
-
|
|
83
|
-
with click.progressbar(iterable, label=description) as bar:
|
|
84
|
-
for item in bar:
|
|
85
|
-
yield item
|
|
86
|
-
except ImportError:
|
|
87
|
-
# Fallback if click not available
|
|
88
|
-
for item in iterable:
|
|
89
|
-
yield item
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
# Rich display utilities for enhanced output
|
|
93
|
-
def print_agent_output(output: str, title: str = "Agent Output") -> None:
|
|
94
|
-
"""Print agent output with rich formatting.
|
|
95
|
-
|
|
96
|
-
Args:
|
|
97
|
-
output: The agent's response text
|
|
98
|
-
title: Title for the output panel
|
|
99
|
-
"""
|
|
100
|
-
if RICH_AVAILABLE:
|
|
101
|
-
console = Console()
|
|
102
|
-
panel = Panel(
|
|
103
|
-
Text(output, style="green"),
|
|
104
|
-
title=title,
|
|
105
|
-
border_style="green",
|
|
106
|
-
box=box.ROUNDED,
|
|
107
|
-
)
|
|
108
|
-
console.print(panel)
|
|
109
|
-
else:
|
|
110
|
-
print(f"\n=== {title} ===")
|
|
111
|
-
print(output)
|
|
112
|
-
print("=" * (len(title) + 8))
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
def print_agent_created(agent: Any) -> None:
|
|
116
|
-
"""Print agent creation success with rich formatting.
|
|
117
|
-
|
|
118
|
-
Args:
|
|
119
|
-
agent: The created agent object
|
|
120
|
-
"""
|
|
121
|
-
if RICH_AVAILABLE:
|
|
122
|
-
console = Console()
|
|
123
|
-
panel = Panel(
|
|
124
|
-
f"[green]✅ Agent '{agent.name}' created successfully![/green]\n\n"
|
|
125
|
-
f"ID: {agent.id}\n"
|
|
126
|
-
f"Model: {getattr(agent, 'model', 'N/A')}\n"
|
|
127
|
-
f"Type: {getattr(agent, 'type', 'config')}\n"
|
|
128
|
-
f"Framework: {getattr(agent, 'framework', 'langchain')}\n"
|
|
129
|
-
f"Version: {getattr(agent, 'version', '1.0')}",
|
|
130
|
-
title="🤖 Agent Created",
|
|
131
|
-
border_style="green",
|
|
132
|
-
box=box.ROUNDED,
|
|
133
|
-
)
|
|
134
|
-
console.print(panel)
|
|
135
|
-
else:
|
|
136
|
-
print(f"✅ Agent '{agent.name}' created successfully!")
|
|
137
|
-
print(f"ID: {agent.id}")
|
|
138
|
-
print(f"Model: {getattr(agent, 'model', 'N/A')}")
|
|
139
|
-
print(f"Type: {getattr(agent, 'type', 'config')}")
|
|
140
|
-
print(f"Framework: {getattr(agent, 'framework', 'langchain')}")
|
|
141
|
-
print(f"Version: {getattr(agent, 'version', '1.0')}")
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
def print_agent_updated(agent: Any) -> None:
|
|
145
|
-
"""Print agent update success with rich formatting.
|
|
146
|
-
|
|
147
|
-
Args:
|
|
148
|
-
agent: The updated agent object
|
|
149
|
-
"""
|
|
150
|
-
if RICH_AVAILABLE:
|
|
151
|
-
console = Console()
|
|
152
|
-
console.print(f"[green]✅ Agent '{agent.name}' updated successfully[/green]")
|
|
153
|
-
else:
|
|
154
|
-
print(f"✅ Agent '{agent.name}' updated successfully")
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
def print_agent_deleted(agent_id: str) -> None:
|
|
158
|
-
"""Print agent deletion success with rich formatting.
|
|
159
|
-
|
|
160
|
-
Args:
|
|
161
|
-
agent_id: The deleted agent's ID
|
|
162
|
-
"""
|
|
163
|
-
if RICH_AVAILABLE:
|
|
164
|
-
console = Console()
|
|
165
|
-
console.print(f"[green]✅ Agent deleted successfully (ID: {agent_id})[/green]")
|
|
166
|
-
else:
|
|
167
|
-
print(f"✅ Agent deleted successfully (ID: {agent_id})")
|
glaip_sdk-0.0.2.dist-info/RECORD
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
glaip_sdk/__init__.py,sha256=4-Ckm97tbG2cCxBxQZS-aCYwojPu029q68FhBIMQ-Jg,296
|
|
2
|
-
glaip_sdk/exceptions.py,sha256=0XPbST00lfeBm2UuhR5mlPQ4c47Zom_r4QFrax4MEKE,1504
|
|
3
|
-
glaip_sdk/models.py,sha256=HJ74EmM8CUmMhaH4AzDN01PHSbiy76-cMmVVoZhjQo4,6443
|
|
4
|
-
glaip_sdk/utils.py,sha256=IO7hu3WbOUIDEyGUOW79pkUF9p3_giadnFORmrOtRzU,4511
|
|
5
|
-
glaip_sdk/cli/__init__.py,sha256=cPI-uOOBww_ESiH6NQBdJiTg8CUVNigFOU3kl0tgTuI,143
|
|
6
|
-
glaip_sdk/cli/config.py,sha256=y_hdydL9vI_7eMumIxqKWCX5cbW0GDuf0UlO4ttcTm8,20132
|
|
7
|
-
glaip_sdk/cli/main.py,sha256=ez3AslOhAyDei5UolrlGyJdtY9aFlNV5Pi1osO6eVjk,10080
|
|
8
|
-
glaip_sdk/cli/utils.py,sha256=iTTx9MwTmSCKmJUF-JFctvpDqzN7wRTJB0FWZvlRRmQ,22221
|
|
9
|
-
glaip_sdk/cli/commands/__init__.py,sha256=WShiuYqHcbuexPboibDJ_Q2jOPIWp-TgsyUAO2-T20I,134
|
|
10
|
-
glaip_sdk/cli/commands/agents.py,sha256=UoE_cRowmos19MyuMf-bKxKffD_WxqKhDdDyoG7dBtY,13644
|
|
11
|
-
glaip_sdk/cli/commands/configure.py,sha256=Mbo4F8S4wsYyG73OoXxsNoybuikv87FZyGUKu-3Od18,9122
|
|
12
|
-
glaip_sdk/cli/commands/init.py,sha256=FmzBhRo4qWO3LZHySkuBSpA6Pg7TwwUfVGxE4RXKlrg,5473
|
|
13
|
-
glaip_sdk/cli/commands/mcps.py,sha256=RNChpi0L2nlSxzQ4iHp1IpUS3EhT6_8g-tTCV94kF9A,15551
|
|
14
|
-
glaip_sdk/cli/commands/models.py,sha256=j8VqQ2edSEvD-sQXWm8ifUco9gX8J-OBib6OvzthpqU,1405
|
|
15
|
-
glaip_sdk/cli/commands/tools.py,sha256=I99-g2Z4p5o3e-k63CwH4_kMrlJoM8XJ8C6vuBt4_aE,9825
|
|
16
|
-
glaip_sdk/client/__init__.py,sha256=ao8Psmi1UNuqw48dpIW2JqD4feIV10gVtDqKG47J5yU,5536
|
|
17
|
-
glaip_sdk/client/agents.py,sha256=GI_HvSo9tDFuGvFDSziAN0R72AJznzVFY_F81vdN9V8,15621
|
|
18
|
-
glaip_sdk/client/base.py,sha256=J5BhyP96mXl-0UKunPn7RR0b92djX0VFB97gEYo3ZvA,7391
|
|
19
|
-
glaip_sdk/client/mcps.py,sha256=kS1D6td076DEFrxpQqyvUfyXscKxKpo9bNhsH_gbrF4,2986
|
|
20
|
-
glaip_sdk/client/tools.py,sha256=pRk3NL-t3LSvz25DJ3gEgaARa-ik__jk9ldN8gJxnOw,6490
|
|
21
|
-
glaip_sdk/client/validators.py,sha256=3MtOt11IivEwQAgzmdRGWUBzP223ytECOLU_a77x7IU,7101
|
|
22
|
-
glaip_sdk/config/constants.py,sha256=zbDlf10RolKhQc5SlxMtZ_al1QLEwSDjvkq3_DuaYI4,521
|
|
23
|
-
glaip_sdk/utils/__init__.py,sha256=0ATfBlxy2CoJidl33VnmF159DpdC_D_vRLIDDBlAM8g,2063
|
|
24
|
-
glaip_sdk/utils/run_renderer.py,sha256=41ybO1jxtJ5Uyys3UobwUBlwACV8PsuPje-g430ceVs,43359
|
|
25
|
-
glaip_sdk-0.0.2.dist-info/METADATA,sha256=ptYk_QBFAeecF8by6GDKGc_CBtS01xpKyfl3xAamMUc,20200
|
|
26
|
-
glaip_sdk-0.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
27
|
-
glaip_sdk-0.0.2.dist-info/entry_points.txt,sha256=65vNPUggyYnVGhuw7RhNJ8Fp2jygTcX0yxJBcBY3iLU,48
|
|
28
|
-
glaip_sdk-0.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|