langchain.model_laboratory
.ModelLaboratory¶
- class langchain.model_laboratory.ModelLaboratory(chains: Sequence[Chain], names: Optional[List[str]] = None)[source]¶
Experiment with different models.
Initialize with chains to experiment with.
- Parameters
chains – list of chains to experiment with.
Methods
__init__
(chains[, names])Initialize with chains to experiment with.
compare
(text)Compare model outputs on an input text.
from_llms
(llms[, prompt])Initialize with LLMs to experiment with and optional prompt.
- __init__(chains: Sequence[Chain], names: Optional[List[str]] = None)[source]¶
Initialize with chains to experiment with.
- Parameters
chains – list of chains to experiment with.
- compare(text: str) None [source]¶
Compare model outputs on an input text.
If a prompt was provided with starting the laboratory, then this text will be fed into the prompt. If no prompt was provided, then the input text is the entire prompt.
- Parameters
text – input text to run all models on.
- classmethod from_llms(llms: List[BaseLLM], prompt: Optional[PromptTemplate] = None) ModelLaboratory [source]¶
Initialize with LLMs to experiment with and optional prompt.
- Parameters
llms – list of LLMs to experiment with
prompt – Optional prompt to use to prompt the LLMs. Defaults to None. If a prompt was provided, it should only have one input variable.