thrapai-aria 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. thrapai_aria-0.1.0/.github/dependabot.yml +10 -0
  2. thrapai_aria-0.1.0/.github/workflows/ci.yml +44 -0
  3. thrapai_aria-0.1.0/.github/workflows/publish.yml +29 -0
  4. thrapai_aria-0.1.0/.gitignore +10 -0
  5. thrapai_aria-0.1.0/.pre-commit-config.yaml +18 -0
  6. thrapai_aria-0.1.0/CONTRIBUTING.md +34 -0
  7. thrapai_aria-0.1.0/LICENSE +21 -0
  8. thrapai_aria-0.1.0/PKG-INFO +241 -0
  9. thrapai_aria-0.1.0/README.md +205 -0
  10. thrapai_aria-0.1.0/docs/extensions/ai.md +42 -0
  11. thrapai_aria-0.1.0/docs/extensions/docling.md +54 -0
  12. thrapai_aria-0.1.0/docs/extensions/file.md +58 -0
  13. thrapai_aria-0.1.0/docs/extensions/utils.md +80 -0
  14. thrapai_aria-0.1.0/docs/logo.png +0 -0
  15. thrapai_aria-0.1.0/examples/hello.yml +14 -0
  16. thrapai_aria-0.1.0/examples/json_parse.yml +13 -0
  17. thrapai_aria-0.1.0/examples/summarize_document.yml +47 -0
  18. thrapai_aria-0.1.0/install.sh +17 -0
  19. thrapai_aria-0.1.0/pyproject.toml +57 -0
  20. thrapai_aria-0.1.0/src/aria/__init__.py +1 -0
  21. thrapai_aria-0.1.0/src/aria/cli.py +14 -0
  22. thrapai_aria-0.1.0/src/aria/commands/__init__.py +1 -0
  23. thrapai_aria-0.1.0/src/aria/commands/init.py +35 -0
  24. thrapai_aria-0.1.0/src/aria/commands/run.py +31 -0
  25. thrapai_aria-0.1.0/src/aria/commands/validate.py +18 -0
  26. thrapai_aria-0.1.0/src/aria/core/__init__.py +1 -0
  27. thrapai_aria-0.1.0/src/aria/core/context.py +20 -0
  28. thrapai_aria-0.1.0/src/aria/core/errors.py +26 -0
  29. thrapai_aria-0.1.0/src/aria/core/logger.py +8 -0
  30. thrapai_aria-0.1.0/src/aria/core/parser.py +22 -0
  31. thrapai_aria-0.1.0/src/aria/core/runner.py +101 -0
  32. thrapai_aria-0.1.0/src/aria/core/templates.py +27 -0
  33. thrapai_aria-0.1.0/src/aria/core/validator.py +8 -0
  34. thrapai_aria-0.1.0/src/aria/extensions/__init__.py +1 -0
  35. thrapai_aria-0.1.0/src/aria/extensions/base.py +9 -0
  36. thrapai_aria-0.1.0/src/aria/extensions/builtins/__init__.py +1 -0
  37. thrapai_aria-0.1.0/src/aria/extensions/builtins/ai.py +29 -0
  38. thrapai_aria-0.1.0/src/aria/extensions/builtins/docling.py +28 -0
  39. thrapai_aria-0.1.0/src/aria/extensions/builtins/file.py +26 -0
  40. thrapai_aria-0.1.0/src/aria/extensions/builtins/utils.py +75 -0
  41. thrapai_aria-0.1.0/src/aria/extensions/registry.py +30 -0
  42. thrapai_aria-0.1.0/src/aria/providers/__init__.py +1 -0
  43. thrapai_aria-0.1.0/src/aria/providers/ollama_provider.py +26 -0
  44. thrapai_aria-0.1.0/src/aria/providers/openai_provider.py +35 -0
  45. thrapai_aria-0.1.0/src/aria/types/__init__.py +1 -0
  46. thrapai_aria-0.1.0/src/aria/types/workflow.py +68 -0
  47. thrapai_aria-0.1.0/tests/test_ai_generate.py +18 -0
  48. thrapai_aria-0.1.0/tests/test_docling_convert.py +47 -0
  49. thrapai_aria-0.1.0/tests/test_runner_file_write.py +118 -0
  50. thrapai_aria-0.1.0/tests/test_templates.py +21 -0
  51. thrapai_aria-0.1.0/tests/test_validate.py +37 -0
  52. thrapai_aria-0.1.0/uv.lock +3299 -0
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "uv"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "weekly"
@@ -0,0 +1,44 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v5
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Install dependencies
28
+ run: uv sync --extra dev
29
+
30
+ - name: Lint
31
+ run: uv run --extra dev ruff check
32
+
33
+ - name: Format check
34
+ run: uv run --extra dev ruff format --check
35
+
36
+ - name: Test
37
+ run: uv run --extra dev python -m pytest --cov=aria --cov-report=xml --cov-report=term
38
+
39
+ - name: Upload coverage
40
+ if: matrix.python-version == '3.11'
41
+ uses: codecov/codecov-action@v5
42
+ with:
43
+ files: ./coverage.xml
44
+ fail_ci_if_error: false
@@ -0,0 +1,29 @@
1
+ name: Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+
12
+ jobs:
13
+ publish:
14
+ runs-on: ubuntu-latest
15
+ environment:
16
+ name: pypi
17
+ url: https://pypi.org/p/thrapai-aria
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v5
24
+
25
+ - name: Build
26
+ run: uv build
27
+
28
+ - name: Publish to PyPI
29
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,10 @@
1
+ .aria/
2
+ .pytest_cache/
3
+ .ruff_cache/
4
+ .venv/
5
+ __pycache__/
6
+ *.py[cod]
7
+ .python-version
8
+ .coverage
9
+ coverage.xml
10
+ dist/
@@ -0,0 +1,18 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: ruff-check
5
+ name: ruff check
6
+ entry: uv run --extra dev ruff check
7
+ language: system
8
+ types: [python, yaml]
9
+ - id: ruff-format
10
+ name: ruff format
11
+ entry: uv run --extra dev ruff format --check
12
+ language: system
13
+ types: [python, yaml]
14
+ - id: pytest
15
+ name: pytest
16
+ entry: uv run --extra dev pytest
17
+ language: system
18
+ pass_filenames: false
@@ -0,0 +1,34 @@
1
+ # Contributing
2
+
3
+ Thanks for helping improve ARIA. Keep changes small, tested, and easy to review.
4
+
5
+ The most useful contributions are new or improved extensions that let ARIA work with more tools, file types, providers, and workflow capabilities.
6
+
7
+ ## Development
8
+
9
+ ```bash
10
+ uv sync --extra dev
11
+ uv run --extra dev python -m pre_commit install
12
+ uv run --extra dev python -m pytest
13
+ uv run --extra dev ruff check
14
+ uv run --extra dev ruff format --check
15
+ ```
16
+
17
+ Run all hooks manually:
18
+
19
+ ```bash
20
+ uv run --extra dev python -m pre_commit run --all-files
21
+ ```
22
+
23
+ For document conversion work:
24
+
25
+ ```bash
26
+ uv sync --extra dev --extra docling
27
+ ```
28
+
29
+ ## Pull Requests
30
+
31
+ - Open an issue first for large behavior changes.
32
+ - Add or update tests for runtime behavior.
33
+ - Keep README changes focused on user-facing behavior.
34
+ - Do not commit run artifacts, coverage output, or built distributions.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ARIA contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,241 @@
1
+ Metadata-Version: 2.4
2
+ Name: thrapai-aria
3
+ Version: 0.1.0
4
+ Summary: Automation Runtime for Intelligent Actions
5
+ Project-URL: Homepage, https://github.com/thrapai/aria
6
+ Project-URL: Repository, https://github.com/thrapai/aria
7
+ Project-URL: Issues, https://github.com/thrapai/aria/issues
8
+ Author-email: Thomas Rapai <th.rapai@hotmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai,automation,cli,workflow,yaml
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: jinja2
23
+ Requires-Dist: openai
24
+ Requires-Dist: pydantic
25
+ Requires-Dist: pyyaml
26
+ Requires-Dist: rich
27
+ Requires-Dist: typer
28
+ Provides-Extra: dev
29
+ Requires-Dist: pre-commit; extra == 'dev'
30
+ Requires-Dist: pytest; extra == 'dev'
31
+ Requires-Dist: pytest-cov; extra == 'dev'
32
+ Requires-Dist: ruff; extra == 'dev'
33
+ Provides-Extra: docling
34
+ Requires-Dist: docling; extra == 'docling'
35
+ Description-Content-Type: text/markdown
36
+
37
+ <h1 align="center">ARIA</h1>
38
+
39
+ <p align="center">
40
+ Automation Runtime for Intelligent Actions.
41
+ </p>
42
+
43
+ <p align="center">
44
+ <img src="docs/logo.png" alt="ARIA logo" width="160">
45
+ </p>
46
+
47
+ <p align="center">
48
+ <a href="https://github.com/thrapai/aria/actions/workflows/ci.yml"><img alt="Tests" src="https://github.com/thrapai/aria/actions/workflows/ci.yml/badge.svg"></a>
49
+ <a href="https://codecov.io/gh/thrapai/aria"><img alt="Coverage" src="https://codecov.io/gh/thrapai/aria/branch/main/graph/badge.svg"></a>
50
+ <a href="https://pypi.org/project/thrapai-aria/"><img alt="PyPI" src="https://img.shields.io/pypi/v/thrapai-aria.svg"></a>
51
+ <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
52
+ </p>
53
+
54
+ Build AI-powered workflows with ARIA.
55
+
56
+ Your workflows are source-controlled, CI-friendly, and live in YAML files. Define them, run them locally, and inspect every result from saved run artifacts.
57
+
58
+ ## Why ARIA?
59
+
60
+ - Source-controlled workflows: prompts, steps, inputs, and providers live in YAML.
61
+ - Full step transparency: see every intermediate result, not just the final answer.
62
+ - Extensible runtime: add your own extension when a built-in step is not enough.
63
+ - Provider flexibility: OpenAI and local Ollama today, with more providers to come.
64
+ - Small runtime: no hosted service, web UI, marketplace, or agent framework.
65
+
66
+ ## Install
67
+
68
+ With the install script:
69
+
70
+ ```bash
71
+ curl -fsSL https://raw.githubusercontent.com/thrapai/aria/master/install.sh | bash
72
+ ```
73
+
74
+ With optional docling support:
75
+
76
+ ```bash
77
+ curl -fsSL https://raw.githubusercontent.com/thrapai/aria/master/install.sh | ARIA_PACKAGE='thrapai-aria[docling]' bash
78
+ ```
79
+
80
+ With `pipx`:
81
+
82
+ ```bash
83
+ pipx install thrapai-aria
84
+ ```
85
+
86
+ For docling support:
87
+
88
+ ```bash
89
+ pipx install "thrapai-aria[docling]"
90
+ ```
91
+
92
+ ## Quickstart
93
+
94
+ Create a workflow:
95
+
96
+ ```bash
97
+ aria init
98
+ ```
99
+
100
+ Run it:
101
+
102
+ ```bash
103
+ ollama pull gemma3:4b
104
+ aria run workflow.yml --input path=notes.txt
105
+ ```
106
+
107
+ ARIA prints final outputs as JSON and writes run artifacts under `.aria/runs/<timestamp>/`.
108
+
109
+ ## Workflow
110
+
111
+ ```yaml
112
+ version: "1"
113
+ name: summarize_file
114
+
115
+ providers:
116
+ ollama:
117
+ type: ollama
118
+ base_url: http://localhost:11434
119
+
120
+ inputs:
121
+ path:
122
+ type: file
123
+ required: true
124
+
125
+ steps:
126
+ - id: read
127
+ uses: file.read
128
+ with:
129
+ path: "{{ inputs.path }}"
130
+
131
+ - id: summarize
132
+ uses: ai.generate
133
+ with:
134
+ model: ollama:gemma3:4b
135
+ prompt: |
136
+ Summarize this file in five concise bullet points:
137
+
138
+ {{ steps.read.output.content }}
139
+
140
+ - id: save
141
+ uses: file.write
142
+ with:
143
+ path: summary.txt
144
+ content: "{{ steps.summarize.output.text }}"
145
+
146
+ outputs:
147
+ summary: "{{ steps.summarize.output.text }}"
148
+ summary_file: "{{ steps.save.output.path }}"
149
+ ```
150
+
151
+ Templates can read workflow inputs and previous step outputs:
152
+
153
+ ```jinja2
154
+ {{ inputs.path }}
155
+ {{ steps.read.output.content }}
156
+ ```
157
+
158
+ ## Built-In Extensions
159
+
160
+ - `ai.generate`
161
+ - `file.read`
162
+ - `file.write`
163
+ - `utils.json.parse`
164
+ - `utils.text.chunk`
165
+ - `docling.convert` - _optional_
166
+
167
+ Extension examples live in `docs/extensions/`.
168
+
169
+ ## Providers
170
+
171
+ ARIA currently supports `openai` and `ollama` provider types. A provider entry is an
172
+ alias that can be used in `ai.generate` model strings as `provider:model`.
173
+
174
+ ### OpenAI
175
+
176
+ ```bash
177
+ export OPENAI_API_KEY="..."
178
+ ```
179
+
180
+ ```yaml
181
+ providers:
182
+ openai:
183
+ type: openai
184
+ api_key_env: OPENAI_API_KEY
185
+ # Optional:
186
+ # api_key_file: .openai-key
187
+ # base_url: https://api.openai.com/v1
188
+ ```
189
+
190
+ If no `providers.openai` entry is configured, `openai:<model>` still works and
191
+ reads `OPENAI_API_KEY` from the environment.
192
+
193
+ ### Ollama
194
+
195
+ ```bash
196
+ ollama pull gemma3:4b
197
+ ```
198
+
199
+ ```yaml
200
+ providers:
201
+ ollama:
202
+ type: ollama
203
+ base_url: http://localhost:11434
204
+ ```
205
+
206
+ If no `providers.ollama` entry is configured, `ollama:<model>` still works and
207
+ uses `http://localhost:11434`.
208
+
209
+ Provider names may be custom aliases when the entry declares a supported `type`:
210
+
211
+ ```yaml
212
+ providers:
213
+ local:
214
+ type: ollama
215
+ base_url: http://localhost:11434
216
+
217
+ steps:
218
+ - id: summarize
219
+ uses: ai.generate
220
+ with:
221
+ model: local:gemma3:4b
222
+ prompt: "Summarize: {{ inputs.text }}"
223
+ ```
224
+
225
+ Use providers as `provider:model`, for example `openai:gpt-4.1-mini`,
226
+ `ollama:gemma3:4b`, or `local:gemma3:4b`.
227
+
228
+ ## Development
229
+
230
+ ```bash
231
+ uv sync --extra dev
232
+ uv run --extra dev python -m pytest
233
+ uv run --extra dev ruff check
234
+ uv run --extra dev ruff format --check
235
+ ```
236
+
237
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution and release notes.
238
+
239
+ ## License
240
+
241
+ MIT
@@ -0,0 +1,205 @@
1
+ <h1 align="center">ARIA</h1>
2
+
3
+ <p align="center">
4
+ Automation Runtime for Intelligent Actions.
5
+ </p>
6
+
7
+ <p align="center">
8
+ <img src="docs/logo.png" alt="ARIA logo" width="160">
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://github.com/thrapai/aria/actions/workflows/ci.yml"><img alt="Tests" src="https://github.com/thrapai/aria/actions/workflows/ci.yml/badge.svg"></a>
13
+ <a href="https://codecov.io/gh/thrapai/aria"><img alt="Coverage" src="https://codecov.io/gh/thrapai/aria/branch/main/graph/badge.svg"></a>
14
+ <a href="https://pypi.org/project/thrapai-aria/"><img alt="PyPI" src="https://img.shields.io/pypi/v/thrapai-aria.svg"></a>
15
+ <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
16
+ </p>
17
+
18
+ Build AI-powered workflows with ARIA.
19
+
20
+ Your workflows are source-controlled, CI-friendly, and live in YAML files. Define them, run them locally, and inspect every result from saved run artifacts.
21
+
22
+ ## Why ARIA?
23
+
24
+ - Source-controlled workflows: prompts, steps, inputs, and providers live in YAML.
25
+ - Full step transparency: see every intermediate result, not just the final answer.
26
+ - Extensible runtime: add your own extension when a built-in step is not enough.
27
+ - Provider flexibility: OpenAI and local Ollama today, with more providers to come.
28
+ - Small runtime: no hosted service, web UI, marketplace, or agent framework.
29
+
30
+ ## Install
31
+
32
+ With the install script:
33
+
34
+ ```bash
35
+ curl -fsSL https://raw.githubusercontent.com/thrapai/aria/master/install.sh | bash
36
+ ```
37
+
38
+ With optional docling support:
39
+
40
+ ```bash
41
+ curl -fsSL https://raw.githubusercontent.com/thrapai/aria/master/install.sh | ARIA_PACKAGE='thrapai-aria[docling]' bash
42
+ ```
43
+
44
+ With `pipx`:
45
+
46
+ ```bash
47
+ pipx install thrapai-aria
48
+ ```
49
+
50
+ For docling support:
51
+
52
+ ```bash
53
+ pipx install "thrapai-aria[docling]"
54
+ ```
55
+
56
+ ## Quickstart
57
+
58
+ Create a workflow:
59
+
60
+ ```bash
61
+ aria init
62
+ ```
63
+
64
+ Run it:
65
+
66
+ ```bash
67
+ ollama pull gemma3:4b
68
+ aria run workflow.yml --input path=notes.txt
69
+ ```
70
+
71
+ ARIA prints final outputs as JSON and writes run artifacts under `.aria/runs/<timestamp>/`.
72
+
73
+ ## Workflow
74
+
75
+ ```yaml
76
+ version: "1"
77
+ name: summarize_file
78
+
79
+ providers:
80
+ ollama:
81
+ type: ollama
82
+ base_url: http://localhost:11434
83
+
84
+ inputs:
85
+ path:
86
+ type: file
87
+ required: true
88
+
89
+ steps:
90
+ - id: read
91
+ uses: file.read
92
+ with:
93
+ path: "{{ inputs.path }}"
94
+
95
+ - id: summarize
96
+ uses: ai.generate
97
+ with:
98
+ model: ollama:gemma3:4b
99
+ prompt: |
100
+ Summarize this file in five concise bullet points:
101
+
102
+ {{ steps.read.output.content }}
103
+
104
+ - id: save
105
+ uses: file.write
106
+ with:
107
+ path: summary.txt
108
+ content: "{{ steps.summarize.output.text }}"
109
+
110
+ outputs:
111
+ summary: "{{ steps.summarize.output.text }}"
112
+ summary_file: "{{ steps.save.output.path }}"
113
+ ```
114
+
115
+ Templates can read workflow inputs and previous step outputs:
116
+
117
+ ```jinja2
118
+ {{ inputs.path }}
119
+ {{ steps.read.output.content }}
120
+ ```
121
+
122
+ ## Built-In Extensions
123
+
124
+ - `ai.generate`
125
+ - `file.read`
126
+ - `file.write`
127
+ - `utils.json.parse`
128
+ - `utils.text.chunk`
129
+ - `docling.convert` - _optional_
130
+
131
+ Extension examples live in `docs/extensions/`.
132
+
133
+ ## Providers
134
+
135
+ ARIA currently supports `openai` and `ollama` provider types. A provider entry is an
136
+ alias that can be used in `ai.generate` model strings as `provider:model`.
137
+
138
+ ### OpenAI
139
+
140
+ ```bash
141
+ export OPENAI_API_KEY="..."
142
+ ```
143
+
144
+ ```yaml
145
+ providers:
146
+ openai:
147
+ type: openai
148
+ api_key_env: OPENAI_API_KEY
149
+ # Optional:
150
+ # api_key_file: .openai-key
151
+ # base_url: https://api.openai.com/v1
152
+ ```
153
+
154
+ If no `providers.openai` entry is configured, `openai:<model>` still works and
155
+ reads `OPENAI_API_KEY` from the environment.
156
+
157
+ ### Ollama
158
+
159
+ ```bash
160
+ ollama pull gemma3:4b
161
+ ```
162
+
163
+ ```yaml
164
+ providers:
165
+ ollama:
166
+ type: ollama
167
+ base_url: http://localhost:11434
168
+ ```
169
+
170
+ If no `providers.ollama` entry is configured, `ollama:<model>` still works and
171
+ uses `http://localhost:11434`.
172
+
173
+ Provider names may be custom aliases when the entry declares a supported `type`:
174
+
175
+ ```yaml
176
+ providers:
177
+ local:
178
+ type: ollama
179
+ base_url: http://localhost:11434
180
+
181
+ steps:
182
+ - id: summarize
183
+ uses: ai.generate
184
+ with:
185
+ model: local:gemma3:4b
186
+ prompt: "Summarize: {{ inputs.text }}"
187
+ ```
188
+
189
+ Use providers as `provider:model`, for example `openai:gpt-4.1-mini`,
190
+ `ollama:gemma3:4b`, or `local:gemma3:4b`.
191
+
192
+ ## Development
193
+
194
+ ```bash
195
+ uv sync --extra dev
196
+ uv run --extra dev python -m pytest
197
+ uv run --extra dev ruff check
198
+ uv run --extra dev ruff format --check
199
+ ```
200
+
201
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution and release notes.
202
+
203
+ ## License
204
+
205
+ MIT
@@ -0,0 +1,42 @@
1
+ # ai
2
+
3
+ AI generation extensions.
4
+
5
+ ## ai.generate
6
+
7
+ Input:
8
+
9
+ ```yaml
10
+ model: ollama:gemma3:4b
11
+ prompt: "Summarize: {{ inputs.text }}"
12
+ ```
13
+
14
+ `model` must use `provider:model` format. The provider can be a built-in
15
+ provider name, such as `openai` or `ollama`, or a custom alias from the
16
+ workflow's `providers` block.
17
+
18
+ Supported provider types:
19
+
20
+ - `openai` - reads `OPENAI_API_KEY` by default, or `api_key_env` /
21
+ `api_key_file` from the provider config. `base_url` is optional.
22
+ - `ollama` - uses `http://localhost:11434` by default. `base_url` is optional.
23
+
24
+ Output:
25
+
26
+ ```json
27
+ {
28
+ "text": "...",
29
+ "model": "ollama:gemma3:4b"
30
+ }
31
+ ```
32
+
33
+ Example:
34
+
35
+ ```yaml
36
+ steps:
37
+ - id: summarize
38
+ uses: ai.generate
39
+ with:
40
+ model: ollama:gemma3:4b
41
+ prompt: "Summarize: {{ inputs.text }}"
42
+ ```