Python runtime for the Forma language
Project description
forma-lang
Python runtime package for Forma task files.
The package exposes FormaRuntime for executing Forma source, ModelProvider
for custom adapters, HttpJsonProvider for HTTP JSON model endpoints,
OpenAIResponsesProvider for OpenAI Responses API execution, and
StaticProvider and RecordingProvider for deterministic tests of agent
blocks. The current runtime supports the MVP task shape used by the shared
conformance fixtures:
- deterministic
computeblocks that produce amessagefromuser_name verifychecks formessage.length > 0andmessage.words <= 12agentblocks executed through an explicit fake provider such asStaticProvider
from forma import FormaRuntime, StaticProvider
runtime = FormaRuntime(
model_provider=StaticProvider({"message": "Hello, Sam. Good to see you."})
)
result = runtime.run_source(source, input={"user_name": "Sam"}, source_name="task.forma")
Use RecordingProvider when tests need to assert which instruction, input,
permissions, and output contract the runtime sent to the provider.
run_source returns a FormaResult with ok, output, trace,
diagnostics, verification, and error fields.
For real agent execution, keep the provider key and model name in the host
program or environment, then pass a provider object to FormaRuntime. The
runtime calls run_agent(instruction, values, permissions, tools, output, schemas) when it reaches the task's agent block; providers that only accept
the original four arguments still work. Providers call tools.require("read")
or another declared permission before host workspace actions. Use
run_task(source, "task_name", input, source_name) when source text contains
multiple tasks, or run_file(path, "task_name", input) when the contract lives
on disk.
Local Checks
Run the Python package tests from the repository root:
python -m pytest packages/forma-python/tests -q
For workspace-level validation, also run:
corepack pnpm check
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forma_lang-0.1.0.tar.gz.
File metadata
- Download URL: forma_lang-0.1.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0201bdc58ee4d331dc67e205cae0aa5426015bbd7cc50f9a710132bc7ab52038
|
|
| MD5 |
3aec2d313c24cfe197e2b2005a516b2f
|
|
| BLAKE2b-256 |
f9c0aef9405ab22f9787948bcff6a688185608a9f7a43191d39b0010e1f79f58
|
Provenance
The following attestation bundles were made for forma_lang-0.1.0.tar.gz:
Publisher:
publish-python.yml on syndicalt/forma
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forma_lang-0.1.0.tar.gz -
Subject digest:
0201bdc58ee4d331dc67e205cae0aa5426015bbd7cc50f9a710132bc7ab52038 - Sigstore transparency entry: 1572242943
- Sigstore integration time:
-
Permalink:
syndicalt/forma@a80ef1fe674e80ccc15a397a3d0acb4ecdd12e5e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/syndicalt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a80ef1fe674e80ccc15a397a3d0acb4ecdd12e5e -
Trigger Event:
release
-
Statement type:
File details
Details for the file forma_lang-0.1.0-py3-none-any.whl.
File metadata
- Download URL: forma_lang-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6118f5f92df560f7a5521f68ca79b4689744c7936e4def1232ca5f95cd53746
|
|
| MD5 |
eabcada8ab16b9f1a2c1f30e6611a6a4
|
|
| BLAKE2b-256 |
d887934a9f5a763a4f357d130f9f742aa9f13b9e93c0ca5c8e7604d9b181f6b9
|
Provenance
The following attestation bundles were made for forma_lang-0.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on syndicalt/forma
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forma_lang-0.1.0-py3-none-any.whl -
Subject digest:
b6118f5f92df560f7a5521f68ca79b4689744c7936e4def1232ca5f95cd53746 - Sigstore transparency entry: 1572242948
- Sigstore integration time:
-
Permalink:
syndicalt/forma@a80ef1fe674e80ccc15a397a3d0acb4ecdd12e5e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/syndicalt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a80ef1fe674e80ccc15a397a3d0acb4ecdd12e5e -
Trigger Event:
release
-
Statement type: