Installation
To connect to your Kolena Agents using Python, install thekolena-agents
client from
PyPI using any Python package manager such as pip
or poetry:
Initialization
An API Key is required to use the python client. Create and copy a key, then store the value in aKOLENA_API_KEY
environment variable:
Usage
Here’s an example of how to use the client to add, download and delete Agent Runs:Synchronous Usage
You can also add an Agent Run synchronously, which creates a Run and waits for processing of all prompts to complete. Note that this endpoint has rate limits.Query Access Logs
This is available on the Enterprise Plan. Contact Kolena if you’re not on an Enterprise plan but would like to try this feature.
Serializing to JSON
Allkolena-agents
objects are standard Pydantic
data objects and can be easily
converted to and from JSON: