Quickstart
Prerequisites
- Python 3.10 to 3.12 installed
- pip or pipx installed
- Before installing Langflow, we recommend creating a virtual environment to isolate your Python dependencies with venv or conda
Create the basic prompting flow
-
From the Langflow dashboard, click New Flow.
-
Select Basic Prompting.
-
The Basic Prompting flow is created.
This flow allows you to chat with the OpenAI component through the Prompt component.
- To examine the flow's Prompt component, click on the Template field of the Prompt component.
_10Answer the user as if you were a pirate._10_10User: {user_input}_10_10Answer:
The Template instructs the LLM to accept {user_input}
and Answer the user as if you were a pirate.
.
-
To create an environment variable for the OpenAI component, in the OpenAI API Key field, click the Globe button, and then click Add New Variable.
- In the Variable Name field, enter
openai_api_key
. - In the Value field, paste your OpenAI API Key (
sk-...
). - Click Save Variable.
- In the Variable Name field, enter
Run the Basic Prompting flow
- To open the Playground pane, click Playground. This is where you can interact with your AI.
- Type a message and press Enter. The bot should respond in a markedly piratical manner!
Modify the prompt for a different result
- To modify your prompt results, in the Prompt template, click the Template field. The Edit Prompt window opens.
- Change
Answer the user as if you were a pirate
to a different character, perhapsAnswer the user as if you were Hermione Granger.
- Run the workflow again. The response will be very different.
Next steps
Well done! You've built your first prompt in Langflow. 🎉
By dragging Langflow components to your workspace, you can create all sorts of interesting behaviors. Here are a couple of examples: