Files
2023-03-26 19:49:46 -07:00

2.2 KiB

Aleph Alpha

This example goes over how to use LangChain to interact with Aleph Alpha models

In [1]:
from langchain.llms import AlephAlpha
from langchain import PromptTemplate, LLMChain
In [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'