mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-07 18:35:22 +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.5 KiB
3.5 KiB
In [ ]:
import os
from langchain.llms import ForefrontAI
from langchain import PromptTemplate, LLMChainIn [ ]:
# get a new token: https://docs.forefront.ai/forefront/api-reference/authentication
from getpass import getpass
FOREFRONTAI_API_KEY = getpass()In [ ]:
os.environ["FOREFRONTAI_API_KEY"] = FOREFRONTAI_API_KEYIn [ ]:
llm = ForefrontAI(endpoint_url="YOUR ENDPOINT URL HERE")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 the year Justin Beiber was born?"
llm_chain.run(question)