Skip to main content

Kolena Agents

Python client for interacting with Kolena Agents. See the Python client reference for every method and type.

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(
    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.10 and later are supported.

Metadata

Release files for kolena-agents 0.20.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.20.0
File Size Uploaded Provenance Actions
kolena_agents-0.20.0.tar.gz 81.8 kB Without provenance Details for kolena_agents-0.20.0.tar.gz

Built distribution (wheel)

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

Total release size: 251.8 kB

Release files / kolena_agents-0.20.0.tar.gz

Download URL kolena_agents-0.20.0.tar.gz
Size 81.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e5d68c5a6ad8bee0e2f2344cc2f3b9dd15eb0998de6401cae9bceb4f5b1ba009
BLAKE2b-256 checksum
How to use checksums
a419c5838c91a8b015831b889fa8cf2659f20d0d49b0b96174ea1ad317080b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kolena_agents-0.20.0-py3-none-any.whl
Size 170.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9a1ddf0ffdc642b4b5572da761c503eb7af82ef5a5c4341dd7c7f55c9291e27
BLAKE2b-256 checksum
How to use checksums
398014ca284c2dbc2d8a334476c787386aab215d2d186a2ff71a52384e7f3f28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for kolena-agents 0.20.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