Skip to content

Commit 22b80b3

Browse files
authored
v0.3 Documentation Update (#422)
1 parent 9f178ac commit 22b80b3

19 files changed

Lines changed: 383 additions & 183 deletions

agentlightning/emitter/object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def emit_object(object: Any, attributes: Optional[Dict[str, Any]] = None, propag
4040
if propagate:
4141
tracer = get_active_tracer()
4242
if tracer is None:
43-
raise RuntimeError("No active tracer found. Cannot emit annotation span.")
43+
raise RuntimeError("No active tracer found. Cannot emit object span.")
4444
else:
4545
# Do not actually propagate to any store or tracer backend.
4646
tracer = DummyTracer()

agentlightning/litagent/litagent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def rollout(self, task: T, resources: NamedResources, rollout: Rollout) -> Rollo
198198
* `float` representing the final reward.
199199
* `List[ReadableSpan]` with OpenTelemetry spans.
200200
* `List[Span]` with Agent Lightning spans.
201+
* `List[SpanCoreFields]` with Agent Lightning spans.
201202
"""
202203
raise NotImplementedError("Agents must implement the `rollout` method.")
203204

agentlightning/utils/id.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,12 @@
77

88

99
def generate_id(length: int) -> str:
10+
"""Generate a random ID of the given length.
11+
12+
Args:
13+
length: The length of the ID to generate.
14+
15+
Returns:
16+
A random ID of the given length.
17+
"""
1018
return hashlib.sha1(uuid.uuid4().bytes).hexdigest()[:length]

agentlightning/utils/otel.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
"filter_and_unflatten_attributes",
3939
"flatten_attributes",
4040
"unflatten_attributes",
41+
"sanitize_attribute_value",
42+
"sanitize_attributes",
43+
"sanitize_list_attribute_sanity",
44+
"check_attributes_sanity",
45+
"format_exception_attributes",
4146
]
4247

4348
T_SpanLike = TypeVar("T_SpanLike", bound=SpanLike)

agentlightning/utils/system_snapshot.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313

1414

1515
def system_snapshot(include_gpu: bool = False) -> Dict[str, Any]:
16+
"""Capture a snapshot of the system's hardware and software information.
17+
18+
Args:
19+
include_gpu: Whether to include GPU information.
20+
21+
Returns:
22+
A dictionary containing the system's hardware and software information.
23+
"""
1624
# CPU
1725
cpu = {
1826
"cpu_name": platform.processor(),
275 KB
Loading
247 KB
Loading

docs/how-to/examples-catalog.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@
6262

6363
[:octicons-repo-24: Browse source]({{ src("examples/rag") }})
6464

65-
- :material-magnify:{ .lg .middle } __Search-R1 RL__
66-
67-
---
68-
69-
Reproduction of the Search-R1 workflow that prepares its own retrieval backend, runs the rollout script, and coordinates GRPO-style training without extra orchestration layers (last validated on v0.1.x).
70-
71-
[:octicons-repo-24: Browse source]({{ src("examples/search_r1") }})
72-
7365
- :material-database:{ .lg .middle } __Spider SQL agent__
7466

7567
---

docs/how-to/train-sql-agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Train SQL Agent with Agent-lightning and VERL
22

3-
This walkthrough builds upon the **Agent-lightning v0.2 SQL Agent** example and explains how the system components integrate: a **LangGraph-based SQL agent** wrapped as a [`LitAgent`][agentlightning.LitAgent], the **[`VERL`][agentlightning.algorithm.verl.VERL] reinforcement learning (RL) algorithm**, and the **[`Trainer`][agentlightning.Trainer]**, which coordinates both training and debugging.
3+
This walkthrough builds upon the **Agent-lightning SQL Agent** example and explains how the system components integrate: a **LangGraph-based SQL agent** wrapped as a [`LitAgent`][agentlightning.LitAgent], the **[`VERL`][agentlightning.algorithm.verl.VERL] reinforcement learning (RL) algorithm**, and the **[`Trainer`][agentlightning.Trainer]**, which coordinates both training and debugging.
44

55
The command-line interface in [`examples/spider/train_sql_agent.py`]({{ src("examples/spider/train_sql_agent.py") }}) provides a complete runnable example. However, this document focuses on understanding the underlying architecture so you can effectively adapt the workflow to your own agents.
66

docs/reference/internal.md

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -54,56 +54,6 @@
5454

5555
::: agentlightning.tracer.otel.LightningSpanProcessor
5656

57-
## Utilities
58-
59-
::: agentlightning.utils.metrics.MetricsBackend
60-
61-
::: agentlightning.utils.metrics.ConsoleMetricsBackend
62-
63-
::: agentlightning.utils.metrics.PrometheusMetricsBackend
64-
65-
::: agentlightning.utils.metrics.MultiMetricsBackend
66-
67-
::: agentlightning.utils.metrics.setup_multiprocess_prometheus
68-
69-
::: agentlightning.utils.metrics.get_prometheus_registry
70-
71-
::: agentlightning.utils.metrics.shutdown_metrics
72-
73-
::: agentlightning.utils.server_launcher.PythonServerLauncher
74-
75-
::: agentlightning.utils.server_launcher.PythonServerLauncherArgs
76-
77-
::: agentlightning.utils.server_launcher.LaunchMode
78-
79-
::: agentlightning.utils.otel.full_qualified_name
80-
81-
::: agentlightning.utils.otel.get_tracer_provider
82-
83-
::: agentlightning.utils.otel.get_tracer
84-
85-
::: agentlightning.utils.otel.make_tag_attributes
86-
87-
::: agentlightning.utils.otel.extract_tags_from_attributes
88-
89-
::: agentlightning.utils.otel.make_link_attributes
90-
91-
::: agentlightning.utils.otel.query_linked_spans
92-
93-
::: agentlightning.utils.otel.extract_links_from_attributes
94-
95-
::: agentlightning.utils.otel.filter_attributes
96-
97-
::: agentlightning.utils.otel.filter_and_unflatten_attributes
98-
99-
::: agentlightning.utils.otel.flatten_attributes
100-
101-
::: agentlightning.utils.otel.unflatten_attributes
102-
103-
::: agentlightning.utils.otlp.handle_otlp_export
104-
105-
::: agentlightning.utils.otlp.spans_from_proto
106-
10757
## Deprecated APIs
10858

10959
::: agentlightning.emitter.reward.reward

0 commit comments

Comments
 (0)