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.13.0.tar.gz (70.5 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.13.0-py3-none-any.whl (156.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kolena_agents-0.13.0.tar.gz
  • Upload date:
  • Size: 70.5 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.13.0.tar.gz
Algorithm Hash digest
SHA256 0337e3ac443c063fc7ba6120d7875dfcc223c0979d4800a41b09c015ac9fac89
MD5 8ee8592d875a683d095ff2c391e882f7
BLAKE2b-256 37356818fdfd23d748b1d73187c2a263419ec777fb875c36ebdb2ca367f0a5a7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kolena_agents-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 156.0 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.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be9da6c4bf7652bb8fdd833e6c87a063e1bde35e98f8882b13d561b285793235
MD5 81cb9ace1ae2127350ba37fb2a8118c6
BLAKE2b-256 b597a8a3462ace1b2281584ed9c659be650ea44dec1047ad9270eec625a1d880

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