Create Chat Response with ChatGPT
Generate a response using ChatGPT's chat completion API
by @pixies
How to Use
Use this brick to pass a prompt and data to ChatGPT and receive the response!
Inputs
Name | Required | Type | Description |
---|---|---|---|
stop |
array
|
Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. | |
topP |
number
|
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with topP probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. OpenAI generally recommends altering this or temperature but not both. | |
model |
string
|
ID of the model to use. Learn more about the models here: https://platform.openai.com/docs/models | |
messages |
array
|
The messages to generate chat completions for, in the chat format: https://platform.openai.com/docs/guides/chat/introduction | |
maxTokens |
integer
|
The maximum number of tokens allowed for the generated answer. By default, the number of tokens the model can return will be (4096 - prompt tokens). | |
openaiapi |
@pixies/openai/openaiapi integration
|
||
temperature |
number
|
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. OpenAI generally recommends altering this or topP but not both. | |
numCompletions |
integer
|
How many chat completion choices to generate for each input message. | |
presencePenalty |
number
|
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. | |
frequencyPenalty |
number
|
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. |
Outputs
Name | Required | Type | Description |
---|---|---|---|
choices |
array
|
The generated completions |