Files
deepagents/libs/code/deepagents_code/_cli_context.py
T
Mason Daugherty 2ac7d41533 feat(code): port from libs/cli (#3388)
Release-As: 0.1.0
2026-05-12 20:45:09 +00:00

28 lines
784 B
Python

"""Lightweight runtime context type for app model overrides.
Extracted from `configurable_model` so hot-path modules (`app`,
`textual_adapter`) can import `CLIContext` without pulling in the langchain
middleware stack.
"""
from __future__ import annotations
from typing import Any
from typing_extensions import TypedDict
class CLIContext(TypedDict, total=False):
"""Runtime context passed via `context=` to the LangGraph graph.
Carries per-invocation overrides that `ConfigurableModelMiddleware`
reads from `request.runtime.context`.
"""
model: str | None
"""Model spec to swap at runtime (e.g. `'provider:model'`)."""
model_params: dict[str, Any]
"""Invocation params (e.g. `temperature`, `max_tokens`) to merge
into `model_settings`."""