/what-would-mother-say

💁‍♀️ A Tweet creation Agent that fetches usernames last k tweets and generates a tweet about the requested topic

Primary LanguagePython

title emoji colorFrom colorTo sdk sdk_version app_file pinned
What would mother say?
🫶
pink
yellow
streamlit
1.21.0
app.py
false

What would mother say?

This app includes a Haystack agent with access to 2 tools:

  • MastodonRetriever: Useful for when you need to retrive the latest posts from a username to get an understanding of their style
  • WebSearch: Useful for when you need to research the latest about a new topic

We build an Agent that aims to first understand the style in which a username posts. Then, it uses the WebSearch tool to gain knowledge on a topic that the LLM may not have info on, to generate a post in the users style about that topic.

Try it out on 🤗 Spaces

A showcase of a Haystack Agent with a custom TwitterRetriever Node and a WebQAPipeline as tools.

Custom Haystack Node

This repo contains a streamlit application that given a query about what a certain twitter username would post on a given topic, generates a post in their style (or tries to). It does so by using a custom Haystack node I've built called the MastodonFetcher

Custom PromptTemplates

It's been built with Haystack using the Agent and by creating a custom PromptTemplate

All the prompt templates used in this demo, both for the WebQAPipeline and the Agent can be found in ./prompts.

image

To learn more about the Agent

Check out our tutorial on the Conversational Agent here

Installation and Running

  1. Install requirements: pip install -r requirements.txt
  2. Run the streamlit app: streamlit run app.py
  3. Createa a .env and add your Twitter Bearer token, OpenAI Key, and SerperDev Key:

TWITTER_BEARER_TOKEN

SERPER_KEY

OPENAI_API_KEY

This will start up the app on localhost:8501 where you will find a simple search bar

The Haystack Community is on Discord