Skip to content

Commit

Permalink
Remove prompt content text
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Aug 22, 2024
1 parent 4a46f97 commit 23c71bb
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions includes/admin/feedzy-rss-feeds-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,16 +457,21 @@ private function default_content() {
* @return string
*/
private function chat_gpt_rewrite() {
$content = call_user_func( array( $this, $this->current_job->tag ) );
$content = wp_strip_all_tags( $content );
$content = substr( $content, 0, apply_filters( 'feedzy_chat_gpt_content_limit', 3000 ) );
$content = str_replace( array( '{content}' ), array( $content ), $this->current_job->data->ChatGPT );
// Return prompt content if openAI class does not exist.
if ( ! class_exists( '\Feedzy_Rss_Feeds_Pro_Openai' ) ) {
return $content;
return $this->current_job->data->ChatGPT;
}
$openai = new \Feedzy_Rss_Feeds_Pro_Openai();
$content = $openai->call_api( $this->settings, $content, '', array() );
return $content;

$content = call_user_func( array( $this, $this->current_job->tag ) );
$content = wp_strip_all_tags( $content );
$content = substr( $content, 0, apply_filters( 'feedzy_chat_gpt_content_limit', 3000 ) );
$prompt_content = $this->current_job->data->ChatGPT;
$content = str_replace( array( '{content}' ), array( $content ), $prompt_content );
$openai = new \Feedzy_Rss_Feeds_Pro_Openai();
$rewrite_content = $openai->call_api( $this->settings, $content, '', array() );
// Replace prompt content string for specific cases.
$rewrite_content = str_replace( explode( '{content}', $prompt_content ), '', $rewrite_content );
return $rewrite_content;
}

/**
Expand Down

0 comments on commit 23c71bb

Please sign in to comment.