generate(
self,
messages: list[list[BaseMessage]],
stop: list| 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 |
tags | list[str] | None | Default: None |
metadata | dict[str, Any] | None | Default: None |
run_name | str | None | Default: None |
run_id | uuid.UUID | None | Default: None |
**kwargs | Any | Default: {} |
Pass a sequence of prompts to the model and return model generations.
This method should make use of batched calls for models that expose a batched API.
Use this method when you want to:
Callbacks to pass through.
Used for executing additional functionality, such as logging or streaming, throughout generation.
The tags to apply.
The metadata to apply.
The name of the run.
The ID of the run.
Arbitrary additional keyword arguments.
These are usually passed to the model provider API call.