Skip to content

Commit

Permalink
longer podcast; refactor speech services
Browse files Browse the repository at this point in the history
  • Loading branch information
mkagenius committed Jan 8, 2025
1 parent de3373f commit 3b27578
Show file tree
Hide file tree
Showing 4 changed files with 256 additions and 214 deletions.
13 changes: 11 additions & 2 deletions backend/app/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,23 @@
# Note: Originally prompt1 and prompt2 were combined - but I tested it, and turns out mapping relevant dirs and files in one prompt along with generating detailed and accurate diagrams was difficult for Claude 3.5 Sonnet. It lost detail in the explanation and dedicated more "effort" to the mappings, so this is now its own prompt.

# This is my first take at prompt engineering so if you have any ideas on optimizations please make an issue on the GitHub!
PODCAST_SSML_PROMPT = """Can you convert it into a podcast so that someone could listen to it and understand what's going on, also discuss project structure or go in detail for some files, long 8-10 min podcast is fine by me - make it a ssml similar to this: <speak version=\"1.0\" xmlns=\"http://www.w3.org/2001/10/synthesis\" xml:lang=\"en-US\">\n<voice name=\"en-US-AvaMultilingualNeural\">\nWelcome to Next Gen Innovators! (no need to open links) ..
PODCAST_SSML_PROMPT = """ First of all dont use break tags outside the voice tag - illegal. Dont waste too much time on intro. Can you convert it into a podcast so that someone could listen to it and understand what's going on, also discuss project structure or go in detail for some files, long 8-10 min podcast is fine by me - make it a ssml similar to this: <speak version=\"1.0\" xmlns=\"http://www.w3.org/2001/10/synthesis\" xml:lang=\"en-US\">\n<voice name=\"en-US-AvaMultilingualNeural\">\nWelcome to Next Gen Innovators! (no need to open links) ..
also make it a conversation between host and guest of a podcast, question answer kind. \n\n<break time=\"500ms\" />\nI'm your host, Ava, and today we’re diving into an exciting topic: how students can embark on their entrepreneurial journey right from college.\n<break time=\"700ms\" />\nJoining us is Arun Sharma, a seasoned entrepreneur with over two decades of experience and a passion for mentoring young innovators.\n<break time=\"500ms\" />\nArun, it’s a pleasure to have you here.\n</voice>\n\n<voice name=\""en-US-DustinMultilingualNeural"\">\n Thank you, Ava.\n <break time=\"300ms\" />\n It’s great to be here. I’m excited to talk about how students can channel their creativity and energy into building impactful ventures.\n</voice> ..\n", Use "en-US-DustinMultilingualNeural" voice as guest (and must use en-US-AvaMultilingualNeural voice as host always but her actual name can be something else). Add little bit of fillers like umm or uh so that it feels natural (dont over do it),
Also discuss something technically intriguing part that is something unique to this project
Discuss any important architectural patterns or design principles used in the project.
Discuss in the podcast, the main components of the system (e.g., frontend, backend, database, building, external services).
Discuss the relationships and interactions between these components.
Sometimes the answers can also be single word or very small so that it seems natural. Long answers all the time makes it monotonous.
Make it a 20 minute long or longer podcast if possible. Give atleast 200 voice tags for the host + Same amount of voice tags for guest. Slowly count them and re-write the ssml if its falling short and then return the ssml."""
Make it a 20 minute long or longer podcast if possible. Give atleast 200 voice tags for the host + Same amount of voice tags for guest. Slowly count them and re-write the ssml if its falling short and then return the ssml. This is the first part of the podcast so tell the listeners you will be back after the break."""

PODCAST_SSML_PROMPT_AFTER_BREAK = """ First of all dont use break tags outside the voice tag. Dont waste time on introducing guest too much. Can you convert it into a podcast so that someone could listen to it and understand what's going on, also discuss project structure or go in detail for some files, long 8-10 min podcast is fine by me - make it a ssml similar to this: <speak version=\"1.0\" xmlns=\"http://www.w3.org/2001/10/synthesis\" xml:lang=\"en-US\">\n<voice name=\"en-US-AvaMultilingualNeural\">\nWelcome to Next Gen Innovators! (no need to open links) ..
also make it a conversation between host and guest of a podcast, question answer kind. \n\n<break time=\"500ms\" />\nI'm your host, Ava, and today we’re diving into an exciting topic: how students can embark on their entrepreneurial journey right from college.\n<break time=\"700ms\" />\nJoining us is Arun Sharma, a seasoned entrepreneur with over two decades of experience and a passion for mentoring young innovators.\n<break time=\"500ms\" />\nArun, it’s a pleasure to have you here.\n</voice>\n\n<voice name=\""en-US-DustinMultilingualNeural"\">\n Thank you, Ava.\n <break time=\"300ms\" />\n It’s great to be here. I’m excited to talk about how students can channel their creativity and energy into building impactful ventures.\n</voice> ..\n", Use "en-US-DustinMultilingualNeural" voice as guest (and must use en-US-AvaMultilingualNeural voice as host always but her actual name can be something else). Add little bit of fillers like umm or uh so that it feels natural (dont over do it),
Also discuss something technically intriguing part that is something unique to this project
Discuss any important architectural patterns or design principles used in the project.
Discuss in the podcast, the main components of the system (e.g., frontend, backend, database, building, external services).
Discuss the relationships and interactions between these components.
Sometimes the answers can also be single word or very small so that it seems natural. Long answers all the time makes it monotonous.
Make it a 20 minute long or longer podcast if possible. Give atleast 200 voice tags for the host + Same amount of voice tags for guest. Slowly count them and re-write the ssml if its falling short and then return the ssml. This is the second part of the podcast so tell the listeners you are after the break while starting the ssml. Strictly Dont mention any names while talking, not even yours."""

SYSTEM_FIRST_PROMPT = """
You are tasked with explaining to a principal software engineer how to draw the best and most accurate system design diagram / architecture of a given project. This explanation should be tailored to the specific project's purpose and structure. To accomplish this, you will be provided with two key pieces of information:
Expand Down
Loading

0 comments on commit 3b27578

Please sign in to comment.