Gpt response

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
'''$get gpt response''' is a function that generates a response from OpenAI's GPT-3 to a given prompt. It provides a simplified interface for getting GPT-3 to generate text based on input prompts.
+
'''$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.
  
 
== Parameters ==
 
== Parameters ==
  
'''Prompt:''' This is the text prompt 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:''' This is an optional parameter. It's an example response that further guides the GPT-3 output.  
+
'''Example:''' (optional) An example input to add to the prompt. This should demonstrate the desired outcome or response.
  
 
== Return Value ==
 
== Return Value ==
  
A string containing GPT-3's response to the given prompt.
+
This function returns a string: the response generated by GPT-3 to the input prompt.
  
== Usage ==
+
== Example ==
  
 
<pre>
 
<pre>
$get gpt response("Translate the following English sentence to French:", "The cat is 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 the above example, the function issues a prompt to GPT-3: "Translate the following English sentence to French:". It also includes an example "The cat is on the mat.". The function then returns the response from GPT-3 as a string. Note that the actual translation will not include the example sentence itself. The example is just there to guide GPT-3 in providing a suitable 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