Skip to main content

Kolena Agents Client

Project description

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"])

# 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.

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

kolena_agents-0.15.0.tar.gz (74.9 kB view details)

Uploaded Source

Built Distribution

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

kolena_agents-0.15.0-py3-none-any.whl (160.9 kB view details)

Uploaded Python 3

File details

Details for the file kolena_agents-0.15.0.tar.gz.

File metadata

  • Download URL: kolena_agents-0.15.0.tar.gz
  • Upload date:
  • Size: 74.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kolena_agents-0.15.0.tar.gz
Algorithm Hash digest
SHA256 19f4166a9107ba995bee8689c485b402521db1ce95b62349c8d41d03ee5771c7
MD5 2ea03820af8a57801fe61663175e3dfe
BLAKE2b-256 62fd966508aedd9ab31024856f8e51554b6695c53d78c269653bfb1083ebf590

See more details on using hashes here.

File details

Details for the file kolena_agents-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: kolena_agents-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 160.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kolena_agents-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e82a3d070bd8b892459c2f79c122e743f737be20a0a27d8202e26bc38d352ce4
MD5 94f2fb820ac3f83a5f02c1901d955428
BLAKE2b-256 4c8df855694759f591518b23f3ce26b3dc515c95095d781311807708a3e14186

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