Skip to content

Commit 218c607

Browse files
authored
fix(docs): synchronize invoke and ainvoke docstrings (#6415)
Similar to #6414
1 parent 28b9f57 commit 218c607

File tree

1 file changed

+10
-11
lines changed
  • libs/langgraph/langgraph/pregel

1 file changed

+10
-11
lines changed

libs/langgraph/langgraph/pregel/main.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,31 +3104,30 @@ async def ainvoke(
31043104
durability: Durability | None = None,
31053105
**kwargs: Any,
31063106
) -> dict[str, Any] | Any:
3107-
"""Asynchronously invoke the graph on a single input.
3107+
"""Asynchronously run the graph with a single input and config.
31083108
31093109
Args:
3110-
input: The input data for the computation. It can be a dictionary or any other type.
3111-
config: The configuration for the computation.
3110+
input: The input data for the graph. It can be a dictionary or any other type.
3111+
config: The configuration for the graph run.
31123112
context: The static context to use for the run.
31133113
!!! version-added "Added in version 0.6.0"
3114-
stream_mode: The stream mode for the computation.
3114+
stream_mode: The stream mode for the graph run.
31153115
print_mode: Accepts the same values as `stream_mode`, but only prints the output to the console, for debugging purposes. Does not affect the output of the graph in any way.
3116-
output_keys: The output keys to include in the result.
3117-
interrupt_before: The nodes to interrupt before.
3118-
interrupt_after: The nodes to interrupt after.
3116+
output_keys: The output keys to retrieve from the graph run.
3117+
interrupt_before: The nodes to interrupt the graph run before.
3118+
interrupt_after: The nodes to interrupt the graph run after.
31193119
durability: The durability mode for the graph execution, defaults to `"async"`.
31203120
Options are:
31213121
31223122
- `"sync"`: Changes are persisted synchronously before the next step starts.
31233123
- `"async"`: Changes are persisted asynchronously while the next step executes.
31243124
- `"exit"`: Changes are persisted only when the graph exits.
3125-
**kwargs: Additional keyword arguments.
3125+
**kwargs: Additional keyword arguments to pass to the graph run.
31263126
31273127
Returns:
3128-
The result of the computation. If `stream_mode` is `"values"`, it returns the latest value.
3129-
If `stream_mode` is `"chunks"`, it returns a list of chunks.
3128+
The output of the graph run. If `stream_mode` is `"values"`, it returns the latest output.
3129+
If `stream_mode` is not `"values"`, it returns a list of output chunks.
31303130
"""
3131-
31323131
output_keys = output_keys if output_keys is not None else self.output_channels
31333132

31343133
latest: dict[str, Any] | Any = None

0 commit comments

Comments
 (0)