Skip to content

Commit

Permalink
docs: Add docstring for aupdate_state method
Browse files Browse the repository at this point in the history
  • Loading branch information
YassinNouh21 committed Nov 16, 2024
1 parent 5494855 commit 1a7f60c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libs/langgraph/langgraph/pregel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,18 @@ async def aupdate_state(
values: dict[str, Any] | Any,
as_node: Optional[str] = None,
) -> RunnableConfig:
"""Update the state of the graph asynchronously with the given values, as if they came from node as_node. If as_node is not provided, it will be set to the last node that updated the state, if not ambiguous.
Args:
config (RunnableConfig): The configuration to use for the update.
values (Optional[Union[dict[str, Any], Any]]): The values to update the state with.
as_node (Optional[str], default: None): The node to attribute the update to.
If not provided, it will be set to the last node that updated the state,
if not ambiguous.
Returns:
RunnableConfig: The updated configuration.
"""
checkpointer: Optional[BaseCheckpointSaver] = config[CONF].get(
CONFIG_KEY_CHECKPOINTER, self.checkpointer
)
Expand Down

0 comments on commit 1a7f60c

Please sign in to comment.