langchain_core.runnables.passthrough.RunnableAssign¶
class langchain_core.runnables.passthrough.RunnableAssign[source]¶
Bases: RunnableSerializable[Dict[str, Any], Dict[str, Any]]
A runnable that assigns key-value pairs to Dict[str, Any] inputs.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param mapper: langchain_core.runnables.base.RunnableParallel[Dict[str, Any]] [Required]¶
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶
Default implementation runs ainvoke in parallel using asyncio.gather.
The default implementation of batch works well for IO bound runnables.
Subclasses should override this method if they can batch more efficiently;
e.g., if the underlying runnable uses an API which supports a batch mode.
async ainvoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None, **kwargs: Any) → Dict[str, Any][source]¶
Default implementation of ainvoke, calls invoke from a thread.
The default implementation allows usage of async code even if
the runnable did not implement a native async version of invoke.
Subclasses should override this method if they can run asynchronously.
async astream(input: Dict[str, Any], config: Optional[RunnableConfig] = None, **kwargs: Any) → AsyncIterator[Dict[str, Any]][source]¶
Default implementation of astream, which calls ainvoke.
Subclasses should override this method if they support streaming output.