mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-07 18:35:22 +03:00
2.2 KiB
2.2 KiB
In [1]:
from langchain.llms import AlephAlpha
from langchain import PromptTemplate, LLMChainIn [2]:
template = """Q: {question}
A:"""
prompt = PromptTemplate(template=template, input_variables=["question"])In [3]:
llm = AlephAlpha(model="luminous-extended", maximum_tokens=20, stop_sequences=["Q:"])In [4]:
llm_chain = LLMChain(prompt=prompt, llm=llm)In [5]:
question = "What is AI?"
llm_chain.run(question)Out [5]:
' Artificial Intelligence (AI) is the simulation of human intelligence processes by machines, especially computer systems.\n'