Enables creation of workflows for Dria Agents
Project description
Dria Workflows
Dria Workflows enables the creation of workflows for Dria Agents.
Installation
You can install Dria Workflows using pip:
pip install dria_workflows
Usage Example
Here's a simple example of how to use Dria Workflows:
import logging
from dria_workflows import WorkflowBuilder, Operator, Write, Edge, validate_workflow_json
def main():
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
builder = WorkflowBuilder()
# Add a step to your workflow
builder.generative_step(id="write_poem", prompt="Write a poem as if you are Kahlil Gibran", operator=Operator.GENERATION, outputs=[Write.new("poem")])
# Define the flow of your workflow
flow = [Edge(source="write_poem", target="_end")]
builder.flow(flow)
# Set the return value of your workflow
builder.set_return_value("poem")
# Build your workflow
workflow = builder.build()
# Validate your workflow
validate_workflow_json(workflow.model_dump_json(indent=2, exclude_unset=True, exclude_none=True))
# Save workflow
workflow.save("poem_workflow.json")
if __name__ == "__main__":
main()
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
dria_workflows-0.1.1.tar.gz
(10.1 kB
view details)
Built Distribution
File details
Details for the file dria_workflows-0.1.1.tar.gz
.
File metadata
- Download URL: dria_workflows-0.1.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d0a7465652531ba2c4d5ae7519eb3d30e3a45a123f403fd049b5240427aa2c6 |
|
MD5 | 9cc31cd88b81fcb2d496705a46bbf46f |
|
BLAKE2b-256 | 29c867b849b7ca67090d708d9e3bcdf715c2a5ce39e3044ca392bab64d395f9b |
File details
Details for the file dria_workflows-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: dria_workflows-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcf60c2138874b0f8334077c8d88a9d62bd6dfbc5d410ee0c48a696c08fbf41b |
|
MD5 | 1fd7adc7e0e80453b361712023b4374b |
|
BLAKE2b-256 | a44d7ac55d83671fbac4fbcd7e32859eb0b02c9626177d8aae2d0178ebe179d5 |