langflow/docs/docs/Starter-Projects/starter-projects-basic-prompting.md
Mendon Kissling 0d11564dea
docs: v1.1.2 (#5850)
* docs:add-changelog-to-nav

* docs: add OpenRouter component documentation with detailed inputs and outputs

* docs: add Outputs section to components-models documentation for Cohere and Ollama

* docs: update references from configuration-objects to concepts-objects across multiple components and documentation files

* feat: Add DataFrame operations section to components-processing documentation

* title-case-in-nav

* fix-memories-tab-in-chat-memory

* tool-calling-agent-update

* feat: enhance documentation with icon imports and improved instructions for OpenAI component

* material-icon

* fix: update documentation for tool mode input connection in agent component

* add-loop-component

* add-img-for-loop-summary

* feat: add documentation for using logic components in a flow with examples

* fix: enhance documentation for Loop component with detailed data flow explanation

* redirect-for-config-objects-page

* fix: improve error handling in data processing module

* fix: update documentation for Data objects in Loop component and add import statement in memory chatbot tutorial

* quickstart-screenshots

* docs: update starter flow images

* update-agent-screenshots

* move-repl-agent

* docs: enhance global variables documentation and clarify prerequisites for vector store RAG flow

* docs: update Simple Agent to use URL component

* docs: enhance memory chatbot tutorial with example conversation and clarify session ID terminology

* docs: update visibility icon description in concepts-components.md

* Apply suggestions from code review

Co-authored-by: brian-f <brian.fisher@datastax.com>

* correct-playground-sequence-and-typo

---------

Co-authored-by: brian-f <brian.fisher@datastax.com>
2025-01-24 14:24:57 +00:00

2.1 KiB

title slug
Basic prompting /starter-projects-basic-prompting

import Icon from "@site/src/components/icon";

Prompts serve as the inputs to a large language model (LLM), acting as the interface between human instructions and computational tasks.

By submitting natural language requests in a prompt to an LLM, you can obtain answers, generate text, and solve problems.

This article demonstrates how to use Langflow's prompt tools to issue basic prompts to an LLM, and how various prompting strategies can affect your outcomes.

Prerequisites

Create the basic prompting flow

  1. From the Langflow dashboard, click New Flow.

  2. Select Basic Prompting.

  3. The Basic Prompting flow is created.

This flow allows you to chat with the OpenAI model component. The model will respond according to the prompt constructed in the Prompt component.

  1. To examine the Template, in the Prompt component, click the Template field.
Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.
  1. 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.

    1. In the Variable Name field, enter openai_api_key.
    2. In the Value field, paste your OpenAI API Key (sk-...).
    3. Click Save Variable.

Run the basic prompting flow

  1. Click the Playground button.
  2. Type a message and press Enter. The bot should respond in a markedly piratical manner!

Modify the prompt for a different result

  1. To modify your prompt results, in the Prompt component, click the Template field. The Edit Prompt window opens.
  2. Change the existing prompt to a different character, perhaps Answer the user as if you were Hermione Granger.
  3. Run the workflow again and notice how the prompt changes the model's response.