mira-sdk / mira-cli
Prerequisites
- Python >= 3.10
- pip
- pdm
Setup
pdm sync
Usage
CLI Commands
The mira-cli provides several commands for managing flows, prompts, and executing operations. Here's a brief overview of the available commands:
-
Initialize a flow:
pdm run python -m src.mira.cli.mira_cli init --flow <flow_name> --template <template_name>- List available templates:
pdm run python -m src.mira.cli.mira_cli init --list
- List available templates:
-
Execute a flow: - #TODO - lets call this as local testing or local run
pdm run python -m src.mira.cli.mira_cli execute --config <path_to_config_file> --input key1=value1 key2=value2 -
Manage prompts: - we have to start with prompts
- List all prompts:
pdm run python -m src.mira.cli.mira_cli prompts --lists - Show details of a specific prompt:
pdm run python -m src.mira.cli.mira_cli prompts --show --prompt-name <author/prompt_name>
- List all prompts:
-
Deploy a flow:
pdm run python -m src.mira.cli.mira_cli deploy --flow <path_to_yaml_config> --name <flow_name> -
Execute a deployed flow:
pdm run python -m src.mira.cli.mira_cli execute-flow --flow-name <flow_name> --input-data '{"key": "value"}'
For more detailed information on each command and its options, use the --help flag:
SDK Usage
The Mira SDK provides a simple way to execute flows and build custom flows programmatically. Here are examples of how to use the SDK:
Executing a Flow
To execute a flow using the MiraClient:
from mira_sdk.mira.client.mira_client import MiraClient
client = MiraClient("flows/person.yaml")
result = client.execute({"coin": "Solana"})
print(result)
This script loads a flow from a YAML file and executes it with the given input.
Building a Custom Flow
#TODO - lets skip this piece for now
To create a custom flow using the FlowBuilder:
from mira_sdk.mira.builder.flow_builder import FlowBuilder
builder = FlowBuilder()
# Set flow name and description
builder.set_name("SimpleTextGenerator")
builder.set_description("Persona Impersonator")
# Add resources
builder.add_prompt([{"second_prompt": "Generate a short story about {person} at {club}", "type": "local"},
{"main_prompt": "@aroha-labs/klok/1.0.0", "type": "mira"}])
builder.add_resource("knowledge", "writing_tips", {"file": "writing_tips.txt"})
builder.add_resource("models", "story_generator", {"type": "gpt-3.5-turbo"})
# Add component
builder.add_component(
"story_generator",
"Generator",
{
"prompt": "{resources.prompts.main_prompt}",
"models": "{resources.models.story_generator}",
},
)
# Add flow step
builder.add_flow_step(
"story_generator",
inputs=[{"person": "request", "club": "request"}],
outputs=[{"target": "response"}]
)
# Save the flow
builder.save("flows/person.yaml")
Metadata
Release files for mira-sdk 0.1.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mira_sdk-0.1.16.tar.gz | 16.3 kB | Without provenance | Details for mira_sdk-0.1.16.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mira_sdk-0.1.16-py3-none-any.whl | Python 3 | none | any | Details for mira_sdk-0.1.16-py3-none-any.whl |
Total release size: 39.0 kB
Release files / mira_sdk-0.1.16.tar.gz
| Download URL | mira_sdk-0.1.16.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ddcc3ede46986716fe730c3ee713e9090e5c98bdf6bd09fd4f9f7cbb7fd038d5
|
|
BLAKE2b-256 checksum How to use checksums |
400cbda1d8edd42dab628b6376f64337f8b364d548c16a7cb3e166c6f5b901de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / mira_sdk-0.1.16-py3-none-any.whl
| Download URL | mira_sdk-0.1.16-py3-none-any.whl |
|---|---|
| Size | 22.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7fea26d75fc6d0abe2febcae74e9d934210562cb315ccba6ca8977fb8258f19
|
|
BLAKE2b-256 checksum How to use checksums |
ca496b3ab74a086f82198919d4f5781275b4d846e07286297b14cf9a7c1e2074
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Security for mira-sdk 0.1.16
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.