Skip to content

Commit

Permalink
feat: update model to gpt-4-turbo and improve system prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaucau committed Apr 19, 2024
1 parent e830b53 commit 10876ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/AltGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class AltGenerator {
const API_URL = 'https://api.openai.com/v1/chat/completions';
const MODEL = 'gpt-4-vision-preview';
const MODEL = 'gpt-4-turbo';

public static function generate_alt_text( int $attachment_id, string $user_prompt = '' ): string|WP_Error {
if ( ! wp_attachment_is_image( $attachment_id ) ) {
Expand Down Expand Up @@ -48,7 +48,7 @@ public static function generate_alt_text( int $attachment_id, string $user_promp
'role' => 'system',
'content' => apply_filters(
'acpl/ai_alt_generator/system_prompt',
"Generate a high-quality and concise alt text in $language ($locale) for the provided image without adding any additional comments and text.",
"Generate a concise alt text description in $language ($locale) for the provided image, suitable for use as alt attribute in HTML. The response should be the alt text only, without any additional comments, prefixes, or text.",
$attachment_id,
$locale,
$language
Expand Down

0 comments on commit 10876ec

Please sign in to comment.