Chat gpt response

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

Jump to: navigation, search

$chat gpt response is a function that generates a response from the specified GPT Agent with the given prompt.

This function will keep track of the ongoing conversation, so that every response will contain the full context of what was said before.

Parameters

Input Prompt: The prompt is a piece of text that the GPT agent will generate a response to.

Agent Name: (optional) This is the name of the agent who will generate the response. The default is "ChatGPT".

Return Value

This function returns a string - the response generated by the GPT agent to the input prompt.

Example

ui console view
config openai("your api key here")
set(#first prompt,"Hey, I have some questions about tacos. Can I ask them?","Local")
log("User: {#first prompt}")
log("ChatGPT: {$chat gpt response(#first prompt,"ChatGPT")}")
set(#second prompt,"What\'s the best salsa to use?","Local")
log("User: {#second prompt}")
log("ChatGPT: {$chat gpt response(#second prompt,"ChatGPT")}")

Do remember to replace "your api key here" with your actual API key.

The output of this script will vary each time it is run, but it might look something like:

User: Hey, I have some questions about tacos. Can I ask them? ChatGPT: Of course! I'd be happy to answer any questions you have about tacos. What would you like to know? User: What's the best salsa to use? ChatGPT: The best salsa for tacos is a matter of personal preference and can vary depending on the type of tacos you are making. Here are some popular options: 1. Salsa Roja: This is a classic red salsa made with tomatoes, onions, garlic, and chili peppers. It's medium to hot in spice level and pairs well with a variety of tacos. 2. Salsa Verde: Made with tomatillos, green chili peppers, onions, and cilantro, this tangy and slightly spicy salsa is perfect for adding a vibrant and fresh flavor to your tacos. 3. Pico de Gallo: Also known as salsa fresca, pico de gallo is a chunky salsa made with diced tomatoes, onions, cilantro, jalapeños, and lime juice. It adds a crisp texture and a bright, tangy flavor to your tacos. 4. Chipotle Salsa: If you like smoky and spicy flavors, chipotle salsa is a great choice. It's made with chipotle peppers, tomatoes, onions, garlic, and spices, and adds a smoky kick to your tacos. Ultimately, the best salsa is the one that complements the flavors in your tacos and suits your taste preferences. Feel free to experiment with different salsas to find your favorite combination!
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox