|
INITIAL SETUP |
setup basic |
Basic import |
setup dotenv |
Imports and load env key |
setup org |
Imports and load env key for ORG |
|
HELPER FUNCTIONS |
get text_completion() [base] |
Text completion (basic parameters) helper function |
get text_completion() [full] |
Text completion (full parameters) helper function |
get chat_completion() [base] |
Chat completion (basic parameters) helper function |
get chat_completion() [full] |
Chat completion (full parameters) helper function |
get text_edit() [full] |
Edit helper function |
|
PARAMETERS WHIT DEFAULT VALUE |
model= [parameter] |
Specifies the GPT model to be used. (Default value) |
prompt= [parameter] |
Specifies the text prompt. (Default value) |
messages= [parameter] |
A list of messages exchanged in a conversation. (Default value) |
suffix= [parameter] |
The suffix that comes after a completion of inserted text. (Default value) |
max_tokens= [parameter] |
Limits the maximum number of tokens in the generated response. (Default value) |
temperature= [parameter] |
Controls the randomness of the generated output. (Default value) |
top_p= [parameter] |
Controls the diversity of the generated output. (Default value) |
n= [parameter] |
Specifies the number of responses to generate. (Default value) |
stream= [parameter] |
Indicates whether to stream the output or retrieve the entire response at once. (Default value) |
logprobs= [parameter] |
Include the log probabilities on the logprobs most likely tokens. (Default value) |
echo= [parameter] |
Echo back the prompt in addition to the completion. (Default value) |
stop= [parameter] |
Specifies a stopping condition for the generated response. (Default value) |
presence_penalty= [parameter] |
Controls the model's tendency to talk about specific topics. (Default value) |
frequency_penalty= [parameter] |
Controls the model's preference for repeating similar responses. (Default value) |
best_of= [parameter] |
Generates best_of completions server-side and returns the "best". (Default value) |
logit_bias= [parameter] |
Allows biasing the model's output towards a certain behavior or style. (Default value) |
user [parameter] |
A unique identifier representing your end-user. (Default value) |
role |
Role in a conversation message. (Default value) |
|
PARAMETERS NAMES |
model |
OpenAI model - OpenAI model |
prompt |
OpenAI prompt - Text prompt |
messages |
OpenAI messages - Text message |
suffix |
OpenAI suffix - Text suffix |
max_tokens |
OpenAI max_tokens - Maximum tokens |
temperature |
OpenAI temperature - Temperature value |
top_p |
OpenAI top_p - Top-p value |
n |
OpenAI n - Number |
stream |
OpenAI stream - Stream value |
logprobs |
OpenAI logprobs - Log probabilities |
echo |
OpenAI echo - Echo value |
presence_penalty |
OpenAI presence_penalty - Presence penalty |
frequency_penalty |
OpenAI frequency_penalty - Frequency penalty |
best_of |
OpenAI best_of - Best of |
logit_bias |
OpenAI logit_bias - Logit bias |
user |
OpenAI user - User |
role |
OpenAI role - Role |
content |
OpenAI content - Content |
def get_completion() [clean] |
OpenAI Function clean - Get OpenAI model list |
|
OPENAI LIB ACTIONS |
openai.Model.list() |
OpenAI models - Get OpenAI model list |
openai.api_key = |
OpenAI API Key - Set OpenAI API key |
openai.Model.retrieve() |
OpenAI Model retrieve - Retrieve an OpenAI model |
openai.Completion.create() |
OpenAI Completion create - Create an OpenAI completion |
openai.ChatCompletion.create() |
OpenAI ChatCompletion create - Create an OpenAI chat completion |
openai.Edit.create() |
OpenAI Edit create - Create an OpenAI edit |
choices[0].message |
OpenAI Choices - First Choice Message - Access the message of the first choice in OpenAI choices |
choices[0].message['content'] |
OpenAI Choices - First Choice Message Content - Access the content of the message in the first choice of OpenAI choices |
choices[0].text |
OpenAI Choices - First Choice Text - Access the text of the first choice in OpenAI choices |
choices[0].text.split() |
OpenAI Choices - First Choice Text Split - Split the text of the first choice in OpenAI choices |
|
CHAT MODELS |
gpt-4 [chat model] |
OpenAI GPT-4 - Chat completion model - GPT-4. Advanced language model for generating human-like text in chat-based scenarios. |
gpt-4-0314 [chat model] |
OpenAI GPT-4 (0314) - Chat completion model - GPT-4 (0314). Upgraded version of GPT-4 trained with data from March 2014. |
gpt-4-32k [chat model] |
OpenAI GPT-4 (32k) - Chat completion model - GPT-4 (32k). Variant of GPT-4 with a vocabulary size of 32,000 tokens. |
gpt-4-32k-0314 [chat model] |
OpenAI GPT-4 (32k, 0314) - Chat completion model - GPT-4 (32k, 0314). Variant of GPT-4 with a vocabulary size of 32,000 tokens, trained with data from March 2014. |
gpt-3.5-turbo [chat model] |
OpenAI GPT-3.5 Turbo - Chat completion model - GPT-3.5 Turbo. Highly capable language model for chat-based applications, offering improved performance over previous versions. |
gpt-3.5-turbo-0301 [chat model] |
OpenAI GPT-3.5 Turbo (0301) - Chat completion model - GPT-3.5 Turbo (0301). Variant of GPT-3.5 Turbo trained with data from March 2021. |
|
TEXT MODELS |
text-davinci-003 [text model] |
OpenAI Text Davinci (003) - Completion model - Text Davinci (003). General-purpose language model for generating high-quality text in a wide range of contexts. |
text-davinci-002 [text model] |
OpenAI Text Davinci (002) - Completion model - Text Davinci (002). Variant of Text Davinci offering similar capabilities with minor differences. |
text-curie-001 [text model] |
OpenAI Text Curie (001) - Completion model - Text Curie (001). Powerful language model for generating text, designed for various creative and informative tasks. |
text-babbage-001 [text model] |
OpenAI Text Babbage (001) - Completion model - Text Babbage (001). Language model focused on generating text with specific prompts and instructions. |
text-ada-001 [text model] |
OpenAI Text Ada (001) - Completion model - Text Ada (001). Language model designed for specific use cases and industries, offering specialized text generation capabilities. |
|
TEXT EDIT MODELS |
text-davinci-edit-001 [edit model] |
OpenAI Text Davinci Edit (001) - Edit model - Text Davinci Edit (001). Language model optimized for assisting in editing and improving text, providing helpful suggestions and corrections. |
code-davinci-edit-001 [edit model] |
OpenAI Code Davinci Edit (001) - Edit model - Code Davinci Edit (001). Language model specialized in assisting with code editing tasks, offering suggestions and enhancements for programming languages. |