StringExampleMapper#

class langchain.smith.evaluation.string_run_evaluator.StringExampleMapper[source]#

Bases: Serializable

Map an example, or row in the dataset, to the inputs of an evaluation.

param reference_key: str | None = None#
__call__(example: Example) Dict[str, str][source]#

Maps the Run and Example to a dictionary.

Parameters:

example (Example)

Return type:

Dict[str, str]

map(example: Example) Dict[str, str][source]#

Maps the Example, or dataset row to a dictionary.

Parameters:

example (Example)

Return type:

Dict[str, str]

serialize_chat_messages(messages: List[Dict]) str[source]#

Extract the input messages from the run.

Parameters:

messages (List[Dict])

Return type:

str

property output_keys: List[str]#

The keys to extract from the run.