Tuana commited on
Commit
90f87bc
·
unverified ·
1 Parent(s): 1b78813

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +42 -1
README.md CHANGED
@@ -7,4 +7,45 @@ sdk: streamlit
7
  sdk_version: 1.21.0
8
  app_file: app.py
9
  pinned: false
10
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  sdk_version: 1.21.0
8
  app_file: app.py
9
  pinned: false
10
+ ---
11
+
12
+ # What would mother say?
13
+
14
+ This app includes a Haystack agent with access to 2 tools:
15
+ - TweetRetriever: Useful for when you need to retrive the latest tweets from a username to get an understanding of their style
16
+ - WebSearch:Uesful for when you need to research the latest about a new topic
17
+
18
+ We build an Agent that aims to first understand the style in which a username tweets. Then, it uses the WebSearch tool to gain knowledge on a topic that the LLM may not have info on, to generate a tweet in the users style about that topic.
19
+ ### Try it out on [🤗 Spaces](https://huggingface.co/spaces/Tuana/what-would-mother-say)
20
+
21
+ ##### A showcase of a Haystack Agent with a custom `TwitterRetriever` Node and a `WebQAPipeline` as tools.
22
+
23
+ **Custom Haystack Node**
24
+
25
+ This repo contains a streamlit application that given a query about what a certain twitter username would post on a given topic, generates a tweet in their style (or tries to). It does so by using a custom Haystack node I've built called the [`TweetRetriever`](/custom_nodes/tweet_retriever.py)
26
+
27
+ **Custom PromptTemplates**
28
+
29
+ It's been built with [Haystack](https://haystack.deepset.ai) using the [`Agent`](https://docs.haystack.deepset.ai/docs/agent) and by creating a custom [`PromptTemplate`](https://docs.haystack.deepset.ai/docs/prompt_node#templates)
30
+
31
+ All the prompt templates used in this demo, both for the `WebQAPipeline` and the `Agent` can be found in `./prompts`.
32
+
33
+ <img width="867" alt="image" src="https://github.com/TuanaCelik/what-would-mother-say/assets/15802862/b05f8bde-8fd5-4c6f-beac-1578437a145b">
34
+
35
+ ## To learn more about the Agent
36
+
37
+ Check out our tutorial on the Conversational Agent [here](https://haystack.deepset.ai/tutorials/24_building_chat_app)
38
+
39
+ ## Installation and Running
40
+ 1. Install requirements:
41
+ `pip install -r requirements.txt`
42
+ 2. Run the streamlit app:
43
+ `streamlit run app.py`
44
+ 3. Createa a `.env` and add your Twitter Bearer token, OpenAI Key, and SerperDev Key:
45
+ `TWITTER_BEARER_TOKEN`
46
+ `SERPER_KEY`
47
+ `OPENAI_API_KEY`
48
+
49
+ This will start up the app on `localhost:8501` where you will find a simple search bar
50
+
51
+ #### The Haystack Community is on [Discord](https://discord.com/invite/VBpFzsgRVF)