Create chat gpt agent

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
The '''create chat gpt agent''' command creates a new GPT agent.
+
The '''create chat gpt agent''' command creates a new ChatGPT agent.
  
When creating a new GPT agent, you can specify the context, model, and agent name. The context sets the tone and behaviour for the agent, while the model specifies the qualitative aspects of how it generates responses.
+
You can think of an Agent as a conversation within a chatbot that it programmed to do a particular task. For example, you can tell an agent to be a business coach, and the Agent will keep track of the conversion within the context you give it.
  
 
== Parameters ==
 
== Parameters ==
  
'''Agent Name:''' This is the name that you give to the agent. You'll use this name to add messages to the agent's conversation. The default name is "ChatGPT".
+
'''Agent Name:''' This is the name that you give to the agent. You'll reference this name when adding messages to the conversation or generating responses. The default name is "ChatGPT".
  
'''Context:''' (optional) This is the initial conversational context that sets the tone and behaviour for the agent. The default context is "You are a helpful assistant." You can enter any text here that you would like the agent to remember and base its responses on.
+
'''Context:''' This is the initial conversational context that sets the tone and behavior for the agent. The default context is "You are a helpful assistant." You can enter any text here that you would like the agent to remember and base its responses on.
  
 
'''Model:''' The model determines the GPT version utilized to process commands and generate responses. You can choose from gpt-3.5-turbo or gpt-4. The default is gpt-3.5-turbo.
 
'''Model:''' The model determines the GPT version utilized to process commands and generate responses. You can choose from gpt-3.5-turbo or gpt-4. The default is gpt-3.5-turbo.
  
 
== Example ==
 
== Example ==
 +
 
<pre>
 
<pre>
config openai("your api key here")
+
config openai("your_api_key_here")
create chat gpt agent("FoodBot", "You are FoodBot, an AI designed to offer food and nutrition advice.", "gpt-4")
+
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 user message("What should I eat for dinner?", "FoodBot")
+
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("{message from user input}","FoodBot"))
+
alert($chat gpt response("I\'m thinking of going to spain. Is it nice this time of year?","PersuasionBot"))
 
</pre>
 
</pre>
  
As always, replace "your api key here" with your actual API key.
+
Be sure that you replace "your_api_key_here" with your actual API key.
  
This script first creates a GPT agent named "FoodBot" who is designed to offer food and nutrition advice, and then adds a user's message inquiring about dinner options. It then generates a response from the food bot to the user's input and alerts the user with the generated response.
+
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.
  
Agents can be very useful for setting up specific personas or roles, especially when it comes to consistency and maintaining context over several individual commands.
+
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 20:03, 30 June 2023

The create chat gpt agent command creates a new ChatGPT agent.

You can think of an Agent as a conversation within a chatbot that it programmed to do a particular task. For example, you can tell an agent to be a business coach, and the Agent will keep track of the conversion within the context you give it.

[edit] Parameters

Agent Name: This is the name that you give to the agent. You'll reference this name when adding messages to the conversation or generating responses. The default name is "ChatGPT".

Context: This is the initial conversational context that sets the tone and behavior for the agent. The default context is "You are a helpful assistant." You can enter any text here that you would like the agent to remember and base its responses on.

Model: The model determines the GPT version utilized to process commands and generate responses. You can choose from gpt-3.5-turbo or gpt-4. The default is gpt-3.5-turbo.

[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