Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GPT-4o chat completions model. #27

Merged
merged 1 commit into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions class-gwiz-gf-openai.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@
'gpt-4-1106-preview' => array(
'description' => __( 'The latest GPT-4 model with improved instruction following, JSON mode, reproducible outputs, parallel function calling, and more. Returns a maximum of 4,096 output tokens.', 'gravityforms-openai' ),
),
'gpt-4o' => array(
'description' => __( 'The newest flagship model that provides GPT-4-level intelligence but is much faster and improves on its capabilities across text, voice, and vision.', 'gravityforms-openai' ),
),
),
'moderations' => array(
'text-moderation-stable' => array(
Expand Down Expand Up @@ -1386,7 +1389,7 @@

$body = apply_filters( 'gf_openai_request_body', $body, $endpoint, $feed );

$this->log_debug( __METHOD__ . '(): ' . sprintf( __( 'Making request to %s', 'gravityforms-openai' ), $url ) );

Check warning on line 1392 in class-gwiz-gf-openai.php

View workflow job for this annotation

GitHub Actions / PHPCS

A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.

// Cache successful responses.
$response = wp_remote_post($url, array_merge( array(
Expand Down Expand Up @@ -1547,7 +1550,7 @@
public function should_transform_feed( $feed ) {
$endpoint = rgars( $feed, 'meta/endpoint' );

if ( in_array( $endpoint, array( 'completions', 'edits' ) ) ) {

Check warning on line 1553 in class-gwiz-gf-openai.php

View workflow job for this annotation

GitHub Actions / PHPCS

Not using strict comparison for in_array; supply true for third argument.
return true;
}

Expand Down
Loading