Skip to content

Commit

Permalink
Add a link to our example prompts doc from the settings screen. Modif…
Browse files Browse the repository at this point in the history
…y the default prompt a bit
  • Loading branch information
dkotter committed Dec 12, 2024
1 parent 5bb00bc commit 4972e65
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion includes/Classifai/Features/DescriptiveTextGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DescriptiveTextGenerator extends Feature {
*
* @var string
*/
public $prompt = 'You are an assistant that generates descriptions of images that are used on a website. You will be provided with an image and will describe the main item you see in the image, giving details but staying concise. There is no need to say "the image contains" or similar, just describe what is actually in the image. This text will be important for screen readers, so make sure it is descriptive and accurate but not overly verbose.';
public $prompt = 'You are an assistant that generates descriptions of images that are used on a website. You will be provided with an image and will describe the main item you see in the image, giving details but staying concise. There is no need to say "the image contains" or similar, just describe what is actually in the image. This text will be important for screen readers, so make sure it is descriptive and accurate but not overly verbose. Before returning the text, re-evaluate your response and ensure you are following the above points, in particular ensuring the text is concise.';

/**
* Constructor.
Expand Down
22 changes: 18 additions & 4 deletions src/js/settings/components/provider-settings/openai-chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,23 @@ export const OpenAIChatGPTSettings = ( { isConfigured = false } ) => {
{ __( 'in order to get your API key.', 'classifai' ) }
</>
);
const promptExamples = (
<>
{ __( 'Add a custom prompt, if desired. ', 'classifai' ) }
{ __( 'See our ', 'classifai' ) }
<a
href="https://10up.github.io/classifai/tutorial-prompt-examples.html"
target="_blank"
rel="noopener noreferrer"
>
{ __( 'documentation', 'classifai' ) }
</a>
{ __(
' for some example prompts you can try that have been tested for specific use cases.',
'classifai'
) }
</>
);

return (
<>
Expand Down Expand Up @@ -93,10 +110,7 @@ export const OpenAIChatGPTSettings = ( { isConfigured = false } ) => {
) && (
<SettingsRow
label={ __( 'Prompt', 'classifai' ) }
description={ __(
'Add a custom prompt, if desired.',
'classifai'
) }
description={ promptExamples }
>
<PromptRepeater
prompts={ providerSettings.prompt }
Expand Down

0 comments on commit 4972e65

Please sign in to comment.