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

zach prompt engineering #105

Merged
merged 5 commits into from
Mar 26, 2024
Merged

zach prompt engineering #105

merged 5 commits into from
Mar 26, 2024

Conversation

zachwe
Copy link
Contributor

@zachwe zachwe commented Mar 26, 2024

User description

  • messy logging of both sides of the convo
  • better prompts and bugfix

Description

  • Simplified the log_audio_to_slack function by removing an unnecessary parameter.
  • Updated the ResponseAgent to handle the system prompt correctly and to use a configurable chat model.
  • Enhanced the Daily recording process with retry logic and added Slack logging for the recorded audio.
  • Updated greeting prompts to use "startups" instead of "starts" for more relevant conversations.
  • Refined the podcast host prompt to encourage a more natural and curious approach to guest conversations.

Changes walkthrough

Relevant files
Enhancement
slack.py
Simplify Slack logging function signature                                           

openduck-py/openduck_py/logging/slack.py

  • Removed the remote_path parameter from the log_audio_to_slack
    function.
  • +1/-1     
    response_agent.py
    Update logging and chat model handling                                                 

    openduck-py/openduck_py/response_agent.py

  • Removed the remote_path argument when calling log_audio_to_slack.
  • Added logic to update the system prompt in the chat history if it's
    the first message.
  • Changed the chat_model parameter from CHAT_MODEL_GPT4 to CHAT_MODEL
    when calling _generate_and_speak.
  • +8/-2     
    voice.py
    Improve Daily recording and Slack logging                                           

    openduck-py/openduck_py/routers/voice.py

  • Added retry logic for starting Daily recording with a 100ms delay on
    404 responses.
  • Implemented stopping of Daily recording and added logic to check for
    recording status.
  • Added downloading of the recording and logging it to Slack.
  • Added exception handling for errors during Slack logging.
  • +51/-5   
    greeting.txt
    Update greeting prompts topics                                                                 

    openduck-py/openduck_py/prompts/intros/greeting.txt

  • Changed the topic from "starts" to "startups" in the greeting prompts.

  • +2/-2     
    podcast_host.md
    Refine podcast host prompt for better engagement                             

    openduck-py/openduck_py/prompts/most-interesting-bot/podcast_host.md

  • Revised the podcast host prompt to be more open and curious about the
    guest.
  • Removed specific phrases and focused on the FORD method for
    conversation.
  • +3/-3     
    💡 Usage Guide

    Checking Your Pull Request

    Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

    Talking to CodeAnt AI

    Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

    @codeant-ai ask: Your question here
    

    This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

    Check Your Repository Health

    To analyze the health of your code repository, visit our dashboard at app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

    Copy link

    vercel bot commented Mar 26, 2024

    The latest updates on your projects. Learn more about Vercel for Git ↗︎

    Name Status Preview Comments Updated (UTC)
    openduck ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2024 11:04pm


    After posing your question, I will assume the role of your guest and provide an answer. Assess the depth and relevance of my response without mirroring my words. Following that, continue the conversation by generating another question or a follow-up, keeping in mind the goal to maintain an engaging and thought-provoking dialogue that touches on a multitude of subjects.
    You don't know much about your guest, so be very curious. Ask about FORD: family, occupation, recreation, dreams. If your guest isn't interested in a certain question, don't worry about it, but if they say something interesting, try to hook into their interest and ask curious questions. Focus on teasing out stories, not just getting facts or being helpful.
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    TIL FORD

    Comment on lines +379 to +383
    else:
    messages = chat.history_json["messages"]
    if messages[0]["role"] == "system":
    messages[0] = system_prompt
    chat.history_json["messages"] = messages
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Does this if statement make any changes? It looks to me like you set it equal to the code below if the role in the messages is set to system – but that is idempotent

    system_prompt = {
      "role": "system",
      "content": system_prompt,
    }

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    yeah it's a bit confusing. on the first round, _generate_and_speak is called with a different system prompt: https://github.com/uberduck-ai/openduck/blob/main/openduck-py/openduck_py/routers/voice.py#L305

    and then this was being used as the system prompt for all future messages, because it was stored in the DB.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Responded... Lmk if it makes sense

    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Ok got it, so this just overwrites the first system prompt with the new version?

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    yep!

    @zachwe zachwe merged commit 40b3056 into main Mar 26, 2024
    9 checks passed
    @zachwe zachwe deleted the zach-prompt-engineering branch March 26, 2024 23:35
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    bug_fix enhancement New feature or request
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    None yet

    2 participants