Add user message

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
The '''add user message''' command is used to add a user message into the conversation for a given agent. After the message is added, the agent can respond accordingly.
+
'''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 ==
 
== Parameters ==
  
'''User Message:''' This is the user's message that you want to add to the conversation.
+
'''User Message:''' The message from the user that is added to the conversation.
  
'''Agent Name:''' This refers to the name of the agent where the user's message will be added. The default agent is ChatGPT.
+
'''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.  
 
+
== Usage ==
+
  
 +
== Example ==
 
<pre>
 
<pre>
add user message("Hello, how are you?", "ChatGPT")
+
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"))
 
</pre>
 
</pre>
  
In this example, the user message "Hello, how are you?" is added to the agent named "ChatGPT". The agent can then respond to this message as specified in its algorithm.
+
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."

Revision as of 16:56, 30 June 2023

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