Gpt response
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
− | '''$get | + | '''$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:''' | + | '''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:''' | + | '''Example:''' (optional) An example input to add to the prompt. This should demonstrate the desired outcome or response. |
== Return Value == | == Return Value == | ||
− | This function returns a string | + | This function returns a string: the response generated by GPT-3 to the input prompt. |
== Example == | == Example == | ||
<pre> | <pre> | ||
− | + | config openai("your api key here") | |
+ | log($get gpt3 response("Translate the following English text to French: 'Hello, world'")) | ||
</pre> | </pre> | ||
− | + | 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.