enterprise_ai.runtime.langgraph
Source: sdks/python/src/enterprise_ai/runtime/langgraph.py. Back to the Python SDK reference index.
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Functions
initial_state
initial_state(task: Any = None, system: str | None = None, messages: list[dict[str, Any]] | None = None) -> dict[str, Any]
Graph input: the messages of the turn.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
task | Any | None | no | Task appended as the last user message (converted to text). |
system | str | None | None | no | System prompt inserted as the first message. |
messages | list[dict[str, Any]] | None | None | no | Messages that already open the turn; empty by default. |
Returns: dict[str, Any]. Dict {"messages": [...]} used as graph input.
turn_node
turn_node(runner: AgentRunner) -> Any
The graph node: one :meth:AgentRunner.run_turn over state["messages"].
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
runner | AgentRunner | yes | Navin runner that executes the turn. |
Returns: Any. Function state -> dict that runs one turn, or resumes state["resume"], and returns TurnResult.state().
to_result
to_result(state: dict[str, Any]) -> TurnResult
Rebuild a :class:TurnResult from the graph output.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
state | dict[str, Any] | yes | Graph output in the TurnResult.state() format (messages, step, final, stop_reason...). |
Returns: TurnResult. A TurnResult: Outcome of :meth:AgentRunner.run_turn.
build_graph
build_graph(runner: AgentRunner) -> Any
A langgraph.graph.StateGraph (not compiled): START -> turn -> END.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
runner | AgentRunner | yes | Navin runner whose run_turn is the single turn node. |
Returns: Any. Uncompiled StateGraph to compile with a LangGraph checkpointer; raises an error naming the langgraph extra when LangGraph is missing.
run_without_langgraph
run_without_langgraph(runner: AgentRunner, task: Any = None, system: str | None = None, messages: list[dict[str, Any]] | None = None) -> TurnResult
Run the same single-node graph without LangGraph installed.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
runner | AgentRunner | yes | Navin runner that executes the turn. | |
task | Any | None | no | Task appended as the last user message. |
system | str | None | None | no | System prompt inserted as the first message. |
messages | list[dict[str, Any]] | None | None | no | Messages that already open the turn. |
Returns: TurnResult. A TurnResult: Outcome of :meth:AgentRunner.run_turn.