Skip to main content

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 compute blocks that produce a message from user_name
  • verify checks for message.length > 0 and message.words <= 12
  • agent blocks executed through an explicit fake provider such as StaticProvider
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

Metadata

Release files for forma-lang 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forma-lang 0.1.0
File Size Uploaded
forma_lang-0.1.0.tar.gz 17.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for forma-lang 0.1.0
File Interpreter ABI Platform
forma_lang-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.4 kB

Release files / forma_lang-0.1.0.tar.gz

Download URL forma_lang-0.1.0.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0201bdc58ee4d331dc67e205cae0aa5426015bbd7cc50f9a710132bc7ab52038
BLAKE2b-256 checksum
How to use checksums
f9c0aef9405ab22f9787948bcff6a688185608a9f7a43191d39b0010e1f79f58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release files / forma_lang-0.1.0-py3-none-any.whl

Download URL forma_lang-0.1.0-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6118f5f92df560f7a5521f68ca79b4689744c7936e4def1232ca5f95cd53746
BLAKE2b-256 checksum
How to use checksums
d887934a9f5a763a4f357d130f9f742aa9f13b9e93c0ca5c8e7604d9b181f6b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page