avala-agents
Build custom annotation workflow agents for the Avala platform.
Note: This repository is a read-only mirror. To report bugs or request features, please open an issue. See CONTRIBUTING.md for details.
Installation
pip install avala-agents
Quick Start
from avala_agents import TaskAgent
agent = TaskAgent(
api_key="avk_...",
name="quality-checker",
project="proj_uid", # optional: scope to a single project
)
@agent.on("result.submitted")
def check_quality(context):
annotations = context.result_data
if len(annotations) == 0:
context.reject("No annotations found")
elif context.result_metadata.get("confidence", 1.0) < 0.5:
context.flag("Low confidence — needs manual review")
else:
context.approve()
agent.run() # blocks; polls for pending executions
Supported Events
| Event | Context class | Description |
|---|---|---|
result.submitted |
ResultContext |
An annotator submitted a result |
result.accepted |
ResultContext |
A result was accepted by QC |
result.rejected |
ResultContext |
A result was rejected by QC |
task.completed |
TaskContext |
A task reached a terminal state |
Actions
All context objects expose four action methods:
| Method | Description |
|---|---|
context.approve(reason="") |
Accept the result / task |
context.reject(reason="") |
Reject with an optional reason |
context.flag(reason="") |
Flag for manual review |
context.skip() |
Acknowledge without taking action |
Configuration
| Parameter | Env var | Default |
|---|---|---|
api_key |
AVALA_API_KEY |
required |
base_url |
AVALA_BASE_URL |
https://api.avala.ai/api/v1 |
name |
— | "default-agent" |
project |
— | None (all projects) |
task_types |
— | None (all types) |
poll_interval |
— | 5.0 seconds |
Processing a single batch (non-blocking)
count = agent.run_once()
print(f"Processed {count} execution(s)")
Error handling
from avala_agents import AgentActionError, AgentRegistrationError
try:
agent.run()
except AgentRegistrationError as exc:
print(f"Could not register agent: {exc}")
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file avala_agents-0.1.1.tar.gz.
File metadata
- Download URL: avala_agents-0.1.1.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6262c9749f76b1f5fcdd35a8953dc28a8658eb8e060d40c9fe76e3c20680e462
|
|
| MD5 |
2f633176cc0bb75c02b7e75ff6fb5097
|
|
| BLAKE2b-256 |
193fe5adbe8c3fdc7fed503fded8aabcecbd0d4e97391f5272468f96243528eb
|
Provenance
The following attestation bundles were made for avala_agents-0.1.1.tar.gz:
Publisher:
publish.yml on avala-ai/avala-agents-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
avala_agents-0.1.1.tar.gz -
Subject digest:
6262c9749f76b1f5fcdd35a8953dc28a8658eb8e060d40c9fe76e3c20680e462 - Sigstore transparency entry: 2025819098
- Sigstore integration time:
-
Permalink:
avala-ai/avala-agents-python@4d2d474c25e5190cb1233f3994a739a7e8bf7e6e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/avala-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4d2d474c25e5190cb1233f3994a739a7e8bf7e6e -
Trigger Event:
push
-
Statement type:
File details
Details for the file avala_agents-0.1.1-py3-none-any.whl.
File metadata
- Download URL: avala_agents-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca6fc9d7194c91e3e69c93e19f2588328f3d819645e99a444d5b3143247596d5
|
|
| MD5 |
1509bad51084e3778dda5ada1cd80c38
|
|
| BLAKE2b-256 |
05e3cc5290bee7fe301f93a3d1bfadf1936a1fc804281d99c6b8c9c22ebfe79a
|
Provenance
The following attestation bundles were made for avala_agents-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on avala-ai/avala-agents-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
avala_agents-0.1.1-py3-none-any.whl -
Subject digest:
ca6fc9d7194c91e3e69c93e19f2588328f3d819645e99a444d5b3143247596d5 - Sigstore transparency entry: 2025819249
- Sigstore integration time:
-
Permalink:
avala-ai/avala-agents-python@4d2d474c25e5190cb1233f3994a739a7e8bf7e6e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/avala-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4d2d474c25e5190cb1233f3994a739a7e8bf7e6e -
Trigger Event:
push
-
Statement type: