infralo 0.1.0.dev2__tar.gz → 0.1.0.dev3__tar.gz
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.
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/PKG-INFO +36 -1
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/README.md +35 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/pyproject.toml +1 -1
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/client.py +24 -6
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/uv.lock +1 -1
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/.gitignore +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/.pre-commit-config.yaml +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/README.md +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/agno/README.md +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/agno/agno_complex_nesting.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/agno/agno_integration.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/agno/pyproject.toml +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/agno/uv.lock +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/README.md +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/complex_nesting.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/complex_nesting_decorator.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/mcp_integration.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/parallel_execution.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/pattern_a_context_manager.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/pattern_b_decorator.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/pattern_c_manual.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/pyproject.toml +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/tool_first_execution.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/core/uv.lock +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/crewai/README.md +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/crewai/crewai_complex_nesting.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/crewai/crewai_integration.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/crewai/pyproject.toml +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/crewai/uv.lock +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/google_adk/README.md +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/google_adk/google_adk_complex_nesting.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/google_adk/google_adk_integration.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/google_adk/pyproject.toml +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/google_adk/uv.lock +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/langgraph/README.md +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/langgraph/langgraph_complex_nesting.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/langgraph/langgraph_integration.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/langgraph/pyproject.toml +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/examples/langgraph/uv.lock +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/__init__.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/_models.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/exporter.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/integrations/__init__.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/integrations/agno.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/integrations/crewai.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/integrations/google_adk.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/integrations/langgraph.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/span.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/src/infralo/trace.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/tests/conftest.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/tests/integrations/__init__.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/tests/integrations/test_agno.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/tests/integrations/test_crewai.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/tests/integrations/test_google_adk.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/tests/integrations/test_langgraph.py +0 -0
- {infralo-0.1.0.dev2 → infralo-0.1.0.dev3}/tests/test_sdk.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: infralo
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev3
|
|
4
4
|
Summary: Infralo SDK
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: agents,ai,llm,observability,tracing
|
|
@@ -248,6 +248,41 @@ inside inherit it automatically.
|
|
|
248
248
|
|
|
249
249
|
---
|
|
250
250
|
|
|
251
|
+
## Human-in-the-Loop Approvals
|
|
252
|
+
|
|
253
|
+
Pause sensitive agent operations until human reviewers authorize them in the Infralo dashboard.
|
|
254
|
+
|
|
255
|
+
```python
|
|
256
|
+
# Initiate an approval request inside an active trace
|
|
257
|
+
approval = await infralo.acreate_approval(
|
|
258
|
+
title="Publish Stock Recap to Threads",
|
|
259
|
+
description="Please review content before publishing.",
|
|
260
|
+
review_data={"recap": "Today's stock market summary..."},
|
|
261
|
+
callback_url="https://agent.example.com/api/callback/approval",
|
|
262
|
+
client_reference_id="run_1024",
|
|
263
|
+
)
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Trace Linkage & Webhook Resumption
|
|
267
|
+
|
|
268
|
+
- Calling `create_approval()` / `acreate_approval()` inside a trace automatically attaches `trace_id` and sets the approval `span_id` as the current parent span.
|
|
269
|
+
- When reviewed, Infralo POSTs a webhook payload containing `approval_id`, `span_id`, and `trace_id` to your `callback_url`.
|
|
270
|
+
- Resume trace context in your webhook handler so subsequent tasks nest under the approval span:
|
|
271
|
+
|
|
272
|
+
```python
|
|
273
|
+
@app.post("/api/callback/approval")
|
|
274
|
+
async def on_approval_callback(payload: dict):
|
|
275
|
+
with infralo.start_trace(trace_id=payload.get("trace_id")) as trace:
|
|
276
|
+
if payload.get("span_id"):
|
|
277
|
+
trace.set_parent_span_id(payload["span_id"])
|
|
278
|
+
|
|
279
|
+
if payload.get("status") == "approved":
|
|
280
|
+
# Decorated tool calls or LLM gateway calls here will nest under the approval span
|
|
281
|
+
await post_to_destination()
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
251
286
|
## Edge Cases
|
|
252
287
|
|
|
253
288
|
### Header Propagation Failure
|
|
@@ -229,6 +229,41 @@ inside inherit it automatically.
|
|
|
229
229
|
|
|
230
230
|
---
|
|
231
231
|
|
|
232
|
+
## Human-in-the-Loop Approvals
|
|
233
|
+
|
|
234
|
+
Pause sensitive agent operations until human reviewers authorize them in the Infralo dashboard.
|
|
235
|
+
|
|
236
|
+
```python
|
|
237
|
+
# Initiate an approval request inside an active trace
|
|
238
|
+
approval = await infralo.acreate_approval(
|
|
239
|
+
title="Publish Stock Recap to Threads",
|
|
240
|
+
description="Please review content before publishing.",
|
|
241
|
+
review_data={"recap": "Today's stock market summary..."},
|
|
242
|
+
callback_url="https://agent.example.com/api/callback/approval",
|
|
243
|
+
client_reference_id="run_1024",
|
|
244
|
+
)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Trace Linkage & Webhook Resumption
|
|
248
|
+
|
|
249
|
+
- Calling `create_approval()` / `acreate_approval()` inside a trace automatically attaches `trace_id` and sets the approval `span_id` as the current parent span.
|
|
250
|
+
- When reviewed, Infralo POSTs a webhook payload containing `approval_id`, `span_id`, and `trace_id` to your `callback_url`.
|
|
251
|
+
- Resume trace context in your webhook handler so subsequent tasks nest under the approval span:
|
|
252
|
+
|
|
253
|
+
```python
|
|
254
|
+
@app.post("/api/callback/approval")
|
|
255
|
+
async def on_approval_callback(payload: dict):
|
|
256
|
+
with infralo.start_trace(trace_id=payload.get("trace_id")) as trace:
|
|
257
|
+
if payload.get("span_id"):
|
|
258
|
+
trace.set_parent_span_id(payload["span_id"])
|
|
259
|
+
|
|
260
|
+
if payload.get("status") == "approved":
|
|
261
|
+
# Decorated tool calls or LLM gateway calls here will nest under the approval span
|
|
262
|
+
await post_to_destination()
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
232
267
|
## Edge Cases
|
|
233
268
|
|
|
234
269
|
### Header Propagation Failure
|
|
@@ -292,9 +292,17 @@ class Infralo:
|
|
|
292
292
|
)
|
|
293
293
|
resp.raise_for_status()
|
|
294
294
|
resp_json = resp.json()
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
result: dict = (
|
|
296
|
+
resp_json["data"] if isinstance(resp_json, dict) and "data" in resp_json else resp_json
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
active_trace = get_active_trace()
|
|
300
|
+
if active_trace is not None:
|
|
301
|
+
span_id: str | None = result.get("span_id")
|
|
302
|
+
if span_id:
|
|
303
|
+
active_trace.set_parent_span_id(span_id)
|
|
304
|
+
|
|
305
|
+
return result
|
|
298
306
|
|
|
299
307
|
async def acreate_approval(
|
|
300
308
|
self,
|
|
@@ -343,9 +351,19 @@ class Infralo:
|
|
|
343
351
|
)
|
|
344
352
|
resp.raise_for_status()
|
|
345
353
|
resp_json = resp.json()
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
354
|
+
result: dict = (
|
|
355
|
+
resp_json["data"]
|
|
356
|
+
if isinstance(resp_json, dict) and "data" in resp_json
|
|
357
|
+
else resp_json
|
|
358
|
+
)
|
|
359
|
+
|
|
360
|
+
active_trace = get_active_trace()
|
|
361
|
+
if active_trace is not None:
|
|
362
|
+
span_id: str | None = result.get("span_id")
|
|
363
|
+
if span_id:
|
|
364
|
+
active_trace.set_parent_span_id(span_id)
|
|
365
|
+
|
|
366
|
+
return result
|
|
349
367
|
|
|
350
368
|
request_approval = create_approval
|
|
351
369
|
arequest_approval = acreate_approval
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|