Код: Выделить всё
question=st.text_input("your question")
llm=OpenAI(temperature=0.9)
if prompt:
response=llm(prompt)
st.write(response)
Код: Выделить всё
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
question=st.text_input("your question")
llm=OpenAI(temperature=0.9)
template="Write me something about {topic}"
topic_template=PromptTemplate(input_variables=['topic'],template=template)
topic_chain=LLMChain(llm=llm,prompt=topic_template)
if prompt:
response=topic_chain.run(question)
st.write(response)
Подробнее здесь: https://stackoverflow.com/questions/769 ... -langchain
Мобильная версия