Preliminary configuration of GPT bots is required.

GPT request

:icons:font :hardbreaks: :imagesdir: ../../../assets/images :toc-title: Contents :toc:

Description

Allows you to make a request to a connected GPT bot
Bots are connected in the 'ai/gpt/GPTBots' product layer collection or in the bot admin application. +\

Prompts are executed by the product layer of the current domain. +\

In case of an error, the transition is carried out along the “Error” branch, and the cause of the error is included in the corresponding variable.

Table 1. System characteristics

Index

156

Short name

gpt

Script types

All

Start module

era_script_component_gpt

Mode

Asynchronous

Icon

156

Branching type

Branching

Properties

Table 2. Properties
Specification Description

Name: Query mode

Code: mode

Visibility condition: no

Default: start

Defines the context in which the GPT request will be made.

Possible values:

  • Start dialog (start,0) - The request is executed without the previous context and generates a new dialog, the identifier of which is returned to the corresponding variable.

  • Continuation of the dialogue (continue,1) - The request is executed with the transfer of the previous context - a special identifier of the existing dialogue returned during the execution of the starting request is required.

Name: GPT Bot

Code: gptBot

Visibility condition: yes

Default: — 

Code of an existing bot (collection 'ai/gpt/GPTBots').

The bot is selected only in the Start request mode. When continuing, a dialogue is indicated that uses the same bot.

Name: Dialogue

Code: dialogIdx

Visibility condition: yes

Default: — 

Special identifier of an existing dialog, used in the mode of continuing the dialog with the transfer of the previous context.

Saved to a variable when executing a request in Start mode.

Name: Message Code: message Visibility condition: no

Default: — 

GPT request text.

When a dialogue starts, the first message sent to it is the prompt specified in the bot settings. Thus, it forms the initial context of the new dialogue.

Name: Timeout, sec

Code: timeoutSec

Visibility condition: no Default: 5

Argument defining the request execution timeout.

After the timeout expires, the script transfers control via the 'Transition, timeout' branch, and the request to GPT can continue to be executed.

Name: Dialog to variable

Code: dialogIdxVar

Visibility condition: yes

Default: — 

Variable where the special dialog identifier is saved. Available only for the 'Start' mode, which creates a new dialog without an initial context.

In the future, the resulting identifier can be used to continue executing requests within the same dialog while maintaining the previous context.

Name: GPT response to variable

Code: answerVar

Visibility condition: no

Default: — 

Variable where the text of the GPT response to the request is saved.

Name: Error in variable

Code: errorVar

Visibility condition: no

Default: — 

Variable where the string with the error code and text is saved.

Some expanded errors are saved to the log.

Name: Transition Code: transfer Visibility condition: no

Default: — 

Component to which control is transferred.

Name: Transition, time

Code: transferTimeout

Visibility condition: no

Default: — 

The component to which control is transferred in case of a timeout.

Name: Transition, error

Code: transferError

Visibility condition: no

Default: — 

Component to which control is transferred in case of an error.

See also