Blog writer
This flow demonstrates adding an additional {references}
input to the Prompt component to capture input from the URL and Parser components.
The Language model component uses this input to generate a blog post according to the {instructions}
received by the Prompt component.
Prerequisites
Create the blog writer flow
-
From the Langflow dashboard, click New Flow.
-
Select Blog Writer.
-
The Blog Writer flow is created.
This flow creates a blog article generator with Prompt, Language Model, and Chat Output components, augmented with reference content and instructions from the URL and Text Input components.
The URL component extracts raw text and metadata from one or more web links. The Parser component converts the data coming from the URL component into plain text to feed the prompt.
To examine the flow's prompt, click the Template field of the Prompt component.
_10Reference 1:_10_10{references}_10_10---_10_10{instructions}_10_10Blog:The
{instructions}
value is received from the Text Input component, and one or more{references}
are received from a list of URLs parsed from the URL component.
Run the blog writer flow
-
Add your OpenAI API key to the Language model model component. Optionally, create a global variable for the OpenAI API key.
- In the OpenAI API Key field, click Globe, 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.
-
To run the flow, click Playground, and then click Run Flow. A blog post about Langflow is generated, with content sourced from
langflow.org
anddocs.langflow.org
. -
To write about something different, change the values in the URL component and adjust the instructions in the Text input component. Try again and see what the LLM constructs.