How to use off-the-shelf evaluators (Python only)
Recommended Reading
Before diving into this content, it might be helpful to read the following:
LangChain provides a suite of off-the-shelf evaluators you can use right away to evaluate your application performance without writing any custom code. These evaluators are meant to be used more as a starting point for evaluation.
Prerequisites
Create a dataset and set up the LangSmith client in Python to follow along
from langsmith import Client
client = Client()
Create a dataset
examples = [
("Ankush", "Hello Ankush"),
("Harrison", "Hello Harrison"),
]
dataset_name = "Hello Set"
dataset = client.create_dataset(dataset_name=dataset_name)
inputs, outputs = zip(
*[({"input": input}, {"expected": expected}) for input, expected in examples]
)
client.create_examples(inputs=inputs, outputs=outputs, dataset_id=dataset.id)