Gpt response

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''$get gpt response''' is a function used to get an OpenAI GPT-3 response to a given prompt. This function allows you to generate AI responses for a specified prompt and an ...")
 
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
'''$get gpt response''' is a function used to get an OpenAI GPT-3 response to a given prompt.
+
'''$get gpt3 response''' is a function that gets a response from the OpenAI GPT-3 model for a given prompt.
  
This function allows you to generate AI responses for a specified prompt and an example.
+
By using this function, you can directly send a well-crafted prompt or a query to GPT-3 and receive a response. This function is particularly useful when you want GPT-3 to generate or complete text, answer questions, or perform any task it's trained for given a specific prompt.
  
 
== Parameters ==
 
== Parameters ==
  
'''Prompt:''' The lead-in text that you want GPT-3 to respond to.
+
'''Prompt:''' The prompt that you want to send to the GPT-3 model. This should be a clear string that guides the model to produce the desired output.
  
'''Example (Optional):''' An optional parameter providing additional context or instructions for the GPT-3 model.
+
'''Example:''' (optional) An example input to add to the prompt. This should demonstrate the desired outcome or response.
  
== Returns ==  
+
== Return Value ==
  
A string, which is the generated response from the GPT-3 model for the given prompt and example.
+
This function returns a string: the response generated by GPT-3 to the input prompt.
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
$response = $get gpt response("Translate the following English text to French:", "The cat sat on the mat.")
+
config openai("your api key here")
 +
log($get gpt3 response("Translate the following English text to French: 'Hello, world'"))
 
</pre>
 
</pre>
  
In this example, we're asking the GPT-3 model to translate the phrase "The cat sat on the mat" from English to French. The generated response is stored in the variable '$response'.
+
After replacing "your api key here" with your actual OpenAI API key, this script will return the french translation of the text : "Hello, World".
 +
 
 +
The output will be: "Bonjour, monde".
 +
 
 +
This function, when executed properly, should receive and log the translation provided by GPT-3.

Latest revision as of 19:44, 30 June 2023

$get gpt3 response is a function that gets a response from the OpenAI GPT-3 model for a given prompt.

By using this function, you can directly send a well-crafted prompt or a query to GPT-3 and receive a response. This function is particularly useful when you want GPT-3 to generate or complete text, answer questions, or perform any task it's trained for given a specific prompt.

[edit] Parameters

Prompt: The prompt that you want to send to the GPT-3 model. This should be a clear string that guides the model to produce the desired output.

Example: (optional) An example input to add to the prompt. This should demonstrate the desired outcome or response.

[edit] Return Value

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

[edit] Example

config openai("your api key here")
log($get gpt3 response("Translate the following English text to French: 'Hello, world'"))

After replacing "your api key here" with your actual OpenAI API key, this script will return the french translation of the text : "Hello, World".

The output will be: "Bonjour, monde".

This function, when executed properly, should receive and log the translation provided by GPT-3.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox