mirror of
https://github.com/langchain-ai/deepagents.git
synced 2026-08-27 02:41:20 -04:00
2ac7d41533
Release-As: 0.1.0
28 lines
784 B
Python
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`."""
|