Influxion Python SDK
Project description
Influxion Python SDK
Instrument your agents with the Influxion SDK to capture sessions and artifacts for evaluation.
Installation
Install from PyPI:
pip install -U influxion
Or, if installing from source:
pip install -e ".[dev]"
Quickstart
from influxion import InfluxionClient
client = InfluxionClient(
api_key="sk-...", # or set INFLUXION_API_KEY environment variable
)
session_id = client.create_session(
name="weekly-report-run",
project_id="<your-project-id>",
agent_id="report-agent",
tags=["weekly"],
metadata={"env": "prod"},
)
try:
report = run_my_agent()
# Record tool call for evaluation (optional)
client.create_session_tool_call(
session_id=session_id,
tool_name="fetch_data",
tool_input={"source": "api", "query": "Q4 revenue"},
tool_output={"rows": 42, "status": "ok"},
)
# Record artifact for evaluation (optional)
client.create_session_artifact(
session_id=session_id,
artifact_name="report",
artifact=report,
artifact_type="text",
)
client.end_session(session_id, success=True)
except Exception as e:
client.end_session(session_id, success=False, failure_message=str(e))
raise
Async Usage
from influxion import AsyncInfluxionClient
async with AsyncInfluxionClient() as client:
session_id = await client.create_session(
name="my-run",
project_id="<your-project-id>",
agent_id="my-agent",
)
await client.create_session_tool_call(
session_id=session_id,
tool_name="search",
tool_input={"query": "latest news"},
tool_output={"results": [...]},
)
await client.create_session_artifact(
session_id=session_id,
artifact_name="output",
artifact="...",
)
await client.end_session(session_id, success=True)
Configuration
| Parameter | Environment variable | Default |
|---|---|---|
api_key |
INFLUXION_API_KEY |
— (required) |
base_url |
INFLUXION_BASE_URL |
https://api.influxion.io/v1 |
fail_silently |
— | True |
fail_silently=True (default): call-time errors are logged and methods return None
rather than raising. Set fail_silently=False during development to surface errors
immediately. AuthenticationError at construction always raises regardless.
Running Tests
pip install -e ".[dev]"
pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file influxion-0.0.2.tar.gz.
File metadata
- Download URL: influxion-0.0.2.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33080adce433801a246f1351b432dea236c15869a9da428072b994b8ccb7e858
|
|
| MD5 |
95e7670e4ca208157338f242c81117da
|
|
| BLAKE2b-256 |
5fd6c32b02f8899a753181aee0438734c1add23c14458b5c67543a9953884046
|
File details
Details for the file influxion-0.0.2-py3-none-any.whl.
File metadata
- Download URL: influxion-0.0.2-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9583e98bfca26d271f010c08b330d3702656cc49e15b04d33b5b0be943135c64
|
|
| MD5 |
f3dcb8c7a15df8156fe03a50ea9263b3
|
|
| BLAKE2b-256 |
c30f26cb366c5adb49332b639bb05ff08982412ac5aaf9bf4c490fa307155418
|