Skip to main content

langgraph_state

Attribute Macro langgraph_state 

Source
#[langgraph_state]
Expand description

This attribute macro:

  1. Automatically adds #[derive(serde::Serialize, serde::Deserialize, Clone, Default, StateGraph)].
  2. Automatically injects #[serde(default)] on every field to ensure robustness.

Usage:

#[langgraph_state]
struct MyState {
    #[channel(messages)]
    messages: Vec<Message>,
    other_field: String,
}