Skip to main content

Kolena Agents

Python client for interacting with Kolena Agents.

Initialization

An API Key is required to use the python client. Generate a key from your user profile within the Kolena web UI.

Copy the created key and store in a KOLENA_API_KEY environment variable:

export KOLENA_API_KEY="your-api-key"

Usage

Here's an example of how to use the client to add, download, list, and delete agent runs:

from kolena_agents import Client

client = Client()

# add new agent run
new_run = client.agent_run.add(agent_id=1, files=["path/to/file1", "path/to/file2"])

# each entry may be a path, an open binary file object, bytes, or a (filename, bytes_or_file_object) tuple
with open("path/to/large_file", "rb") as f:
    streamed_run = client.agent_run.add(agent_id=1, files=[f])

# download agent run
run = client.agent_run.get(agent_id=1, run_id=2)

# alternatively, list all agent runs
all_runs = client.agent_run.list(agent_id=1)

# delete agent run
client.agent_run.delete(agent_id=1, run_id=2)

# list all agents
all_agents = client.agent.list()

# get an agent
agent = client.agent.get(agent_id=1)

# update Agent metadata
updated_agent = client.agent.update_metadata(
    agent_id=1,
    metadata={
        "environment": "production",
        "version": 2,
        "tags": ["nlp", "extraction"]
    }
)

Webhook

Kolena provides a helper function to handle signature verification and parsing. See Webhook Integration for more information.

from kolena_agents import webhook

result = webhook.construct_event(request_body, secret, request_headers)

Supported Python Versions

Python versions 3.9 and later are supported.

Metadata

Release files for kolena-agents 0.17.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kolena-agents 0.17.0
File Size Uploaded Provenance Actions
kolena_agents-0.17.0.tar.gz 78.6 kB Without provenance Details for kolena_agents-0.17.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kolena-agents 0.17.0
File Interpreter ABI Platform Actions
kolena_agents-0.17.0-py3-none-any.whl Python 3 none any Details for kolena_agents-0.17.0-py3-none-any.whl

Total release size: 244.1 kB

Release files / kolena_agents-0.17.0.tar.gz

Download URL kolena_agents-0.17.0.tar.gz
Size 78.6 kB
Tags Source
SHA-256 checksum
How to use checksums
068e5dc115f0b4e54783c8a771315f9b7873c1f741ce4b033df09891edae93c8
BLAKE2b-256 checksum
How to use checksums
96529d0ffcf9219bc14d0d279758adfcef779bd0b12e02f90ef3465fd2855205
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / kolena_agents-0.17.0-py3-none-any.whl

Download URL kolena_agents-0.17.0-py3-none-any.whl
Size 165.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c3e88ee3675cc56c3a06e358e7353dbc1d7bd0330c02bd7e5b9efbb4848462b
BLAKE2b-256 checksum
How to use checksums
6e1eb1d8ff624fbfaefd911b198f47daa737392f42a8572dfecaec80957f9650
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Security for kolena-agents 0.17.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page