Blog Writer

Build a Blog Writer flow for a one-shot application using OpenAI.

This flow extends the Basic Prompting flow with the URL and Parse data components that fetch content from multiple URLs and convert the loaded data into plain text.

OpenAI uses this loaded data to generate a blog post, as instructed by the Text input component.

Open Langflow and start a new project

  1. In the Astra Portal header, switch your active app from Astra DB Serverless to Langflow.

  2. In Langflow, click New Project, and then select the Blog Writer project.

This opens a starter project with the necessary components to run a one-shot application using OpenAI.

Blog Writer flow

starter flow blog writer

The Blog Writer flow consists of these components:

  • The Text Input component accepts text input.

  • The Prompt component combines the user input with a user-defined prompt.

  • The OpenAI model component sends the user input and prompt to the OpenAI API and receives a response.

  • The Chat Output component prints the flow’s output to the chat.

  • The URL component fetches web content from multiple URLs.

  • The Parse Data component parses and converts data into plain text.

Run the Blog Writer flow

  1. Add your credentials to the Open AI component. The fastest and most secure way to add credentials is with Langflow’s Global Variables.

    1. Click settings Settings, and then click language Global Variables.

    2. Click Add New.

    3. Name your variable. Paste your API key in the Value field.

    4. In the Apply To Fields field, select the field you want to globally apply this variable to.

    5. Click Save Variable.

  2. Click play_arrow Playground to view the flow’s output.

Based on the instructions from the Text input component, the flow generates a blog post with data from the URL component. Now that your query has completed the journey from Text input to Chat output, you have completed the Blog Writer flow.

Next steps

To interact with this flow as an API endpoint, see the Langflow API.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com