mechaharness.core.contract
OpenAPI-shaped request/response models for the non-DI surface.
CLI, HTTP, and mechaharness.factory.run share these types so callers who
do not use pyiv still go through one serializable contract.
- class mechaharness.core.contract.RunRequest(*, prompt: str, backend: str | None = None, family: str | None = None, model: str | None = None, api_key: str | None = None, base_url: str | None = None, system_prompt: str | None = None, max_turns: int = 8, temperature: float | None = None)[source]
Bases:
BaseModelOpenAPI-shaped input for
mechaharness.factory.run/ CLI / HTTP.String fields map onto
Settingswhen present; omitted fields keep environment defaults.- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mechaharness.core.contract.RunResponse(*, final_text: str | None, turns: int, messages: list[dict[str, ~typing.Any]], events: list[dict[str, ~typing.Any]] = <factory>)[source]
Bases:
BaseModelSerializable result of a harness run (messages and events as JSON dicts).
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].