glaip-sdk 0.2.0__py3-none-any.whl → 0.2.2__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/_version.py +8 -0
- glaip_sdk/branding.py +13 -0
- glaip_sdk/cli/commands/agents.py +131 -5
- glaip_sdk/cli/commands/mcps.py +16 -0
- glaip_sdk/cli/commands/models.py +8 -0
- glaip_sdk/cli/commands/tools.py +8 -0
- glaip_sdk/cli/commands/transcripts.py +8 -0
- glaip_sdk/cli/constants.py +35 -0
- glaip_sdk/cli/context.py +8 -0
- glaip_sdk/cli/display.py +34 -19
- glaip_sdk/cli/main.py +13 -4
- glaip_sdk/cli/masking.py +8 -33
- glaip_sdk/cli/pager.py +9 -10
- glaip_sdk/cli/slash/agent_session.py +54 -7
- glaip_sdk/cli/slash/prompt.py +5 -0
- glaip_sdk/cli/slash/session.py +214 -4
- glaip_sdk/cli/transcript/viewer.py +226 -0
- glaip_sdk/cli/update_notifier.py +7 -4
- glaip_sdk/cli/utils.py +84 -27
- glaip_sdk/client/_agent_payloads.py +30 -0
- glaip_sdk/client/agents.py +144 -0
- glaip_sdk/client/main.py +5 -0
- glaip_sdk/client/run_rendering.py +66 -0
- glaip_sdk/utils/serialization.py +16 -0
- {glaip_sdk-0.2.0.dist-info → glaip_sdk-0.2.2.dist-info}/METADATA +1 -1
- {glaip_sdk-0.2.0.dist-info → glaip_sdk-0.2.2.dist-info}/RECORD +28 -27
- {glaip_sdk-0.2.0.dist-info → glaip_sdk-0.2.2.dist-info}/WHEEL +0 -0
- {glaip_sdk-0.2.0.dist-info → glaip_sdk-0.2.2.dist-info}/entry_points.txt +0 -0
|
@@ -209,6 +209,11 @@ class AgentListParams:
|
|
|
209
209
|
return params
|
|
210
210
|
|
|
211
211
|
def _base_filter_params(self) -> dict[str, Any]:
|
|
212
|
+
"""Build base filter parameters from non-None fields.
|
|
213
|
+
|
|
214
|
+
Returns:
|
|
215
|
+
Dictionary of filter parameters with non-None values.
|
|
216
|
+
"""
|
|
212
217
|
return {
|
|
213
218
|
key: value
|
|
214
219
|
for key, value in (
|
|
@@ -221,6 +226,11 @@ class AgentListParams:
|
|
|
221
226
|
}
|
|
222
227
|
|
|
223
228
|
def _apply_pagination_params(self, params: dict[str, Any]) -> None:
|
|
229
|
+
"""Apply pagination parameters to the params dictionary.
|
|
230
|
+
|
|
231
|
+
Args:
|
|
232
|
+
params: Dictionary to update with pagination parameters.
|
|
233
|
+
"""
|
|
224
234
|
if self.limit is not None:
|
|
225
235
|
if not 1 <= self.limit <= 100:
|
|
226
236
|
raise ValueError("limit must be between 1 and 100 inclusive")
|
|
@@ -238,6 +248,11 @@ class AgentListParams:
|
|
|
238
248
|
params["sync_langflow_agents"] = str(self.sync_langflow_agents).lower()
|
|
239
249
|
|
|
240
250
|
def _apply_timestamp_filters(self, params: dict[str, Any]) -> None:
|
|
251
|
+
"""Apply timestamp filter parameters to the params dictionary.
|
|
252
|
+
|
|
253
|
+
Args:
|
|
254
|
+
params: Dictionary to update with timestamp filter parameters.
|
|
255
|
+
"""
|
|
241
256
|
timestamp_filters = {
|
|
242
257
|
"created_at_start": self.created_at_start,
|
|
243
258
|
"created_at_end": self.created_at_end,
|
|
@@ -249,6 +264,11 @@ class AgentListParams:
|
|
|
249
264
|
params[key] = value
|
|
250
265
|
|
|
251
266
|
def _apply_metadata_filters(self, params: dict[str, Any]) -> None:
|
|
267
|
+
"""Apply metadata filter parameters to the params dictionary.
|
|
268
|
+
|
|
269
|
+
Args:
|
|
270
|
+
params: Dictionary to update with metadata filter parameters.
|
|
271
|
+
"""
|
|
252
272
|
if not self.metadata:
|
|
253
273
|
return
|
|
254
274
|
for key, value in self.metadata.items():
|
|
@@ -269,12 +289,22 @@ class AgentListResult:
|
|
|
269
289
|
message: str | None = None
|
|
270
290
|
|
|
271
291
|
def __len__(self) -> int: # pragma: no cover - simple delegation
|
|
292
|
+
"""Return the number of items in the result list."""
|
|
272
293
|
return len(self.items)
|
|
273
294
|
|
|
274
295
|
def __iter__(self): # pragma: no cover - simple delegation
|
|
296
|
+
"""Return an iterator over the items in the result list."""
|
|
275
297
|
return iter(self.items)
|
|
276
298
|
|
|
277
299
|
def __getitem__(self, index: int) -> Any: # pragma: no cover - simple delegation
|
|
300
|
+
"""Get an item from the result list by index.
|
|
301
|
+
|
|
302
|
+
Args:
|
|
303
|
+
index: Index of the item to retrieve.
|
|
304
|
+
|
|
305
|
+
Returns:
|
|
306
|
+
The item at the specified index.
|
|
307
|
+
"""
|
|
278
308
|
return self.items[index]
|
|
279
309
|
|
|
280
310
|
|
glaip_sdk/client/agents.py
CHANGED
|
@@ -366,6 +366,11 @@ class AgentClient(BaseClient):
|
|
|
366
366
|
# Renderer delegation helpers
|
|
367
367
|
# ------------------------------------------------------------------ #
|
|
368
368
|
def _get_renderer_manager(self) -> AgentRunRenderingManager:
|
|
369
|
+
"""Get or create the renderer manager instance.
|
|
370
|
+
|
|
371
|
+
Returns:
|
|
372
|
+
AgentRunRenderingManager instance.
|
|
373
|
+
"""
|
|
369
374
|
manager = getattr(self, "_renderer_manager", None)
|
|
370
375
|
if manager is None:
|
|
371
376
|
manager = AgentRunRenderingManager(logger)
|
|
@@ -373,6 +378,15 @@ class AgentClient(BaseClient):
|
|
|
373
378
|
return manager
|
|
374
379
|
|
|
375
380
|
def _create_renderer(self, renderer: RichStreamRenderer | str | None, **kwargs: Any) -> RichStreamRenderer:
|
|
381
|
+
"""Create or return a renderer instance.
|
|
382
|
+
|
|
383
|
+
Args:
|
|
384
|
+
renderer: Renderer instance, string identifier, or None.
|
|
385
|
+
**kwargs: Additional keyword arguments (e.g., verbose).
|
|
386
|
+
|
|
387
|
+
Returns:
|
|
388
|
+
RichStreamRenderer instance.
|
|
389
|
+
"""
|
|
376
390
|
manager = self._get_renderer_manager()
|
|
377
391
|
verbose = kwargs.get("verbose", False)
|
|
378
392
|
if isinstance(renderer, RichStreamRenderer) or hasattr(renderer, "on_start"):
|
|
@@ -387,6 +401,18 @@ class AgentClient(BaseClient):
|
|
|
387
401
|
agent_name: str | None,
|
|
388
402
|
meta: dict[str, Any],
|
|
389
403
|
) -> tuple[str, dict[str, Any], float | None, float | None]:
|
|
404
|
+
"""Process stream events from an HTTP response.
|
|
405
|
+
|
|
406
|
+
Args:
|
|
407
|
+
stream_response: HTTP response stream.
|
|
408
|
+
renderer: Renderer to use for displaying events.
|
|
409
|
+
timeout_seconds: Timeout in seconds.
|
|
410
|
+
agent_name: Optional agent name.
|
|
411
|
+
meta: Metadata dictionary.
|
|
412
|
+
|
|
413
|
+
Returns:
|
|
414
|
+
Tuple of (final_text, stats_usage, started_monotonic, finished_monotonic).
|
|
415
|
+
"""
|
|
390
416
|
manager = self._get_renderer_manager()
|
|
391
417
|
return manager.process_stream_events(
|
|
392
418
|
stream_response,
|
|
@@ -404,6 +430,18 @@ class AgentClient(BaseClient):
|
|
|
404
430
|
started_monotonic: float | None,
|
|
405
431
|
finished_monotonic: float | None,
|
|
406
432
|
) -> str:
|
|
433
|
+
"""Finalize the renderer and return the final text.
|
|
434
|
+
|
|
435
|
+
Args:
|
|
436
|
+
renderer: Renderer to finalize.
|
|
437
|
+
final_text: Final text content.
|
|
438
|
+
stats_usage: Usage statistics dictionary.
|
|
439
|
+
started_monotonic: Start time (monotonic).
|
|
440
|
+
finished_monotonic: Finish time (monotonic).
|
|
441
|
+
|
|
442
|
+
Returns:
|
|
443
|
+
Final text string.
|
|
444
|
+
"""
|
|
407
445
|
manager = self._get_renderer_manager()
|
|
408
446
|
return manager.finalize_renderer(
|
|
409
447
|
renderer,
|
|
@@ -414,11 +452,21 @@ class AgentClient(BaseClient):
|
|
|
414
452
|
)
|
|
415
453
|
|
|
416
454
|
def _get_tool_client(self) -> ToolClient:
|
|
455
|
+
"""Get or create the tool client instance.
|
|
456
|
+
|
|
457
|
+
Returns:
|
|
458
|
+
ToolClient instance.
|
|
459
|
+
"""
|
|
417
460
|
if self._tool_client is None:
|
|
418
461
|
self._tool_client = ToolClient(parent_client=self)
|
|
419
462
|
return self._tool_client
|
|
420
463
|
|
|
421
464
|
def _get_mcp_client(self) -> MCPClient:
|
|
465
|
+
"""Get or create the MCP client instance.
|
|
466
|
+
|
|
467
|
+
Returns:
|
|
468
|
+
MCPClient instance.
|
|
469
|
+
"""
|
|
422
470
|
if self._mcp_client is None:
|
|
423
471
|
self._mcp_client = MCPClient(parent_client=self)
|
|
424
472
|
return self._mcp_client
|
|
@@ -428,6 +476,15 @@ class AgentClient(BaseClient):
|
|
|
428
476
|
entry: Any,
|
|
429
477
|
fallback_iter: Iterator[Any] | None,
|
|
430
478
|
) -> tuple[str | None, str | None]:
|
|
479
|
+
"""Normalize a reference entry to extract ID and name.
|
|
480
|
+
|
|
481
|
+
Args:
|
|
482
|
+
entry: Reference entry (string, dict, or other).
|
|
483
|
+
fallback_iter: Optional iterator for fallback values.
|
|
484
|
+
|
|
485
|
+
Returns:
|
|
486
|
+
Tuple of (entry_id, entry_name).
|
|
487
|
+
"""
|
|
431
488
|
entry_id: str | None = None
|
|
432
489
|
entry_name: str | None = None
|
|
433
490
|
|
|
@@ -464,6 +521,19 @@ class AgentClient(BaseClient):
|
|
|
464
521
|
label: str,
|
|
465
522
|
plural_label: str | None = None,
|
|
466
523
|
) -> list[str] | None:
|
|
524
|
+
"""Resolve a list of resource references to IDs.
|
|
525
|
+
|
|
526
|
+
Args:
|
|
527
|
+
items: List of resource references to resolve.
|
|
528
|
+
references: Optional list of reference objects for fallback.
|
|
529
|
+
fetch_by_id: Function to fetch resource by ID.
|
|
530
|
+
find_by_name: Function to find resources by name.
|
|
531
|
+
label: Singular label for error messages.
|
|
532
|
+
plural_label: Plural label for error messages.
|
|
533
|
+
|
|
534
|
+
Returns:
|
|
535
|
+
List of resolved resource IDs, or None if items is empty.
|
|
536
|
+
"""
|
|
467
537
|
if not items:
|
|
468
538
|
return None
|
|
469
539
|
|
|
@@ -495,6 +565,22 @@ class AgentClient(BaseClient):
|
|
|
495
565
|
singular: str,
|
|
496
566
|
plural: str,
|
|
497
567
|
) -> str:
|
|
568
|
+
"""Resolve a single resource reference to an ID.
|
|
569
|
+
|
|
570
|
+
Args:
|
|
571
|
+
entry: Resource reference to resolve.
|
|
572
|
+
fallback_iter: Optional iterator for fallback values.
|
|
573
|
+
fetch_by_id: Function to fetch resource by ID.
|
|
574
|
+
find_by_name: Function to find resources by name.
|
|
575
|
+
singular: Singular label for error messages.
|
|
576
|
+
plural: Plural label for error messages.
|
|
577
|
+
|
|
578
|
+
Returns:
|
|
579
|
+
Resolved resource ID string.
|
|
580
|
+
|
|
581
|
+
Raises:
|
|
582
|
+
ValueError: If the resource cannot be resolved.
|
|
583
|
+
"""
|
|
498
584
|
entry_id, entry_name = self._normalise_reference_entry(entry, fallback_iter)
|
|
499
585
|
|
|
500
586
|
validated_id = self._validate_resource_id(fetch_by_id, entry_id)
|
|
@@ -511,6 +597,14 @@ class AgentClient(BaseClient):
|
|
|
511
597
|
|
|
512
598
|
@staticmethod
|
|
513
599
|
def _coerce_reference_value(entry: Any) -> str:
|
|
600
|
+
"""Coerce a reference entry to a string value.
|
|
601
|
+
|
|
602
|
+
Args:
|
|
603
|
+
entry: Reference entry (dict, string, or other).
|
|
604
|
+
|
|
605
|
+
Returns:
|
|
606
|
+
String representation of the reference.
|
|
607
|
+
"""
|
|
514
608
|
if isinstance(entry, dict):
|
|
515
609
|
if entry.get("id"):
|
|
516
610
|
return str(entry["id"])
|
|
@@ -520,6 +614,15 @@ class AgentClient(BaseClient):
|
|
|
520
614
|
|
|
521
615
|
@staticmethod
|
|
522
616
|
def _validate_resource_id(fetch_by_id: Callable[[str], Any], candidate_id: str | None) -> str | None:
|
|
617
|
+
"""Validate a resource ID by attempting to fetch it.
|
|
618
|
+
|
|
619
|
+
Args:
|
|
620
|
+
fetch_by_id: Function to fetch resource by ID.
|
|
621
|
+
candidate_id: Candidate ID to validate.
|
|
622
|
+
|
|
623
|
+
Returns:
|
|
624
|
+
Validated ID if found, None otherwise.
|
|
625
|
+
"""
|
|
523
626
|
if not candidate_id:
|
|
524
627
|
return None
|
|
525
628
|
try:
|
|
@@ -535,6 +638,20 @@ class AgentClient(BaseClient):
|
|
|
535
638
|
singular: str,
|
|
536
639
|
plural: str,
|
|
537
640
|
) -> tuple[str, bool]:
|
|
641
|
+
"""Resolve a resource by name to an ID.
|
|
642
|
+
|
|
643
|
+
Args:
|
|
644
|
+
find_by_name: Function to find resources by name.
|
|
645
|
+
entry_name: Name of the resource to find.
|
|
646
|
+
singular: Singular label for error messages.
|
|
647
|
+
plural: Plural label for error messages.
|
|
648
|
+
|
|
649
|
+
Returns:
|
|
650
|
+
Tuple of (resolved_id, success).
|
|
651
|
+
|
|
652
|
+
Raises:
|
|
653
|
+
ValueError: If resource not found or multiple matches exist.
|
|
654
|
+
"""
|
|
538
655
|
try:
|
|
539
656
|
matches = find_by_name(entry_name)
|
|
540
657
|
except Exception:
|
|
@@ -555,6 +672,15 @@ class AgentClient(BaseClient):
|
|
|
555
672
|
tools: list[Any] | None,
|
|
556
673
|
references: list[Any] | None = None,
|
|
557
674
|
) -> list[str] | None:
|
|
675
|
+
"""Resolve tool references to IDs.
|
|
676
|
+
|
|
677
|
+
Args:
|
|
678
|
+
tools: List of tool references to resolve.
|
|
679
|
+
references: Optional list of reference objects for fallback.
|
|
680
|
+
|
|
681
|
+
Returns:
|
|
682
|
+
List of resolved tool IDs, or None if tools is empty.
|
|
683
|
+
"""
|
|
558
684
|
tool_client = self._get_tool_client()
|
|
559
685
|
return self._resolve_resource_ids(
|
|
560
686
|
tools,
|
|
@@ -570,6 +696,15 @@ class AgentClient(BaseClient):
|
|
|
570
696
|
agents: list[Any] | None,
|
|
571
697
|
references: list[Any] | None = None,
|
|
572
698
|
) -> list[str] | None:
|
|
699
|
+
"""Resolve agent references to IDs.
|
|
700
|
+
|
|
701
|
+
Args:
|
|
702
|
+
agents: List of agent references to resolve.
|
|
703
|
+
references: Optional list of reference objects for fallback.
|
|
704
|
+
|
|
705
|
+
Returns:
|
|
706
|
+
List of resolved agent IDs, or None if agents is empty.
|
|
707
|
+
"""
|
|
573
708
|
return self._resolve_resource_ids(
|
|
574
709
|
agents,
|
|
575
710
|
references,
|
|
@@ -584,6 +719,15 @@ class AgentClient(BaseClient):
|
|
|
584
719
|
mcps: list[Any] | None,
|
|
585
720
|
references: list[Any] | None = None,
|
|
586
721
|
) -> list[str] | None:
|
|
722
|
+
"""Resolve MCP references to IDs.
|
|
723
|
+
|
|
724
|
+
Args:
|
|
725
|
+
mcps: List of MCP references to resolve.
|
|
726
|
+
references: Optional list of reference objects for fallback.
|
|
727
|
+
|
|
728
|
+
Returns:
|
|
729
|
+
List of resolved MCP IDs, or None if mcps is empty.
|
|
730
|
+
"""
|
|
587
731
|
mcp_client = self._get_mcp_client()
|
|
588
732
|
return self._resolve_resource_ids(
|
|
589
733
|
mcps,
|
glaip_sdk/client/main.py
CHANGED
|
@@ -217,6 +217,11 @@ class Client(BaseClient):
|
|
|
217
217
|
|
|
218
218
|
@timeout.setter
|
|
219
219
|
def timeout(self, value: float) -> None: # type: ignore[override]
|
|
220
|
+
"""Set the client timeout and propagate to sub-clients.
|
|
221
|
+
|
|
222
|
+
Args:
|
|
223
|
+
value: Timeout value in seconds.
|
|
224
|
+
"""
|
|
220
225
|
# Rebuild the root http client
|
|
221
226
|
BaseClient.timeout.fset(self, value) # call parent setter
|
|
222
227
|
# Propagate the new session to sub-clients so they don't hold a closed client
|
|
@@ -124,6 +124,11 @@ class AgentRunRenderingManager:
|
|
|
124
124
|
renderer.on_start(meta)
|
|
125
125
|
|
|
126
126
|
def _create_silent_renderer(self) -> RichStreamRenderer:
|
|
127
|
+
"""Create a silent renderer that outputs to a string buffer.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
RichStreamRenderer configured for silent output.
|
|
131
|
+
"""
|
|
127
132
|
silent_config = RendererConfig(
|
|
128
133
|
live=False,
|
|
129
134
|
persist_live=False,
|
|
@@ -136,6 +141,11 @@ class AgentRunRenderingManager:
|
|
|
136
141
|
)
|
|
137
142
|
|
|
138
143
|
def _create_minimal_renderer(self) -> RichStreamRenderer:
|
|
144
|
+
"""Create a minimal renderer with reduced output.
|
|
145
|
+
|
|
146
|
+
Returns:
|
|
147
|
+
RichStreamRenderer configured for minimal output.
|
|
148
|
+
"""
|
|
139
149
|
minimal_config = RendererConfig(
|
|
140
150
|
live=False,
|
|
141
151
|
persist_live=False,
|
|
@@ -148,6 +158,11 @@ class AgentRunRenderingManager:
|
|
|
148
158
|
)
|
|
149
159
|
|
|
150
160
|
def _create_verbose_renderer(self) -> RichStreamRenderer:
|
|
161
|
+
"""Create a verbose renderer with detailed output.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
RichStreamRenderer configured for verbose output.
|
|
165
|
+
"""
|
|
151
166
|
verbose_config = RendererConfig(
|
|
152
167
|
live=False,
|
|
153
168
|
append_finished_snapshots=False,
|
|
@@ -159,6 +174,14 @@ class AgentRunRenderingManager:
|
|
|
159
174
|
)
|
|
160
175
|
|
|
161
176
|
def _create_default_renderer(self, verbose: bool) -> RichStreamRenderer:
|
|
177
|
+
"""Create the default renderer based on verbosity.
|
|
178
|
+
|
|
179
|
+
Args:
|
|
180
|
+
verbose: Whether to create a verbose renderer.
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
RichStreamRenderer instance.
|
|
184
|
+
"""
|
|
162
185
|
if verbose:
|
|
163
186
|
return self._create_verbose_renderer()
|
|
164
187
|
default_config = RendererConfig()
|
|
@@ -214,12 +237,27 @@ class AgentRunRenderingManager:
|
|
|
214
237
|
meta: dict[str, Any],
|
|
215
238
|
renderer: RichStreamRenderer,
|
|
216
239
|
) -> None:
|
|
240
|
+
"""Capture request ID from response headers and update metadata.
|
|
241
|
+
|
|
242
|
+
Args:
|
|
243
|
+
stream_response: HTTP response stream.
|
|
244
|
+
meta: Metadata dictionary to update.
|
|
245
|
+
renderer: Renderer instance.
|
|
246
|
+
"""
|
|
217
247
|
req_id = stream_response.headers.get("x-request-id") or stream_response.headers.get("x-run-id")
|
|
218
248
|
if req_id:
|
|
219
249
|
meta["run_id"] = req_id
|
|
220
250
|
renderer.on_start(meta)
|
|
221
251
|
|
|
222
252
|
def _maybe_start_timer(self, event: dict[str, Any]) -> float | None:
|
|
253
|
+
"""Start timing if this is a content-bearing event.
|
|
254
|
+
|
|
255
|
+
Args:
|
|
256
|
+
event: Event dictionary.
|
|
257
|
+
|
|
258
|
+
Returns:
|
|
259
|
+
Monotonic time if timer should start, None otherwise.
|
|
260
|
+
"""
|
|
223
261
|
try:
|
|
224
262
|
ev = json.loads(event["data"])
|
|
225
263
|
except json.JSONDecodeError:
|
|
@@ -237,6 +275,18 @@ class AgentRunRenderingManager:
|
|
|
237
275
|
stats_usage: dict[str, Any],
|
|
238
276
|
meta: dict[str, Any],
|
|
239
277
|
) -> tuple[str, dict[str, Any]]:
|
|
278
|
+
"""Process a single streaming event.
|
|
279
|
+
|
|
280
|
+
Args:
|
|
281
|
+
event: Event dictionary.
|
|
282
|
+
renderer: Renderer instance.
|
|
283
|
+
final_text: Accumulated text so far.
|
|
284
|
+
stats_usage: Usage statistics dictionary.
|
|
285
|
+
meta: Metadata dictionary.
|
|
286
|
+
|
|
287
|
+
Returns:
|
|
288
|
+
Tuple of (updated_final_text, updated_stats_usage).
|
|
289
|
+
"""
|
|
240
290
|
try:
|
|
241
291
|
ev = json.loads(event["data"])
|
|
242
292
|
except json.JSONDecodeError:
|
|
@@ -292,6 +342,15 @@ class AgentRunRenderingManager:
|
|
|
292
342
|
return None
|
|
293
343
|
|
|
294
344
|
def _handle_content_event(self, ev: dict[str, Any], final_text: str) -> str:
|
|
345
|
+
"""Handle a content event and update final text.
|
|
346
|
+
|
|
347
|
+
Args:
|
|
348
|
+
ev: Event dictionary.
|
|
349
|
+
final_text: Current accumulated text.
|
|
350
|
+
|
|
351
|
+
Returns:
|
|
352
|
+
Updated final text.
|
|
353
|
+
"""
|
|
295
354
|
content = ev.get("content", "")
|
|
296
355
|
if not content.startswith("Artifact received:"):
|
|
297
356
|
return content
|
|
@@ -303,6 +362,13 @@ class AgentRunRenderingManager:
|
|
|
303
362
|
meta: dict[str, Any],
|
|
304
363
|
renderer: RichStreamRenderer,
|
|
305
364
|
) -> None:
|
|
365
|
+
"""Handle a run_info event and update metadata.
|
|
366
|
+
|
|
367
|
+
Args:
|
|
368
|
+
ev: Event dictionary.
|
|
369
|
+
meta: Metadata dictionary to update.
|
|
370
|
+
renderer: Renderer instance.
|
|
371
|
+
"""
|
|
306
372
|
if ev.get("model"):
|
|
307
373
|
meta["model"] = ev["model"]
|
|
308
374
|
renderer.on_start(meta)
|
glaip_sdk/utils/serialization.py
CHANGED
|
@@ -88,9 +88,20 @@ def write_yaml(file_path: Path, data: dict[str, Any]) -> None:
|
|
|
88
88
|
|
|
89
89
|
# Custom YAML dumper for user-friendly instruction formatting
|
|
90
90
|
class LiteralString(str):
|
|
91
|
+
"""String subclass for YAML literal block scalar formatting."""
|
|
92
|
+
|
|
91
93
|
pass
|
|
92
94
|
|
|
93
95
|
def literal_string_representer(dumper: yaml.Dumper, data: "LiteralString") -> yaml.nodes.Node:
|
|
96
|
+
"""YAML representer for LiteralString to use literal block scalar style.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
dumper: YAML dumper instance.
|
|
100
|
+
data: LiteralString instance to represent.
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
YAML node with literal block scalar style for multiline strings.
|
|
104
|
+
"""
|
|
94
105
|
# Use literal block scalar (|) for multiline strings to preserve formatting
|
|
95
106
|
if "\n" in data:
|
|
96
107
|
return dumper.represent_scalar("tag:yaml.org,2002:str", data, style="|")
|
|
@@ -239,6 +250,11 @@ def _iter_public_attribute_names(resource: Any) -> Iterable[str]:
|
|
|
239
250
|
names: list[str] = []
|
|
240
251
|
|
|
241
252
|
def _collect(candidates: Iterable[str] | None) -> None:
|
|
253
|
+
"""Collect unique candidate attribute names.
|
|
254
|
+
|
|
255
|
+
Args:
|
|
256
|
+
candidates: Iterable of candidate attribute names.
|
|
257
|
+
"""
|
|
242
258
|
for candidate in candidates or ():
|
|
243
259
|
if candidate not in seen:
|
|
244
260
|
seen.add(candidate)
|
|
@@ -1,50 +1,51 @@
|
|
|
1
1
|
glaip_sdk/__init__.py,sha256=7ICOkPeiwQGkadqxIgJXOYPHcJOHYRIF_GU0xkjOtSE,366
|
|
2
|
-
glaip_sdk/_version.py,sha256
|
|
3
|
-
glaip_sdk/branding.py,sha256=
|
|
2
|
+
glaip_sdk/_version.py,sha256=5CHGCxx_36fgmMWuEx6jJ2CzzM-i9eBFyQWFwBi23XE,2259
|
|
3
|
+
glaip_sdk/branding.py,sha256=tLqYCIHMkUf8p2smpuAGNptwaKUN38G4mlh0A0DOl_w,7823
|
|
4
4
|
glaip_sdk/cli/__init__.py,sha256=xCCfuF1Yc7mpCDcfhHZTX0vizvtrDSLeT8MJ3V7m5A0,156
|
|
5
5
|
glaip_sdk/cli/agent_config.py,sha256=YAbFKrTNTRqNA6b0i0Q3pH-01rhHDRi5v8dxSFwGSwM,2401
|
|
6
6
|
glaip_sdk/cli/auth.py,sha256=oZLgZTqVgx_o2ppcp1ueFwuu88acOUPUr9ed1WDe_HY,15860
|
|
7
7
|
glaip_sdk/cli/commands/__init__.py,sha256=6Z3ASXDut0lAbUX_umBFtxPzzFyqoiZfVeTahThFu1A,219
|
|
8
|
-
glaip_sdk/cli/commands/agents.py,sha256=
|
|
8
|
+
glaip_sdk/cli/commands/agents.py,sha256=26LiI1TkGTcFS32OYcX6mi3_atSw1aBOG-a7WXEErnk,46711
|
|
9
9
|
glaip_sdk/cli/commands/configure.py,sha256=tcJeHMLXnkT_aeR5-5vsDAg2RwOvIMDxZcWCr6qbHqk,11389
|
|
10
|
-
glaip_sdk/cli/commands/mcps.py,sha256=
|
|
11
|
-
glaip_sdk/cli/commands/models.py,sha256=
|
|
12
|
-
glaip_sdk/cli/commands/tools.py,sha256=
|
|
13
|
-
glaip_sdk/cli/commands/transcripts.py,sha256=
|
|
10
|
+
glaip_sdk/cli/commands/mcps.py,sha256=v5UCvXlybNkaJCWfqSXJxo98eF7iqD0R3KB9I6sRuA0,37516
|
|
11
|
+
glaip_sdk/cli/commands/models.py,sha256=hd_X1ymn-fqIiU1YN5Imf_e5ayhhA0dxo-PNRqSpofs,2032
|
|
12
|
+
glaip_sdk/cli/commands/tools.py,sha256=Ojf3_HvCKT4uU4_weMXy4ahPnIBCeUEl00qEUD_ZBKY,18064
|
|
13
|
+
glaip_sdk/cli/commands/transcripts.py,sha256=5W_wRVzyCh813xEXh6UDwzRy4anbc2Shz03ZIVdBhyM,26379
|
|
14
14
|
glaip_sdk/cli/commands/update.py,sha256=rIZo_x-tvpvcwpQLpwYwso1ix6qTHuNNTL4egmn5fEM,1812
|
|
15
15
|
glaip_sdk/cli/config.py,sha256=2NZxFyt8jc6CMRUbuxx7sq_wsfTJXmwQGn09hhYHGnE,1341
|
|
16
|
-
glaip_sdk/cli/
|
|
17
|
-
glaip_sdk/cli/
|
|
16
|
+
glaip_sdk/cli/constants.py,sha256=8B56cYzJ6j-ietv8qgnfSxNO2QjhEZaV7LfhNzyXKQM,835
|
|
17
|
+
glaip_sdk/cli/context.py,sha256=--Y5vc6lgoAV7cRoUAr9UxSQaLmkMg29FolA7EwoRqM,3803
|
|
18
|
+
glaip_sdk/cli/display.py,sha256=RuBZxmdBesllMMmH4lYoaozolNHW8hLhxRDFzpTsbhs,12137
|
|
18
19
|
glaip_sdk/cli/io.py,sha256=_7qHA3K4VfzNXP7NYHShby_Bw9xigJ26oIaESXYDAQ8,3678
|
|
19
|
-
glaip_sdk/cli/main.py,sha256=
|
|
20
|
-
glaip_sdk/cli/masking.py,sha256=
|
|
20
|
+
glaip_sdk/cli/main.py,sha256=RAgfiCsYyp_MnbPtUslQjjIrr_tAxSmUyI7CaclyPAk,16990
|
|
21
|
+
glaip_sdk/cli/masking.py,sha256=QRtUeHBVCJG02EXLxnPzfhRmD-leMxWf6QKxh4TCax0,3666
|
|
21
22
|
glaip_sdk/cli/mcp_validators.py,sha256=cwbz7p_p7_9xVuuF96OBQOdmEgo5UObU6iWWQ2X03PI,10047
|
|
22
|
-
glaip_sdk/cli/pager.py,sha256=
|
|
23
|
+
glaip_sdk/cli/pager.py,sha256=XygkAB6UW3bte7I4KmK7-PUGCJiq2Pv-4-MfyXAmXCw,7925
|
|
23
24
|
glaip_sdk/cli/parsers/__init__.py,sha256=NzLrSH6GOdNoewXtKNpB6GwrauA8rb_IGYV6cz5Hn3o,113
|
|
24
25
|
glaip_sdk/cli/parsers/json_input.py,sha256=kxoxeIlgfsaH2jhe6apZAgSxAtwlpSINLTMRsZZYboQ,5630
|
|
25
26
|
glaip_sdk/cli/resolution.py,sha256=K-VaEHm9SYY_qfb9538VNHykL4_2N6F8iQqI1zMx_64,2402
|
|
26
27
|
glaip_sdk/cli/rich_helpers.py,sha256=kO47N8e506rxrN6Oc9mbAWN3Qb536oQPWZy1s9A616g,819
|
|
27
28
|
glaip_sdk/cli/slash/__init__.py,sha256=J9TPL2UcNTkW8eifG6nRmAEGHhyEgdYMYk4cHaaObC0,386
|
|
28
|
-
glaip_sdk/cli/slash/agent_session.py,sha256=
|
|
29
|
-
glaip_sdk/cli/slash/prompt.py,sha256=
|
|
30
|
-
glaip_sdk/cli/slash/session.py,sha256=
|
|
29
|
+
glaip_sdk/cli/slash/agent_session.py,sha256=N3ozibjAgCm8M1XFmkgHWnHffg0os-F4BD8IYNIBp6Y,11606
|
|
30
|
+
glaip_sdk/cli/slash/prompt.py,sha256=BB1V5B3zbBA6ZOqD8z4KSDLDmLpG0Kd39ydOouFsJDY,7878
|
|
31
|
+
glaip_sdk/cli/slash/session.py,sha256=1YZ7O8W72qHp7XlhN0Mg70HrK07PIyznpe4pjhc_q4k,53687
|
|
31
32
|
glaip_sdk/cli/transcript/__init__.py,sha256=yiYHyNtebMCu3BXu56Xm5RBC2tDc865q8UGPnoe6QRs,920
|
|
32
33
|
glaip_sdk/cli/transcript/cache.py,sha256=Wi1uln6HP1U6F-MRTrfnxi9bn6XJTxwWXhREIRPoMqQ,17439
|
|
33
34
|
glaip_sdk/cli/transcript/capture.py,sha256=PMmJGjdC3QEeBdjkmdAE2-aINqUGrSKYmT5lEINzZ08,10345
|
|
34
35
|
glaip_sdk/cli/transcript/export.py,sha256=reCvrZVzli8_LzYe5ZNdaa-MwZ1ov2RjnDzKZWr_6-E,1117
|
|
35
36
|
glaip_sdk/cli/transcript/history.py,sha256=2FBjawxP8CX9gRPMUMP8bDjG50BGM2j2zk6IfHvAMH4,26211
|
|
36
37
|
glaip_sdk/cli/transcript/launcher.py,sha256=z5ivkPXDQJpATIqtRLUK8jH3p3WIZ72PvOPqYRDMJvw,2327
|
|
37
|
-
glaip_sdk/cli/transcript/viewer.py,sha256=
|
|
38
|
-
glaip_sdk/cli/update_notifier.py,sha256=
|
|
39
|
-
glaip_sdk/cli/utils.py,sha256=
|
|
38
|
+
glaip_sdk/cli/transcript/viewer.py,sha256=r7G8OHbN2Pj5n30nEUkpSU6lcBdojheRsp6P4WBz3Y8,33710
|
|
39
|
+
glaip_sdk/cli/update_notifier.py,sha256=t_qgKGPic8VO5O6h12SfglCpRpnkt65Bkg-EF3C79Bo,9776
|
|
40
|
+
glaip_sdk/cli/utils.py,sha256=UN4KQjXs7Zu4zw-fxMAuzkffXRN_mmiR23t7e3JPMws,48962
|
|
40
41
|
glaip_sdk/cli/validators.py,sha256=Squ2W-fMz9kfvhtTt7pCcAYnzFU28ZxxTEqH1vF9r00,5620
|
|
41
42
|
glaip_sdk/client/__init__.py,sha256=nYLXfBVTTWwKjP0e63iumPYO4k5FifwWaELQPaPIKIg,188
|
|
42
|
-
glaip_sdk/client/_agent_payloads.py,sha256=
|
|
43
|
-
glaip_sdk/client/agents.py,sha256=
|
|
43
|
+
glaip_sdk/client/_agent_payloads.py,sha256=VfBHoijuoqUOixGBf2SA2vlQIXQmBsjB3sXHZhXYiec,17681
|
|
44
|
+
glaip_sdk/client/agents.py,sha256=dpXL14XbeH3uczdIE25THEKQ8DJOfRZ-WMmD93_yzmU,42217
|
|
44
45
|
glaip_sdk/client/base.py,sha256=ikW33raz2M6rXzo3JmhttfXXuVdMv5zBRKEZkU1F-4I,18176
|
|
45
|
-
glaip_sdk/client/main.py,sha256=
|
|
46
|
+
glaip_sdk/client/main.py,sha256=HnwSwYEWRFymVCaXBge5I2_7p86X2zRvRu6gjgD9Ifw,8788
|
|
46
47
|
glaip_sdk/client/mcps.py,sha256=GQ1EBTSVc-WrFigyw8iocK34DT3TMW85XtnDeOawP9E,8945
|
|
47
|
-
glaip_sdk/client/run_rendering.py,sha256=
|
|
48
|
+
glaip_sdk/client/run_rendering.py,sha256=COBU7xEXYIMzg7__U1-cV6RIg1bs3ys5Zb4YV28APoY,14069
|
|
48
49
|
glaip_sdk/client/tools.py,sha256=xCPqDqtVNePCBeJvbKDqzZI-jbaduIeWd-6XbCSg_2Y,17324
|
|
49
50
|
glaip_sdk/client/validators.py,sha256=ioF9VCs-LG2yLkaRDd7Hff74lojDZZ0_Q3CiLbdm1RY,8381
|
|
50
51
|
glaip_sdk/config/constants.py,sha256=B9CSlYG8LYjQuo_vNpqy-eSks3ej37FMcvJMy6d_F4U,888
|
|
@@ -78,9 +79,9 @@ glaip_sdk/utils/rendering/step_tree_state.py,sha256=EItKFTV2FYvm5pSyHbXk7lkzJ-0D
|
|
|
78
79
|
glaip_sdk/utils/rendering/steps.py,sha256=wySeMsTSH6RKRQa-dDrDkwEts85dw_RL4HlUFbAmFMo,42356
|
|
79
80
|
glaip_sdk/utils/resource_refs.py,sha256=C0ov4RwQBGQqur_UuxpFaKLQdHsTAzt9-o22VLAMEcc,5485
|
|
80
81
|
glaip_sdk/utils/run_renderer.py,sha256=d_VMI6LbvHPUUeRmGqh5wK_lHqDEIAcym2iqpbtDad0,1365
|
|
81
|
-
glaip_sdk/utils/serialization.py,sha256=
|
|
82
|
+
glaip_sdk/utils/serialization.py,sha256=z-qpvWLSBrGK3wbUclcA1UIKLXJedTnMSwPdq-FF4lo,13308
|
|
82
83
|
glaip_sdk/utils/validation.py,sha256=NPDexNgGUIoLkEIz6hl3K6EG7ZKSEkcNLDElqm8-Ng4,7019
|
|
83
|
-
glaip_sdk-0.2.
|
|
84
|
-
glaip_sdk-0.2.
|
|
85
|
-
glaip_sdk-0.2.
|
|
86
|
-
glaip_sdk-0.2.
|
|
84
|
+
glaip_sdk-0.2.2.dist-info/METADATA,sha256=oRvtzI2LA0lMGEE_WIRmFNS3Ug0-6HW0Y6rW5YX72Ok,6023
|
|
85
|
+
glaip_sdk-0.2.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
86
|
+
glaip_sdk-0.2.2.dist-info/entry_points.txt,sha256=EGs8NO8J1fdFMWA3CsF7sKBEvtHb_fujdCoNPhfMouE,47
|
|
87
|
+
glaip_sdk-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|