Asynchronously pass a sequence of prompts to a model and return generations.
This method should make use of batched calls for models that expose a batched API.
Use this method when you want to:
agenerate(
self,
messages: list[list[BaseMessage]],
stop: list[str] | None = None,
callbacks: Callbacks = None,
*,
tags: list[str] | None = None,
metadata: dict[str, Any] | None = None,
run_name: str | None = None,
run_id: uuid.UUID | None = None,
**kwargs: Any = {}
) -> LLMResult| Name | Type | Description |
|---|---|---|
messages* | list[list[BaseMessage]] | List of list of messages. |
stop | list[str] | None | Default: NoneStop words to use when generating. Model output is cut off at the first occurrence of any of these substrings. |
callbacks | Callbacks | Default: None
Used for executing additional functionality, such as logging or streaming, throughout generation. |
tags | list[str] | None | Default: NoneThe tags to apply. |
metadata | dict[str, Any] | None | Default: NoneThe metadata to apply. |
run_name | str | None | Default: NoneThe name of the run. |
run_id | uuid.UUID | None | Default: NoneThe ID of the run. |
**kwargs | Any | Default: {}Arbitrary additional keyword arguments. These are usually passed to the model provider API call. |