Plugin Directory

Changeset 3342891


Ignore:
Timestamp:
08/11/2025 12:59:30 PM (8 months ago)
Author:
oc3dots
Message:

Quick fix to add basic GPT-5 model support. Only chat completion API.

Location:
s2b-ai-assistant/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • s2b-ai-assistant/trunk/lib/classes/OpenAi.php

    r3252391 r3342891  
    4343            $o1_models = $this->o1_models;
    4444            if (isset($model) && array_key_exists($model, $o1_models)) {
     45                return true;
     46            }
     47           
     48            return false;
     49           
     50        }
     51       
     52        public function check5Model($model = ''){
     53
     54           
     55            if (strpos($model,'pt-5')> 0) {
    4556                return true;
    4657            }
  • s2b-ai-assistant/trunk/lib/helpers/AiRequest.php

    r3318367 r3342891  
    7373            $open_ai = new S2bAia_OpenAi();
    7474            $if_new_model = $open_ai->checkNewModel($data['model']);
     75            $if_5_model = $open_ai->check5Model($data['model']);
    7576            if (!$if_new_model) {
    7677                $msgs = [["role" => "system", "content" => $data['system']]];
     
    8182                    $msgs[] = ['role' => $msg['role'], 'content' => $msg['content']];
    8283                }
     84            }
     85            if($if_5_model){
     86                $temperature = 1;
    8387            }
    8488            $body = ["model" => $model, "temperature" => $temperature,
     
    8791                "messages" => $msgs
    8892            ];
    89             if ($if_new_model) {
     93           
     94            if($if_5_model){
     95                $body["max_completion_tokens"] = $max_tokens;
     96            }
     97            elseif ($if_new_model) {
    9098                $body["max_completion_tokens"] = $max_tokens;
    9199            } else {
  • s2b-ai-assistant/trunk/readme.txt

    r3338464 r3342891  
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    10 Stable tag: 1.7.4
     10Stable tag: 1.7.5
    1111
    1212Create multiple AI chatbots with OpenAI, Claude, xAI, DeepSeek models with different styles and behavior, content aware features   ...
     
    266266== Changelog ==
    267267
     268= 1.7.5 =
     269* Quick fix to add basic GPT-5 model support. Only chat completion API. Full support is coming.
     270
    268271= 1.7.4 =
    269272* Add Anthropic Claude support
  • s2b-ai-assistant/trunk/s2b-ai-assistant.php

    r3338464 r3342891  
    88  Text Domain: s2b-ai-assistant
    99  Domain Path: /lang
    10   Version: 1.7.4
     10  Version: 1.7.5
    1111  License:  GPL-2.0+
    1212  License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
Note: See TracChangeset for help on using the changeset viewer.