utils
Utilities for file reading and parsing
| CLASS | DESCRIPTION |
|---|---|
InvalidMessageFormatError |
Exception that is raised when a dictionary cannot be parsed into a valid |
| FUNCTION | DESCRIPTION |
|---|---|
messages_from_dicts |
Convert a sequence of dictionaries to a list of |
Classes
InvalidMessageFormatError
flowchart TD
evallm.readers.utils.InvalidMessageFormatError[InvalidMessageFormatError]
click evallm.readers.utils.InvalidMessageFormatError href "" "evallm.readers.utils.InvalidMessageFormatError"
Exception that is raised when a dictionary cannot be parsed into a valid
BaseMessage,
either because it is missing a required key or because the message type is not supported.
-
API Reference
evallmreaders
Functions
messages_from_dicts
Convert a sequence of dictionaries to a list of BaseMessage objects.
| PARAMETER | DESCRIPTION |
|---|---|
dicts
|
A single or a sequence of dictionaries to be
converted into
|
| RETURNS | DESCRIPTION |
|---|---|
list[BaseMessage]
|
list[BaseMessage]: A list of BaseMessage objects created from the input dictionaries. |
| RAISES | DESCRIPTION |
|---|---|
InvalidMessageFormatError
|
If any of the input dictionaries cannot be
parsed into a valid |
Note
This method is a convenience wrapper around
langchain_core.messages.utils.convert_to_messages
and as such is subject to changes in the langchain-core library.