Add user message
Line 1: | Line 1: | ||
− | + | '''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:''' | + | '''User Message:''' The message from the user that is added to the conversation. |
− | '''Agent Name:''' | + | '''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 == | ||
<pre> | <pre> | ||
− | add user message(" | + | 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> | ||
− | + | 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."