diff --git a/apps/builder/src/features/publish/components/PublishButton.tsx b/apps/builder/src/features/publish/components/PublishButton.tsx index cdb154fd8..19f60b80c 100644 --- a/apps/builder/src/features/publish/components/PublishButton.tsx +++ b/apps/builder/src/features/publish/components/PublishButton.tsx @@ -31,6 +31,7 @@ import { useToast } from '@/hooks/useToast' import { parseDefaultPublicId } from '../helpers/parseDefaultPublicId' import { InputBlockType } from '@typebot.io/schemas/features/blocks/inputs/constants' import { ConfirmModal } from '@/components/ConfirmModal' +import { TextLink } from '@/components/TextLink' type Props = ButtonProps & { isMoreMenuDisabled?: boolean @@ -138,7 +139,7 @@ export const PublishButton = ({ onClose={onClose} type={t('billing.limitMessage.fileInput')} /> - {publishedTypebotVersion !== typebot?.version && ( + {publishedTypebot && publishedTypebotVersion !== typebot?.version && ( + You are about to a deploy a version of your bot with an updated - engine. + engine. (Typebot V6). - Make sure to test it thoroughly in preview mode before - publishing. + Make sure to check out all the{' '} + + associated breaking changes + + + + {' '} + Then test, the bot thoroughly in preview mode before publishing. } diff --git a/apps/docs/docs/breaking-changes.md b/apps/docs/docs/breaking-changes.md new file mode 100644 index 000000000..80175e29e --- /dev/null +++ b/apps/docs/docs/breaking-changes.md @@ -0,0 +1,13 @@ +# Breaking changes + +## Typebot v6 + +- List variables now don't automatically display the last item when inserted into a bubble. It was too "magical". Now you can leverage the inline code feature to easily get the last element of a list: + + ``` + {{={{List var}}.at(-1)=}} + ``` + + Check out the new [Inline variable formatting section](./editor/variables) for more information. + +- Input prefill is now disabled by default. You can still enable it in the [Settings](./editor/settings) tab of your bot. diff --git a/apps/docs/docs/editor/blocks/integrations/openai.mdx b/apps/docs/docs/editor/blocks/integrations/openai.mdx index c694cdfb3..98da80689 100644 --- a/apps/docs/docs/editor/blocks/integrations/openai.mdx +++ b/apps/docs/docs/editor/blocks/integrations/openai.mdx @@ -10,19 +10,20 @@ With the OpenAI block, you can create a chat completion based on your user queri alt="OpenAI block" /> -This integration comes with a convenient message type called **Messages sequence ✨**. It allows you to directly pass a sequence of saved assistant / user messages: +This integration comes with a convenient message type called **Dialogue**. It allows you to easily pass a sequence of saved assistant / user messages history to OpenAI: OpenAI messages sequence -:::note -Under the hood, **Messages sequence ✨** will convert the provided variables into lists if it's not already the case. -::: +Then you can give the OpenAI block access to this sequence of messages: - +OpenAI messages sequence ## Using Multiple Open AI Blocks: Tips and Tricks @@ -62,8 +63,7 @@ I also demonstrate how formatting can be affected by the presence of text before It means your OpenAI block is not configured properly. Please check the following: - You have selected an OpenAI account -- You have at least 1 **user** message or a **Message sequence ✨**. -- If you have a **Message sequence ✨**, make sure your user messages variable contains at least 1 message. +- You have at least 1 **user** message or a **Dialogue** message set up. ### It returns an empty message diff --git a/apps/docs/docs/editor/variables.mdx b/apps/docs/docs/editor/variables.mdx index 450eb230a..3703aa059 100644 --- a/apps/docs/docs/editor/variables.mdx +++ b/apps/docs/docs/editor/variables.mdx @@ -10,6 +10,28 @@ You can tell your input step to save the answer into a variable and reuse then i Iframe preview +## Use variables + +Once your variables are declared you can use theme **anywhere** in your bot. For example you can display it in a text bubble with the following syntax: + +`{{My variable}}` where "My variable" is the name of your variable. + +## Inline variable formatting + +You can also decide to format your variable directly in the text bubble. For example if you want to display the variable "First name" in uppercase you can use the following syntax: + +`{{={{My variable}}.toUpperCase()=}}` + +When you insert `{{= ... =}}`, it means what's inside will be evaluated as JavaScript. So you can use any JavaScript inline function inside. The behavior is similar to the custom value in the Set variable block. + +If you would like to get the first item of a list: + +`{{={{My variable}}[0]=}}` or `{{={{My variable}}.at(0)=}}` + +Likewise for last item: + +`{{={{My variable}}.at(-1)=}}` + ## Advanced concepts Here is a quick video that showcases advanced concepts about variables: diff --git a/apps/docs/static/img/blocks/integrations/openai/append-to-history.png b/apps/docs/static/img/blocks/integrations/openai/append-to-history.png new file mode 100644 index 000000000..1b653410a Binary files /dev/null and b/apps/docs/static/img/blocks/integrations/openai/append-to-history.png differ diff --git a/apps/docs/static/img/blocks/integrations/openai/dialogue-usage.png b/apps/docs/static/img/blocks/integrations/openai/dialogue-usage.png new file mode 100644 index 000000000..39d8d278c Binary files /dev/null and b/apps/docs/static/img/blocks/integrations/openai/dialogue-usage.png differ