Base classes for scoring the output of a model on a scale of 1-10.
Class for a constitutional principle.
A Criteria to evaluate.
A base class for evaluators that use an LLM.
String evaluator interface.
Grade, tag, or otherwise evaluate predictions relative to their inputs and/or reference labels.
A parser for the output of the ScoreStringEvalChain.
A chain for scoring on a scale of 1-10 the output of a model.
A chain for scoring the output of a model on a scale of 1-10.
Chain to run queries against LLMs.
This class is deprecated. See below for an example implementation using LangChain runnables:
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import PromptTemplate
from langchain_openai import OpenAI
prompt_template = "Tell me a {adjective} joke"
prompt = PromptTemplate(input_variables=["adjective"], template=prompt_template)
model = OpenAI()
chain = prompt | model | StrOutputParser()
chain.invoke("your adjective here")