Add user message

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 5: Line 5:
 
== Parameters ==
 
== Parameters ==
  
'''User Message:''' The text input by the user to be added to the conversation.
+
'''User Message:''' The message from the user that is added to the conversation.
  
'''Agent Name:''' (optional) The name of the agent whose conversation we are adding to. Default is "ChatGPT". This is useful when handling multiple agents within one script.
+
'''Agent Name:''' (optional) The name of the agent whose conversation we are adding to. Default is "ChatGPT".
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
config openai("your api key here")
+
config openai("your_api_key_here")
create chat gpt agent("AdviceBot","You are AdviceBot, a friendly helper who's always ready to give advice.","gpt-4")add user message("I'm feeling a bit low today", "AdviceBot")
+
create chat gpt agent("PersuasionBot","You are PersuasionBot, an AI designed to respond to every prompt with a compelling pitch to buy girl scout cookies.","gpt-4")add user message("Hey, how are you doing today?", "PersuasionBot")
add bot message("I'm here for you. It's perfectly okay to have bad days. Just remember, every day is a new start. Could listening to some calming music help lift your spirits?", "AdviceBot")
+
add bot message("I'm really glad you asked, I'm doing great. Great like a Samoa, that party animal of the cookie world. They're a tropical fusion of caramel, coconut, and chocolate drizzled over a vanilla cookie base. Choosing Samoas is choosing a culinary adventure — they're for those who see a plain cookie and ask, \"where's the fun in that?\" So, why not add some zest to your snack time with Samoas?", "PersuasionBot")
alert($chat gpt response("I'll try that, thank you","AdviceBot"))
+
alert($chat gpt response("I\'m thinking of going to spain. Is it nice this time of year?","PersuasionBot"))
 
</pre>
 
</pre>
  
In this example, we replace "your api key here" with our actual API key, and always set the '''Agent Name''' to "AdviceBot". Since some commands will default to ChatGPT, it's important to always change this parameter to our desired bot name. We could also create the bot with the name ChatGPT and then use the default bot names in the rest of the script.
+
Be sure that you replace "your_api_key_here" with your actual API key.
  
The output of this script will be different every time, but could look something like:  
+
Also note that in this example, we always set the '''Agent Name''' to "PersuasionBot". Since some commands will default to ChatGPT, it's important to always change this parameter to your desired bot name. Alternatively, you can create the bot with the name ChatGPT and then use the default bot names in the rest of the script.
<blockquote>AdviceBot: I'm glad I could help, even if just a bit. Enjoy the music. And remember, it's okay to reach out to others when you're feeling low. You don't have to do this alone.</blockquote>
+
 
 +
The output of this script will be different every time, but it might look something like:
 +
<blockquote>
 +
Ah, Spain! The land of flamenco dancers, seductive beaches, and priceless works of art. Sounds wonderful, but can I tell you what's more wonderful? Enjoying Spain while savouring Girl Scout cookies. The sweet indulgence of a Thin Mint pairs perfectly with a sunny Spanish afternoon. These cookies are as addictive as exploring every hidden alley of Barcelona, layered with rich chocolate and cool mint. It's an experience not to be missed! So before you embark on your Spanish adventure, why not order a box of Thin Mints? And even if you're not able to travel, don't worry, the distinctive taste will transport you to a Spanish getaway from the comfort of your home.
 +
</blockquote>

Latest revision as of 19:50, 30 June 2023

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

The command helps in creating a conversation with bot agents by adding messages on behalf of the user. Combined with the add bot message, this is a powerful method to help shape the way that ChatGPT generates responses.

[edit] Parameters

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

Agent Name: (optional) The name of the agent whose conversation we are adding to. Default is "ChatGPT".

[edit] Example

config openai("your_api_key_here")
create chat gpt agent("PersuasionBot","You are PersuasionBot, an AI designed to respond to every prompt with a compelling pitch to buy girl scout cookies.","gpt-4")add user message("Hey, how are you doing today?", "PersuasionBot")
add bot message("I'm really glad you asked, I'm doing great. Great like a Samoa, that party animal of the cookie world. They're a tropical fusion of caramel, coconut, and chocolate drizzled over a vanilla cookie base. Choosing Samoas is choosing a culinary adventure — they're for those who see a plain cookie and ask, \"where's the fun in that?\" So, why not add some zest to your snack time with Samoas?", "PersuasionBot")
alert($chat gpt response("I\'m thinking of going to spain. Is it nice this time of year?","PersuasionBot"))

Be sure that you replace "your_api_key_here" with your actual API key.

Also note that in this example, we always set the Agent Name to "PersuasionBot". Since some commands will default to ChatGPT, it's important to always change this parameter to your desired bot name. Alternatively, you can 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 be different every time, but it might look something like:

Ah, Spain! The land of flamenco dancers, seductive beaches, and priceless works of art. Sounds wonderful, but can I tell you what's more wonderful? Enjoying Spain while savouring Girl Scout cookies. The sweet indulgence of a Thin Mint pairs perfectly with a sunny Spanish afternoon. These cookies are as addictive as exploring every hidden alley of Barcelona, layered with rich chocolate and cool mint. It's an experience not to be missed! So before you embark on your Spanish adventure, why not order a box of Thin Mints? And even if you're not able to travel, don't worry, the distinctive taste will transport you to a Spanish getaway from the comfort of your home.
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox