Files
langchain/libs/cli/langchain_cli/integration_template/docs/llms.ipynb
T

2.1 KiB

Cell:
[Cell type raw - unsupported, skipped]

__ModuleName__LLM

This example goes over how to use LangChain to interact with __ModuleName__ models.

Installation

In [ ]:
# install package
!pip install -U __package_name__

Environment Setup

Make sure to set the following environment variables:

  • TODO: fill out relevant environment variables or secrets

Usage

In [4]:
from langchain_core.prompts import PromptTemplate
from __module_name__.llms import __ModuleName__LLM

template = """Question: {question}

Answer: Let's think step by step."""

prompt = PromptTemplate.from_string(template)

model = __ModuleName__LLM()

chain = prompt | model

chain.invoke({"question": "What is LangChain?"})