mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-06 09:55:21 +03:00
- Updated `langchain/docs/modules/models/llms/integrations/` notebooks: added links to the original sites, the install information, etc. - Added the `nlpcloud` notebook. - Removed "Example" from Titles of some notebooks, so all notebook titles are consistent.
3.8 KiB
3.8 KiB
In [1]:
import os
from langchain.llms import DeepInfra
from langchain import PromptTemplate, LLMChainIn [2]:
# get a new token: https://deepinfra.com/login?from=%2Fdash
from getpass import getpass
DEEPINFRA_API_TOKEN = getpass()········
In [3]:
os.environ["DEEPINFRA_API_TOKEN"] = DEEPINFRA_API_TOKENIn [ ]:
llm = DeepInfra(model_id="DEPLOYED MODEL ID")In [ ]:
template = """Question: {question}
Answer: Let's think step by step."""
prompt = PromptTemplate(template=template, input_variables=["question"])In [ ]:
llm_chain = LLMChain(prompt=prompt, llm=llm)In [ ]:
question = "What NFL team won the Super Bowl in 2015?"
llm_chain.run(question)