Skip to content

Commit 4b8cd89

Browse files
committed
Added gpt-4 and gpt-4-32k as available models for the Chat Completions endpoint.
1 parent e7de0d8 commit 4b8cd89

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

class-gwiz-gf-openai.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,16 @@ public function get_openai_models() {
290290
),
291291
'chat/completions' => array(
292292
'gpt-3.5-turbo' => array(
293-
'type' => 'GPT 3.5 Turbo',
294293
'description' => __( 'The same model used by <a href="https://chat.openai.com" target="_blank">ChatGPT</a>.', 'gravityforms-openai' ),
295294
),
295+
'gpt-4' => array(
296+
'waitlist' => 'https://openai.com/waitlist/gpt-4-api',
297+
'description' => __( 'More capable than any GPT-3.5 model, able to do more complex tasks, and optimized for chat. Will be updated with the latest model iteration.<br /><br /><a target="_blank" href="https://openai.com/waitlist/gpt-4-api">Join Waitlist</a>', 'gravityforms-openai' ),
298+
),
299+
'gpt-4-32k' => array(
300+
'description' => __( 'Same capabilities as the base gpt-4 mode but with 4x the context length. Will be updated with the latest model iteration.<br /><br /><a target="_blank" href="https://openai.com/waitlist/gpt-4-api">Join Waitlist</a>', 'gravityforms-openai' ),
301+
'waitlist' => 'https://openai.com/waitlist/gpt-4-api',
302+
),
296303
),
297304
'edits' => array(
298305
'text-davinci-edit-001' => array(
@@ -468,9 +475,9 @@ public function get_openai_model_choices( $endpoint ) {
468475

469476
foreach ( $models as $model => $model_info ) {
470477
$choices[] = array(
471-
'label' => $model,
478+
'label' => $model . ( rgar( $model_info, 'waitlist' ) ? ' (' . __( 'Requires Waitlist', 'gravityforms-openai' ) . ')' : '' ),
472479
'value' => $model,
473-
'tooltip' => ! rgar( $model, 'user_model' ) ? 'openai_model_' . $model : null,
480+
'tooltip' => ! rgar( $model_info, 'user_model' ) ? 'openai_model_' . $model : null,
474481
);
475482
}
476483

0 commit comments

Comments
 (0)