Skip to content

Commit

Permalink
📝 Add docs for audio clips and update audio chat gpt template
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Aug 21, 2024
1 parent 72517a1 commit 503060c
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 26 deletions.
97 changes: 71 additions & 26 deletions apps/builder/public/templates/audio-chat-gpt.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"version": "6",
"id": "clpntvmje00031aboan4plzzx",
"id": "cm03xmv9a000ioksx75vxmzas",
"name": "Audio ChatGPT",
"events": [
{
"id": "ewnfbo0exlu7ihfu2lu2lusm",
"outgoingEdgeId": "f2hmh9jelbqb889l6lx5e1u5",
"outgoingEdgeId": "f7s54kawqbiqr0gf17h62gbk",
"graphCoordinates": { "x": -228.25, "y": -123.31 },
"type": "start"
}
Expand All @@ -19,25 +19,59 @@
{
"id": "ovgk70u0kfxrbtz9dy4e040o",
"type": "text input",
"options": { "variableId": "vudksu3zyrat6s1bq6qne0rx3" }
"options": {
"variableId": "vudksu3zyrat6s1bq6qne0rx3",
"audioClip": {
"isEnabled": true,
"saveVariableId": "vwtuc6cw30xzl9i18usgxbszc"
}
}
},
{
"id": "m4jadtknjb3za3gvxj1xdn1k",
"outgoingEdgeId": "fpj0xacppqd1s5slyljzhzc9",
"type": "Set variable",
"id": "riqtiysqklu64fiw8f3sspx4",
"type": "Condition",
"items": [
{
"id": "s2v8eax93tjvwlfrrt89a60c",
"outgoingEdgeId": "zhff5l5hsh1yl2v9n0f88fsx",
"content": {
"comparisons": [
{
"id": "p18se3e9hy6w8r58p51cmafu",
"variableId": "vwtuc6cw30xzl9i18usgxbszc",
"comparisonOperator": "Is empty"
}
]
}
}
]
},
{
"id": "h1la4o375pyat199ix02bqel",
"outgoingEdgeId": "vzvx2pyhsz00plwxemavzfol",
"type": "openai",
"options": {
"variableId": "vabkycu0qqff5d6ar2ama16pf",
"type": "Append value(s)",
"item": "{{User Message}}"
"action": "Create transcription",
"url": "{{Audio clip}}",
"transcriptionVariableId": "vudksu3zyrat6s1bq6qne0rx3"
}
}
]
},
{
"id": "a6ymhjwtkqwp8t127plz8qmk",
"title": "ChatGPT reply",
"graphCoordinates": { "x": 445.12, "y": -56.2 },
"graphCoordinates": { "x": 475.42, "y": -56.66 },
"blocks": [
{
"id": "m4jadtknjb3za3gvxj1xdn1k",
"type": "Set variable",
"options": {
"variableId": "vabkycu0qqff5d6ar2ama16pf",
"type": "Append value(s)",
"item": "{{User Message}}"
}
},
{
"id": "e57nnbkl97h49jaaslxkg3u0",
"type": "openai",
Expand All @@ -49,7 +83,6 @@
"dialogueVariableId": "vabkycu0qqff5d6ar2ama16pf"
}
],
"credentialsId": "clpjnjrbt00051aliw6610w1z",
"responseMapping": [
{
"item": "Message content",
Expand All @@ -71,10 +104,9 @@
"id": "av59rg9zeqtl73o8icnrr2xd",
"type": "openai",
"options": {
"action": "Create speech",
"input": "{{Assistant Message}}",
"voice": "alloy",
"action": "Create speech",
"credentialsId": "clpjnjrbt00051aliw6610w1z",
"saveUrlInVariableId": "vgr0iwg95npp7pztkmdyn89m1"
}
},
Expand All @@ -95,10 +127,9 @@
"id": "yuiyeh0czhpymzwuzrm3af5r",
"type": "openai",
"options": {
"action": "Create speech",
"input": "Hi there! How can I help?",
"voice": "alloy",
"action": "Create speech",
"credentialsId": "clpjnjrbt00051aliw6610w1z",
"saveUrlInVariableId": "vxw4quja426402hvhtm33tsp3"
}
},
Expand Down Expand Up @@ -155,11 +186,6 @@
}
],
"edges": [
{
"id": "fpj0xacppqd1s5slyljzhzc9",
"from": { "blockId": "m4jadtknjb3za3gvxj1xdn1k" },
"to": { "groupId": "a6ymhjwtkqwp8t127plz8qmk" }
},
{
"id": "xnao10ucc1hbynv3pmk1t4by",
"from": { "blockId": "dmab8kc35uh84vvw1a53xbjn" },
Expand All @@ -170,13 +196,31 @@
"from": { "blockId": "f6onszqys2tx7pw3tshb2vcy" },
"to": { "groupId": "qfrz5nwm63g12dajsjxothb5" }
},
{
"id": "zhff5l5hsh1yl2v9n0f88fsx",
"from": {
"blockId": "riqtiysqklu64fiw8f3sspx4",
"itemId": "s2v8eax93tjvwlfrrt89a60c"
},
"to": { "groupId": "a6ymhjwtkqwp8t127plz8qmk" }
},
{
"id": "vzvx2pyhsz00plwxemavzfol",
"from": { "blockId": "h1la4o375pyat199ix02bqel" },
"to": { "groupId": "a6ymhjwtkqwp8t127plz8qmk" }
},
{
"from": { "eventId": "ewnfbo0exlu7ihfu2lu2lusm" },
"to": { "groupId": "yswu9fml4zflxaqlujb94ir8" },
"id": "f2hmh9jelbqb889l6lx5e1u5"
"id": "f7s54kawqbiqr0gf17h62gbk"
}
],
"variables": [
{
"id": "vwtuc6cw30xzl9i18usgxbszc",
"name": "Audio clip",
"isSessionVariable": true
},
{
"id": "vni6kwbch8zlq92dclgcivzyr",
"name": "Assistant Message",
Expand All @@ -185,7 +229,7 @@
{
"id": "vudksu3zyrat6s1bq6qne0rx3",
"name": "User Message",
"isSessionVariable": true
"isSessionVariable": false
},
{
"id": "vabkycu0qqff5d6ar2ama16pf",
Expand All @@ -206,15 +250,16 @@
"theme": {},
"selectedThemeTemplateId": null,
"settings": {},
"createdAt": "2023-12-02T09:05:10.874Z",
"updatedAt": "2023-12-02T09:08:20.451Z",
"createdAt": "2024-08-21T14:11:42.911Z",
"updatedAt": "2024-08-21T14:14:06.661Z",
"icon": "🔈",
"folderId": null,
"publicId": null,
"customDomain": null,
"workspaceId": "proWorkspace",
"workspaceId": "cl35yesle00188gcpgqu70ia1",
"resultsTablePreferences": null,
"isArchived": false,
"isClosed": false,
"whatsAppCredentialsId": null
"whatsAppCredentialsId": null,
"riskLevel": null
}
10 changes: 10 additions & 0 deletions apps/docs/editor/blocks/inputs/text.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ You can also ask your user for a longer text answer by enabling it in the input
/>
</Tab>
</Tabs>

## Allow attachments

This option, when enabled, allows users to attach files to their message. This is useful when you want to ask for a document or a picture attached to the user messages.

The generated URL will be stored in the defined variable.

## Allow audio clips

This option, if enabled, displays a microphone button when the text input is empty. This allows users to record a voice message and send it to the bot.
4 changes: 4 additions & 0 deletions apps/docs/editor/blocks/integrations/openai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ The generated audio URLs are temporary and expire after 7 days. If you need to s

<LoomVideo id="ccca6cbf16ed4d01b513836775db06a3" />

## Create transcription

This action allows you to transcribe a audio URL into text.

## Using Multiple Open AI Blocks: Tips and Tricks

In this video, I discuss some important things to keep in mind when using multiple Open AI blocks consecutively. I provide an example where we ask the user for a topic, generate a summary, and display a list of authors.
Expand Down

0 comments on commit 503060c

Please sign in to comment.