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.8 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.12.0.tar.gz (66.7 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.12.0-py3-none-any.whl (147.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kolena_agents-0.12.0.tar.gz
  • Upload date:
  • Size: 66.7 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.12.0.tar.gz
Algorithm Hash digest
SHA256 1fa5539c8f6af0d3f35c1733cef21eecffb2f828e40e7a3eaf89647e9d7c608c
MD5 5d1fa3dcb6ec98c8664fe7ed8e31fda9
BLAKE2b-256 785c83c7a535bba0e114e7f4badce46ec797cfee19f42cfe09431cd1719715c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kolena_agents-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 147.1 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.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81b38b7d44553421fb382a5ff5cc6efcf429a4ce8fbb4821e23979669dac6708
MD5 3f6ee1ac7c5a14d47a405505c7e20fe8
BLAKE2b-256 11fb0fe36cc30f70688a2003d3285572ebbd5ebbd8ca1a314d9ba2dcb1182126

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