Build your first LLM powered app with Langchain and Streamlit.
- Accepts input text (e.g.
What are the three key pieces of advice for learning how to code?
) as prompt input using Streamlit'sst.text_area()
, then assign this to thetext
variable. - LLM model is called via
llm()
and it is applied on the prompt inputtext
to generate a response viallm(text)
You can get your own OpenAI API key by following the following instructions:
- Go to https://platform.openai.com/account/api-keys.
- Click on the
+ Create new secret key
button. - Next, enter an identifier name (optional) and click on the
Create secret key
button.
Once the app is loaded, go ahead and enter your OpenAI API key and type a question in the text box and wait for a generated response.