Chat gpt response

From UBot Studio
Revision as of 16:57, 30 June 2023 by LillyT (Talk | contribs)

Jump to: navigation, search

$chat gpt response function generates a response from the specified GPT Agent with the given prompt.

This function allows the GPT agent to produce a response based on the input prompt. It helps in creating a dynamic conversation between the GPT agent and the user.

Parameters

Input Prompt: The prompt is a piece of text that the GPT agent will generate a response to.

Agent Name: (optional) This is the name of the agent who will generate the response. The default is "ChatGPT". This specifies which agent will respond to the prompt.

Return Value

This function returns a string - the response generated by the GPT agent to the input prompt.

Example

config openai("your api key here")
create chat gpt agent("MotivationBot","You are MotivationBot, an AI designed to provide motivational insights.","gpt-4")
add user message("I find it hard to stay motivated, how can I improve this?", "MotivationBot")
alert($chat gpt response("Remember that motivation comes from within. Start with small daily goals and celebrate your achievements!", "MotivationBot"))

Do remember to replace "your api key here" with your actual API key.

Also note that in this example, we always set the Agent Name to "MotivationBot". Since some commands will default to ChatGPT, it's important to always change this parameter to your desired bot name. Alternatively, you can name the bot as ChatGPT during creation and then use the default bot names in the rest of the script.

The output of this script will vary each time it is run, but it might say something like: "Remember that motivation comes from within. Start with small daily goals and celebrate your achievements!"

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox