2
0

(openai) Add create speech OpenAI action

Closes #1025
This commit is contained in:
Baptiste Arnaud
2023-11-20 10:32:38 +01:00
parent f6ac3891f8
commit 1a44bf4935
23 changed files with 1772 additions and 74 deletions

View File

@ -1,7 +1,7 @@
import { YoutubeEmbed } from '../../../../src/js/YoutubeEmbed.jsx'
# OpenAI
## Create chat completion
With the OpenAI block, you can create a chat completion based on your user queries and display the answer back to your typebot.
<img
@ -25,6 +25,33 @@ Then you can give the OpenAI block access to this sequence of messages:
alt="OpenAI messages sequence"
/>
## Create speech
This action allows you to transform a text input into an audio URL that you can reuse in your bot.
<div
style={{
position: 'relative',
paddingBottom: '64.5933014354067%',
height: 0,
}}
>
<iframe
src="https://www.loom.com/embed/ccca6cbf16ed4d01b513836775db06a3?sid=22a54baa-000b-435a-b770-bfaf32bfe453"
frameBorder={0}
webkitallowfullscreen
mozallowfullscreen
allowFullScreen
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
}}
/>
</div>
## 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.

View File

@ -2996,6 +2996,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -6246,6 +6290,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -10332,6 +10420,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -14041,6 +14173,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -17901,6 +18077,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -21544,6 +21764,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -25275,6 +25539,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -29075,6 +29383,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -32797,6 +33149,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -36656,6 +37052,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -40266,6 +40706,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -44137,6 +44621,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -47816,6 +48344,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -51493,6 +52065,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -56665,6 +57281,18 @@
"schema": {
"type": "string"
}
},
{
"name": "type",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"gpt",
"tts"
]
}
}
],
"responses": {

View File

@ -2549,6 +2549,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -6144,6 +6188,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -13132,6 +13220,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -16727,6 +16859,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -29510,6 +29686,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}
@ -33105,6 +33325,50 @@
"responseMapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"baseUrl": {
"type": "string"
},
"apiVersion": {
"type": "string"
},
"task": {
"type": "string",
"enum": [
"Create speech"
]
},
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string",
"enum": [
"alloy",
"echo",
"fable",
"onyx",
"nova",
"shimmer"
]
},
"saveUrlInVariableId": {
"type": "string"
}
},
"required": [
"task"
],
"additionalProperties": false
}
]
}