A framework for producing custom agens for the Encord echosystem.
Project description
Documentation | Try it Now | Blog | Join our Community
Easily build agents for the Encord echo system. With just few lines of code, you can take automation to the next level.
Key features:
- ⚡Easy: Multiple template agents to be adapted and hosted via GCP, own infra, or cloud.
- ⏩ Convenient: The library conveniently loads data via the Encord SDK upon request.
- 👨💻 Focus: With essential resources readily available, you can focus on what matters. Create agents with pre-existing (or custom) dependencies for loading labels and data.
- 🤏 Slim: the library is slim at it's
core
and should not conflict with the dependencies of most projects.
💡 For the full documentation and end-to-end examples, please see here.
Here are some use-cases:
Here's how to build an Agent:
from uuid import UUID
from encord.objects.ontology_labels_impl import LabelRowV2
from encord_agents.tasks import Runner
runner = Runner(project_hash="<your_project_hash>")
@runner.stage(UUID("<your_agent_stage_uuid>"))
def by_file_name(lr: LabelRowV2) -> UUID | None:
# Assuming the data_title is of the format "%d.jpg"
# and in the range [0; 100]
priority = int(lr.data_title.split(".")[0]) / 100
lr.set_priority(priority=priority)
return UUID("<your_pathway_uuid>")
if __name__ == "__main__":
runner.run()
You can also inject dependencies:
from typing_extensions import Annotated
from encord.objects import LabelRowV2
from encord_agents.tasks import Runner, Depends
runner = Runner(project_hash="<your_project_hash>")
def my_custom_dependency(label_row: LabelRowV2) -> dict:
# e.g., look up additional data in own db
return db.query("whatever")
@runner.stage(stage="<my_stage_name>")
def by_custom_data(
custom_data: Annotated[dict, Depends(my_custom_dependency)]
) -> str:
# `custom_data` automatically injected here.
# ... do your thing
# then, return name of task pathway.
if __name__ == "__main__":
runner.run()
Please visit our 📖 Documentation for a complete reference to how to use the agents library.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
encord_agents-0.1.1.tar.gz
(24.1 kB
view details)
Built Distribution
File details
Details for the file encord_agents-0.1.1.tar.gz
.
File metadata
- Download URL: encord_agents-0.1.1.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.6 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29a179ef9a2376727ecad9d15ca2548d94bdde00c2a0f38f5604e6a5d86fb426 |
|
MD5 | 0f3f47d342685cd82aecdc32e69550e8 |
|
BLAKE2b-256 | 42071d122da018762bb786af5c2530bc1e4e1ee7104e4451683044679dcb4eb7 |
File details
Details for the file encord_agents-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: encord_agents-0.1.1-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.6 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0823f9d10292d2329f4c7c609f2e8c597de4ffb34d9d2ce23ab17a280cf05967 |
|
MD5 | 0e62ff5edddb5050628a88e57819dbf4 |
|
BLAKE2b-256 | b91d89d2b479d563c162fa4d393516e1f3d05620e6311a8df12df80319f2dc42 |