Skip to main content

avala-agents

PyPI version Python CI License: MIT

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

avala_agents-0.1.1.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

avala_agents-0.1.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

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

Hashes for avala_agents-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6262c9749f76b1f5fcdd35a8953dc28a8658eb8e060d40c9fe76e3c20680e462
MD5 2f633176cc0bb75c02b7e75ff6fb5097
BLAKE2b-256 193fe5adbe8c3fdc7fed503fded8aabcecbd0d4e97391f5272468f96243528eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for avala_agents-0.1.1.tar.gz:

Publisher: publish.yml on avala-ai/avala-agents-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for avala_agents-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca6fc9d7194c91e3e69c93e19f2588328f3d819645e99a444d5b3143247596d5
MD5 1509bad51084e3778dda5ada1cd80c38
BLAKE2b-256 05e3cc5290bee7fe301f93a3d1bfadf1936a1fc804281d99c6b8c9c22ebfe79a

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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