Changeset 3468129
- Timestamp:
- 02/24/2026 01:18:46 AM (5 weeks ago)
- Location:
- s2b-ai-assistant/trunk
- Files:
-
- 4 edited
-
lib/agents/addons/seo-readability-rewrite-agent/SeoReadabilityRewriteAgent.php (modified) (3 diffs)
-
lib/agents/tools/OpenAITools.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
s2b-ai-assistant.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
s2b-ai-assistant/trunk/lib/agents/addons/seo-readability-rewrite-agent/SeoReadabilityRewriteAgent.php
r3466659 r3468129 473 473 474 474 // Optional: extract any custom prompt the user provided in the first message 475 $custom_prompt = ''; 476 $messages = S2baia_MessageHelper::get_message_history((int) $this->task->id); 477 if (!empty($messages)) { 478 foreach ($messages as $msg) { 479 if (($msg['role'] ?? '') === 'user' && isset($msg['content']['custom_prompt'])) { 480 $custom_prompt = wp_strip_all_tags((string) $msg['content']['custom_prompt']); 481 break; 475 476 $stored_prompt = []; 477 if (method_exists('S2baia_MessageHelper', 'get_latest_user_payload')) { 478 $stored_prompt = S2baia_MessageHelper::get_latest_user_payload((int) $this->task->id); 479 if (!is_array($stored_prompt)) { $stored_prompt = []; } 480 } else { 481 // Fallback: scan history, decode JSON content 482 $messages = S2baia_MessageHelper::get_message_history($this->task->id); 483 if (!empty($messages)) { 484 foreach ($messages as $msg) { 485 if (($msg['role'] ?? '') !== 'user') { continue; } 486 $raw = $msg['content'] ?? ''; 487 if (is_string($raw) && $raw !== '') { 488 $decoded = json_decode($raw, true); 489 if (is_array($decoded)) { 490 $stored_prompt = $decoded; 491 break; 492 } 493 } 482 494 } 483 495 } 484 496 } 485 497 498 $custom_prompt = isset($stored_prompt['custom_prompt']) ? (string) $stored_prompt['custom_prompt'] : ''; 486 499 // Decide instructions by strategy 487 500 $lang_hint = $language !== '' ? $language : 'unknown'; … … 580 593 $call_obj->timeout = $timeout; 581 594 $call_obj->prompt = $prompt; 582 595 583 596 // Optional: allow filtering the call object before dispatch 584 597 $call_obj = apply_filters( … … 1166 1179 // Save the user message (optional custom instructions) into message history 1167 1180 if ($custom_prompt !== '') { 1168 S2baia_MessageHelper::add_message($task_id, 'user', ['custom_prompt' => $custom_prompt]); 1181 S2baia_MessageHelper::upsert_user_payload((int)$task_id, array( 1182 'custom_prompt' => $custom_prompt, 1183 )); 1169 1184 } 1170 1185 -
s2b-ai-assistant/trunk/lib/agents/tools/OpenAITools.php
r3466659 r3468129 165 165 return ['response' => 'OpenAI API error: ' . $data['error']['message']]; 166 166 } 167 167 168 168 return ['response' => $data['choices'][0]['message']['content'] ?? 'No response.']; 169 169 } -
s2b-ai-assistant/trunk/readme.txt
r3466657 r3468129 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 Stable tag: 1.9. 010 Stable tag: 1.9.1 11 11 12 12 Create multiple AI chatbots with OpenAI, Claude, xAI, DeepSeek models with different styles, AI Agents with Chatkit ... … … 257 257 == Changelog == 258 258 259 = 1.9.1 = 260 * Fix missing method error 261 259 262 = 1.9.0 = 260 263 * Added file upload support for Chatkit. -
s2b-ai-assistant/trunk/s2b-ai-assistant.php
r3466657 r3468129 8 8 Text Domain: s2b-ai-assistant 9 9 Domain Path: /lang 10 Version: 1.9. 010 Version: 1.9.1 11 11 License: GPL-2.0+ 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 43 43 define( 'S2BAIA_CHATGPT_BOT_PREFIX', 's2baia_chatbot_' ); 44 44 define( 'S2BAIA_CHATGPT_BOT_OPTIONS_PREFIX', 's2baia_chatbot_opt_' ); 45 define('S2BAIA_VERSION', '1.9. 0');45 define('S2BAIA_VERSION', '1.9.1'); 46 46 //Init the plugin 47 47 require_once S2BAIA_PATH . '/lib/helpers/Utils.php';
Note: See TracChangeset
for help on using the changeset viewer.