Skip to content

philnash/langflow-bluesky-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bluesky bots with Langflow

This is an example of a Bluesky bot that responds to mentions and replies by passing the post text to a flow built with Langflow and responding with the result of the flow.

The bot

The bot uses the AT Protocol to communicate with Bluesky and is powered by @skyware/bot.

It listens for mentions and replies to an account you provide. When it receives an incoming post it will trigger a Langflow flow with the text from the post, and reply using the output from the flow.

Prerequisites

To run this application you will need:

Preparation

Clone the repo:

git clone https://github.com/philnash/langflow-bluesky-bot.git
cd langflow-bluesky-bot

Install the dependencies:

npm install

Copy the .env.example file to .env:

cp .env.example .env

Fill in the .env file with your Bluesky account name and app password.

Langflow

Log into your DataStax account and open the Langflow dashboard. Create a flow that has a chat input, does some processing in the middle, and returns the result as a chat output.

If you're getting started with Langflow, the Basic Prompting template is the simplest generative AI flow that will work. Make sure you fill in the model component with an API key.

Once you are happy with the flow, click on the API button. This will show you how to access the flow via API. You will need the URL, which is most easily found on the cURL tab. You will also need an API token, which you can generate from the modal.

Once you have the URL and token, fill in the rest of the variables in the .env file.

Running the bot

Once you have all your credentials you can run the application with the following command:

npm run dev

This runs the app in a development mode where it will recompile and restart when you make a change.

If you want to run the application without that, you can build it first, which will compile the TypeScript into plain JavaScript.

npm run build

Then you can run the JavaScript directly with:

npm start

About

A simple bot that connects a Bluesky account to Langflow to create responses

Topics

Resources

License

Stars

Watchers

Forks

Contributors