Having trouble summarizing phone calls

Hey all! I’m having some issues sending the correct prompt to /chat/completions. My use case is the following:

  1. A phone call happens, this phone call produces an audio file.
  2. I send the phone call to whisper-1 to have it transcribed.
  3. I send the transcription to ChatGPT to have it summarized. I have some wishes though:
  • The language of the summary should be the language spoken in the phone call. If the phone call is in Dutch, the summary should be written in Dutch.
  • The summary should start with: This phone call was about… (Also should be translated to the phone call language)
  • The summary should be in 3rd person, without mentioning any specific names.
  1. I append the summary to my app.

I have some issues with step 3, this is my current code:

  let prompt_summary = "Please summarize the following phone call " + transcription;
      let prompt_start_with = "Start the summary with: This phone call was about... "
      let prompt_no_names = "Write the summary in 3rd person and dont mention any specific names. "
      let prompt_translate =
      "Please write the summary in the language that is spoken in the phone call. Make sure the summary is in professional and correct language";
      
        // Perform the summarization via Ajax call
      $.ajax({
        url: "https://api.openai.com/v1/chat/completions",
        type: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${apiKey}`,
        },
        data: JSON.stringify({
          model: "gpt-3.5-turbo",
          messages: [
            {
              role: "system",
              content: prompt_summary,
            },
            {
              role: "user",
              content: prompt_start_with,
            },
            {
              role: "user",
              content: prompt_no_names,
            },
            {
              role: "user",
              content: prompt_translate,
            }
          ],
          temperature: 0.6,
        }),

My issue is that it ignores most of my prompts, the summary is always in english, and names are always mentioned. Does anybody have any tips?

Recently it seems to be dropping instructions if they are several conversations ago. Maybe you could instead merge all of it into a single user message? prompt_summary also seems like it fits better as a user message.

Seems like a plan. Will try this and keep you updated :slight_smile:

1 Like

my suggestion is insert another procedure prior to step 3. send the conversation in a dedicated api call to detect the language. then use the result in step 3 adding the result language in the system prompt.

1 Like

Agree. One of the smaller models should be able to do it cheap/quick with a one or two-shot for formatting…

1 Like