Skip to main content

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

import influxion
from influxion import InfluxionClient

influxion.init(
    api_key="sk-...",           # or set INFLUXION_API_KEY
    project_id="my-project",
    agent_id="report-agent",
)

client = InfluxionClient()

# Define your unique session ID
session_id = "weekly-report-2026-03-11"

client.create_session(
    session_id=session_id,
    name="weekly-report-run",
    tags=["weekly"],
    metadata={"env": "prod"},
)

# Do your agent work...
report = run_my_agent()

# Record tool call for evaluation (optional)
client.create_session_tool_call(
    session_id=session_id,
    name="fetch_data",
    input={"source": "api", "query": "Q4 revenue"},
    output={"rows": 42, "status": "ok"},
)

# Record artifact for evaluation (optional)
client.create_session_artifact(
    session_id=session_id,
    name="report",
    artifact=report,
    type="text",
)

Async Usage

import influxion
from influxion import AsyncInfluxionClient

influxion.init(
    api_key="sk-...",           # or set INFLUXION_API_KEY
    project_id="my-project",
    agent_id="my-agent",
)

client = AsyncInfluxionClient()

session_id = "my-session-123"
await client.create_session(
    session_id=session_id,
    name="My Session",
)
await client.create_session_tool_call(
    session_id=session_id,
    name="search",
    input={"query": "latest news"},
    output={"results": [...]},
)
await client.create_session_artifact(
    session_id=session_id,
    name="output",
    artifact="...",
)

Configuration

Parameter Environment variable Default
api_key INFLUXION_API_KEY — (required)
base_url INFLUXION_BASE_URL https://api.influxion.io/v1
fail_silently True

Set api_key, project_id, and agent_id once with influxion.init(...) so you don't pass them to client or method calls.

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

influxion-0.0.3.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

influxion-0.0.3-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file influxion-0.0.3.tar.gz.

File metadata

  • Download URL: influxion-0.0.3.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for influxion-0.0.3.tar.gz
Algorithm Hash digest
SHA256 bb9eeead27ad9607941f8b3ea0221fb042bb011ecff47a00d532dc6015ec1a46
MD5 802dbf27fb152cc63d8ca1e11c878111
BLAKE2b-256 50b52624fecd369d056f4e09d8e6c0128f393e4c004217a6f42e22e121cddb18

See more details on using hashes here.

File details

Details for the file influxion-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: influxion-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for influxion-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ca47cc403448c04d54efd824f3c38f5ef85a3c4731e69482a9b0e7288cb67662
MD5 b8547dc67665f4364a322f0af3593718
BLAKE2b-256 38d8305aa699792f10c58dd685f35383bd88a2d73effd3855892e865b08262b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page