Add user message

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

Jump to: navigation, search

add user message command adds a user message to the conversation for a given agent.

This is used to interact with the bot agents by adding user messages to the conversation.

Parameters

User Message: The message from the user that is added to the conversation.

Agent Name: (optional) The name of the agent who the message is intended for. Default is "ChatGPT". This specifies which agent the user message will be sent to.

Example

config openai("your api key here")
create chat gpt agent("HelpfulBot","You are HelpfulBot, an AI designed to assist with any questions a user may have.","gpt-4")
add user message("I need help on a research project. Any tips?", "HelpfulBot")
alert($chat gpt response("Why not start with defining your research question clearly? It can help set the direction of your research.","HelpfulBot"))

Make sure you replace "your api key here" with your actual API key.

Also note that in this example, we always set the Agent Name to "HelpfulBot". Since some commands will default to ChatGPT, it's important to always change this parameter to your desired bot name. Alternatively, you should create the bot with the name ChatGPT 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: "Why not start with defining your research question clearly? It can help set the direction of your research."

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox