Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Conversation Summary Mode: Track Assistant Responses #868

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ OPENAI_AZURE_DEPLOYMENT_ID=deployment-id-for-azure
IMAGE_PROVIDER=dalle
HUGGINGFACE_API_TOKEN=
USE_MAC_OS_TTS=False

# Step Summary Prompts
STEP_SUMMARIZATION_PROMPT=outline the key steps and insights you plan to take and gain during the completion of your task in a concise and relevant manner
FINAL_SUMMARIZATION_PROMPT=Consolidate and distill the essential information from the provided summaries of individual steps to create a concise and coherent summary of the overall process by creating an output structured using chapters, sub-chapters and bullet points. Don't include duplicate ideas. Leave only one instance if it's present in multiple steps:{}
# {} is replaced with the summary chunk content, make sure to include it in your FINAL_SUMMARIZATION_PROMPT
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Your support is greatly appreciated
- [💀 Continuous Mode ⚠️](#-continuous-mode-️)
- [GPT3.5 ONLY Mode](#gpt35-only-mode)
- [🖼 Image Generation](#image-generation)
- [📜 Conversation Summary Mode](#-conversation-summary-mode)
- [⚠️ Limitations](#️-limitations)
- [🛡 Disclaimer](#-disclaimer)
- [🐦 Connect with Us on Twitter](#-connect-with-us-on-twitter)
Expand Down Expand Up @@ -238,6 +239,18 @@ IMAGE_PROVIDER=sd
HUGGINGFACE_API_TOKEN="YOUR_HUGGINGFACE_API_TOKEN"
```

## 📜 Conversation Summary Mode
Conversation Summary mode is designed to provide users with concise summaries of the AI's responses during a conversation.
This mode can be especially useful for long conversations where it's crucial to quickly understand the key points without reading through the entire response.
It enhances readability and helps users grasp important information more efficiently.

How to Use Conversation Summary Mode:

1. Define `STEP_SUMMARIZATION_PROMPT` and `FINAL_SUMMARIZATION_PROMPT` in the .env file (you can play around with these prompts to get the best results)
2. Run: `python scripts/main.py --conversation-summary`
3. View step summaries in the console and a summary file inside `scripts/logs` folder
4. Upon exit, a final summary is printed to console and appended to the file

## ⚠️ Limitations
This experiment aims to showcase the potential of GPT-4 but comes with some limitations:

Expand Down
18 changes: 18 additions & 0 deletions scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(self):
self.debug_mode = False
self.continuous_mode = False
self.speak_mode = False
self.conversation_summary_mode = False

self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo")
self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4")
Expand Down Expand Up @@ -67,6 +68,20 @@ def __init__(self):
self.image_provider = os.getenv("IMAGE_PROVIDER")
self.huggingface_api_token = os.getenv("HUGGINGFACE_API_TOKEN")

# Conversation Summary Mode - Prompts to use when summarizing
self.step_summarization_prompt = os.getenv(
"STEP_SUMMARIZATION_PROMPT",
"outline the key steps and insights you plan to take "
"and gain during the completion of your task in a concise and relevant manner"
)
self.final_summarization_prompt = os.getenv(
"FINAL_SUMMARIZATION_PROMPT",
"Consolidate and distill the essential information from the provided summaries of individual steps to "
"create a concise and coherent summary of the overall process by creating an output structured using "
"chapters, sub-chapters and bullet points. Don't include duplicate ideas. Leave only one instance if it's "
"present in multiple steps:{}"
) # {} is replaced with the content

# User agent headers to use when browsing web
# Some websites might just completely deny request with an error code if no user agent was found.
self.user_agent_header = {"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"}
Expand All @@ -89,6 +104,9 @@ def set_speak_mode(self, value: bool):
"""Set the speak mode value."""
self.speak_mode = value

def set_conversation_summary_mode(self, value: bool):
self.conversation_summary_mode = value

def set_fast_llm_model(self, value: str):
"""Set the fast LLM model value."""
self.fast_llm_model = value
Expand Down
Empty file.
Loading