> For the complete documentation index, see [llms.txt](https://scade.gitbook.io/scade-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scade.gitbook.io/scade-knowledge-base/flow-examples/5-minute-challenge-summarize-audio.md).

# 5 minute challenge: summarize audio

This guide will show you how to swiftly build from scratch a workflow that transcribes and summarizes audio recordings

1. Go to <https://app.scade.pro/flow/> and click the **New flow** button and then choose **Start with blank**

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FEHJIWVlezmQzPLGoJGZo%2FScreenshot%202024-03-27%20at%2007.07.21.png?alt=media&amp;token=5a6733f4-8787-4348-97ff-cb9e1bc9dc3d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F2AoGRgwxbFPIMeGScXs5%2FScreenshot%202024-03-27%20at%2007.07.35.png?alt=media&amp;token=870b7b89-c754-4fce-aa5e-c1df12856556" alt=""><figcaption></figcaption></figure>

2. There will already be **Start** end **End** nodes on the canvas. Place everything else between them.\
   \
   Go to the **Settings** of the **Start Node Form** and click **Configure fields** to start adding your data

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FLQ0PTAIkoCyRdUopQMDa%2FScreenshot%202024-03-27%20at%2007.07.52.png?alt=media&amp;token=6139e8ae-b265-4078-8df2-c6f94af87901" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FAwY1O6hlau2Jw1EdMCV3%2FScreenshot%202024-03-27%20at%2007.08.08.png?alt=media&amp;token=53c2a0e6-fe2c-42d2-8681-da62b217f730" alt=""><figcaption></figcaption></figure>

3. Add one field, call it, for example, `audio`, and change the input type to `String/URI` to make it suitable for storing files. Click **Save**

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FIreGJQBfmdFvSqBG8Wtw%2FScreenshot%202024-03-27%20at%2007.08.31.png?alt=media&amp;token=9d731c22-71b2-43de-a959-ff5f648a1ed1" alt=""><figcaption></figcaption></figure>

4. You can upload the audio file from your computer or, alternatively, use the **Set url** button if you have a link to the file. \
   \
   We'll use Carl Sagan's "The pale blue dot" speech as an example file. Here's the link: <https://tile.loc.gov/storage-services/media/ls/sagan/1958124-3-1.mp3>

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FHWOoaKVXdYOcSfdHufAL%2FScreenshot%202024-03-27%20at%2007.08.55.png?alt=media&amp;token=dfeaea9d-9531-4179-82a0-d956aeccb59d" alt=""><figcaption></figcaption></figure>

5. Hit the **Execute** button and then click **Save and execute** to run this node and generate the output. We need it to move further.

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FkEe79g88Nl9yh39Vm6RW%2FScreenshot%202024-03-27%20at%2007.09.14.png?alt=media&amp;token=262a520d-36ff-4e07-9e3e-25d40d37c9df" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FLshMmhxPrewQTa3gasnw%2FScreenshot%202024-03-27%20at%2007.09.24.png?alt=media&amp;token=b79ae68c-dc10-49b4-87a3-bcb09162ded0" alt=""><figcaption></figcaption></figure>

6. Use the search panel on the left to find a processor that transcribes audio. If you already know the name of your desired processor, type it. Alternatively, you can type what you want to do — like `audio to text` there and pick by the name and description.\
   \
   **whisperx-a40-large** looks promising, drag it to the canvas

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FwsZX4p2aQsbM65x6EvYW%2FScreenshot%202024-03-27%20at%2007.10.23.png?alt=media&amp;token=e44ea521-2657-4bf8-9bf2-12b396ed5c71" alt=""><figcaption></figcaption></figure>

7. Connect the `audio` output of the **Start** node with the input of the **whisperx** node and click the **Execute** button on the latter. It will take a while to transcribe an audio file

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FRsnw1MGCLDDlevPcDSmz%2FScreenshot%202024-03-27%20at%2007.10.51.png?alt=media&amp;token=dc7e0c8d-7712-4f94-a860-a5841721e727" alt=""><figcaption></figcaption></figure>

8. Drag the **ChatGPT** processor to your canvas, connect the output of the **whisperx** with the **ChatGPT's** input and go to the settings of the latter. Review the instructions in paragraphs 6-8 if needed. You can move your nodes around whatever you like to create a convinient workspace

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F98I45KqU5ghEM7dTSncC%2FScreenshot%202024-03-27%20at%2007.12.27.png?alt=media&amp;token=079c8734-a255-4d8d-949a-a2920ec8b482" alt=""><figcaption></figcaption></figure>

&#x20;

Locate the **Messages** section in the settings and click the pencil to add instructions for the **ChatGPT**

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F9U6AfYr7rHETGeStZWhf%2FScreenshot%202024-03-27%20at%2007.15.32.png?alt=media&amp;token=957efbd4-4b28-4abc-853c-0b96296f2751" alt=""><figcaption></figcaption></figure>

9. Click **Add message**. \
   \
   Change the type of the message to `System` as recommended by OpenAI to emphasize that it's a high-level instruction and to guide the model's behaviour

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FtUpAwSTLx5sgTTBL6Bii%2FScreenshot%202024-03-27%20at%2007.15.49.png?alt=media&amp;token=9d86f930-76fe-41e9-8a3e-c578ba78c4ac" alt=""><figcaption></figcaption></figure>

The prompt here is rather straightforward: `summarize a following audio transcript`

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FOTXohcW7wkcSSuoIpenk%2FScreenshot%202024-03-27%20at%2007.18.25.png?alt=media&amp;token=0791d038-9b81-45a0-90f6-5354271c08d2" alt=""><figcaption></figcaption></figure>

10. Add another message and click the **#** symbol. The **Expression editor** will open. In case of the **ChatGPT** node we need it to get data from other nodes

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FlPvd4KSNUyCCsOjtjsfn%2FScreenshot%202024-03-27%20at%2007.18.37.png?alt=media&amp;token=61b54da3-0234-4aad-b9e0-c5cefd48cfb8" alt=""><figcaption></figcaption></figure>

There is a list of the nodes on the left. Click on the **whisprex-a40-large** to see its output data. Keep going until you end up with `segments` — that's where the transcription is stored.\
\
Drag the `segments` to the expression field

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F2de83gddnTZgMmNqlzYs%2FScreenshot%202024-03-27%20at%2007.19.08.png?alt=media&amp;token=d46ab25b-5024-4c6c-b29b-0deb252d2d7a" alt=""><figcaption></figcaption></figure>

The result should look similar to this. Don't forget to click the **Save** buttons in the **Expression editor** and before closing the node settings.

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F8RDYgOvIfNakYCR8Jdl1%2FScreenshot%202024-03-27%20at%2007.19.22.png?alt=media&amp;token=f43d2651-5385-4da1-9fe3-1a3333c62fef" alt=""><figcaption></figcaption></figure>

Click the **Execute** button on the **ChatGPT** node after you set everything

11. In principle, you are good to go now: the **ChatGPT** node generates summary, and you can copy and use it. But let's do some housekeeping to make sure that this workflow will be reusable and suitable to API integrations.\
    \
    Open settings of the **End Node Form**

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FHKi7wtPHz6BCmUqxXIzi%2FScreenshot%202024-03-27%20at%2007.19.23.png?alt=media&amp;token=a28c8aa6-1ce3-4191-bf38-e7c1355657b2" alt=""><figcaption></figcaption></figure>

Add a field and name it, there's no need to change the field type now

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2Fl6KXewJcKgdghTyC6zfd%2FScreenshot%202024-03-27%20at%2007.19.49.png?alt=media&amp;token=aea09777-5745-423f-8b2b-9a3bdf62b6dd" alt=""><figcaption></figcaption></figure>

Connect the `success` output of the **ChatGPT** node with the newly generated input of the **End** node and execute the **End** node

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FOKtk2EWnam4bBizxOcYs%2FScreenshot%202024-03-27%20at%2007.20.12.png?alt=media&amp;token=48443ffa-bac9-4357-a3e5-d127ed2caf76" alt=""><figcaption></figcaption></figure>

12. Now you have your result in the **End** node. Why it's important? We'll cover this later\
    \
    If you hover the text you'll see the button to copy and take it elsewhere

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FkPkuBgnO86Nvcaf2wneN%2FScreenshot%202024-03-27%20at%2007.21.01.png?alt=media&amp;token=dc7ca96c-c373-46f8-a3ea-9d028d1ba124" alt=""><figcaption></figcaption></figure>

13. Once you have the workflow built, there's no need to run nodes one by one anymore. Simply change the file in the **Start** node and use the **Play** button on the top panel to launch the entire workflow.

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FGg2gIPhSp3zAhz1c8Dkf%2FScreenshot%202024-03-27%20at%2007.21.02.png?alt=media&amp;token=b4818fc5-4182-4c57-87bb-b01ed5b94e0d" alt=""><figcaption></figcaption></figure>

14. And one last thing. It's a good idea to give your workflow a comprehensive name.\
    \
    Locate the **cog** in the top bar, fill in the suitable **Flow name** and click **Submit**

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FFtbwriCQhXCbuXt4uKLE%2FScreenshot%202024-03-27%20at%2007.23.56.png?alt=media&amp;token=e96b8cf1-e326-46a3-b9ec-cf4de5b6625c" alt=""><figcaption></figcaption></figure>
