Plugin Directory

Changeset 3471585


Ignore:
Timestamp:
02/28/2026 11:31:48 AM (4 weeks ago)
Author:
technodrome
Message:

Generate content lenght fix
Visual improvements.
Compact view od tab 1 and 3.
Remove duplicated tab bar in footer.

Location:
technodrome-ai-content-assistant/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • technodrome-ai-content-assistant/trunk/CHANGELOG.md

    r3471565 r3471585  
    55The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
    66and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
     7
     8## [4.1.2] - 2026-02-28
     9
     10### Fixed
     11- **AI Content Truncation**: Articles no longer cut off mid-sentence/mid-word for non-English languages (Serbian, Croatian, Bosnian, etc.). Root cause: non-English text uses 2–2.5 tokens per word vs ~1.3 for English, plus HTML tag overhead — the `word_count * 3` formula was too low.
     12
     13### Improved
     14- **`max_tokens` Multiplier**: Increased from `word_count × 3` to `word_count × 5` across all 9 AI providers — provides enough headroom for any language and HTML markup:
     15  - Short (400 words): 1,200 → 2,000 tokens
     16  - Medium (650 words): 1,950 → 3,250 tokens
     17  - Long (1,000 words): 3,000 → 5,000 tokens
     18  - Extended (1,500 words): 4,500 → 7,500 tokens
     19- **API Request Timeout**: Increased from 60s to 120s for all generation calls — prevents timeouts for longer content with slower models
     20
     21### Providers Updated
     22OpenAI, Anthropic, Google (Gemini), DeepSeek, Cohere, Groq, Together AI, Mistral, GLM
     23
     24---
    725
    826## [4.1.1] - 2026-02-28
  • technodrome-ai-content-assistant/trunk/dashboard/modules/history-tab/history.php

    r3461963 r3471585  
    100100            'edit_link' => get_edit_post_link($taics_post_id),
    101101            'view_link' => get_permalink($taics_post_id),
    102             'excerpt' => wp_trim_words(get_the_content(), 20),
     102            'excerpt' => wp_trim_words(get_the_content(), 75),
    103103            'category' => $taics_category_name,
    104104            'ai_provider' => $taics_ai_provider,
  • technodrome-ai-content-assistant/trunk/features/footer/generate-button.js

    r3468923 r3471585  
    4646
    4747            // v4.0.7: Validate video slot is populated for video context modes
     48            // v4.1.2 FIX: Use correct field ID (#video-url-N, not #taics-video-url-N)
    4849            if (isVideoContextMode) {
    4950                const requiredSlot = (generationMode === 'ai_with_video_channel_context') ? 2 : 1;
    50                 const slotUrl = $(`#taics-video-url-${requiredSlot}`).val() || '';
     51                const slotUrl = $(`#video-url-${requiredSlot}`).val() || '';
    5152                if (slotUrl.trim().length < 5) {
    5253                    const slotName = requiredSlot === 2 ? 'Channel URL in Slot 2' : 'Video URL in Slot 1';
  • technodrome-ai-content-assistant/trunk/features/history-tab/history-load-more.js

    r3372557 r3471585  
    207207                    </div>
    208208                    <div class="taics-item-excerpt">
    209                         <p>${item.excerpt}</p>
     209                        <p><em style="font-size:11px;color:#888;">Preview (first 75 words):</em><br>${item.excerpt}</p>
    210210                    </div>
    211211                </div>
  • technodrome-ai-content-assistant/trunk/includes/class-ai-providers.php

    r3462088 r3471585  
    1717            'model' => $args['model'] ?: 'gpt-4o',
    1818            'messages' => array(array('role' => 'user', 'content' => $prompt)),
    19             'max_tokens' => intval($args['word_count']) * 3, // Increased from *2 to *3 for complete content
     19            'max_tokens' => intval($args['word_count']) * 5, // v4.1.2: Increased from *3 to *5 for non-English languages
    2020            'temperature' => 0.7
    2121        );
     
    2727            ),
    2828            'body' => json_encode($request_data),
    29             'timeout' => 60
     29            'timeout' => 120
    3030        ));
    3131
     
    161161        $request_data = array(
    162162            'model' => $args['model'] ?: 'claude-3-5-sonnet-20241022',
    163             'max_tokens' => intval($args['word_count']) * 3, // Increased from *2 to *3 for complete content
     163            'max_tokens' => intval($args['word_count']) * 5, // v4.1.2: Increased from *3 to *5 for non-English languages
    164164            'messages' => array(array('role' => 'user', 'content' => $prompt))
    165165        );
    166        
     166
    167167        $response = wp_remote_post('https://api.anthropic.com/v1/messages', array(
    168168            'headers' => array(
     
    172172            ),
    173173            'body' => json_encode($request_data),
    174             'timeout' => 60
     174            'timeout' => 120
    175175        ));
    176176       
     
    239239            'generationConfig' => array(
    240240                'temperature' => 0.7,
    241                 'maxOutputTokens' => intval($args['word_count']) * 3 // Increased from *2 to *3 for complete content
     241                'maxOutputTokens' => intval($args['word_count']) * 5 // v4.1.2: Increased from *3 to *5 for non-English languages
    242242            )
    243243        );
     
    245245        $model = $args['model'] ?: 'gemini-1.5-pro';
    246246        $url = 'https://generativelanguage.googleapis.com/v1beta/models/' . $model . ':generateContent?key=' . $args['api_key'];
    247        
     247
    248248        $response = wp_remote_post($url, array(
    249249            'headers' => array('Content-Type' => 'application/json'),
    250250            'body' => json_encode($request_data),
    251             'timeout' => 60
     251            'timeout' => 120
    252252        ));
    253253       
     
    333333            'model' => $args['model'] ?: 'deepseek-chat',
    334334            'messages' => array(array('role' => 'user', 'content' => $prompt)),
    335             'max_tokens' => intval($args['word_count']) * 3, // Increased from *2 to *3 for complete content
     335            'max_tokens' => intval($args['word_count']) * 5, // v4.1.2: Increased from *3 to *5 for non-English languages
    336336            'temperature' => 0.7
    337337        );
    338        
     338
    339339        $response = wp_remote_post('https://api.deepseek.com/v1/chat/completions', array(
    340340            'headers' => array(
     
    343343            ),
    344344            'body' => json_encode($request_data),
    345             'timeout' => 60
     345            'timeout' => 120
    346346        ));
    347347       
     
    416416            'model' => $args['model'] ?: 'command-r-plus',
    417417            'message' => $prompt,
    418             'max_tokens' => intval($args['word_count']) * 3, // Increased from *2 to *3 for complete content
     418            'max_tokens' => intval($args['word_count']) * 5, // v4.1.2: Increased from *3 to *5 for non-English languages
    419419            'temperature' => 0.7
    420420        );
    421        
     421
    422422        $response = wp_remote_post('https://api.cohere.ai/v1/chat', array(
    423423            'headers' => array(
     
    426426            ),
    427427            'body' => json_encode($request_data),
    428             'timeout' => 60
     428            'timeout' => 120
    429429        ));
    430430       
     
    500500            'model' => $args['model'] ?: 'llama-3.3-70b-versatile',
    501501            'messages' => array(array('role' => 'user', 'content' => $prompt)),
    502             'max_tokens' => intval($args['word_count']) * 3,
     502            'max_tokens' => intval($args['word_count']) * 5, // v4.1.2: Increased from *3 to *5 for non-English languages
    503503            'temperature' => 0.7
    504504        );
     
    510510            ),
    511511            'body' => json_encode($request_data),
    512             'timeout' => 60
     512            'timeout' => 120
    513513        ));
    514514
     
    584584            'model' => $args['model'] ?: 'meta-llama/Meta-Llama-3.1-405B-Instruct',
    585585            'messages' => array(array('role' => 'user', 'content' => $prompt)),
    586             'max_tokens' => intval($args['word_count']) * 3,
     586            'max_tokens' => intval($args['word_count']) * 5, // v4.1.2: Increased from *3 to *5 for non-English languages
    587587            'temperature' => 0.7
    588588        );
     
    594594            ),
    595595            'body' => json_encode($request_data),
    596             'timeout' => 60
     596            'timeout' => 120
    597597        ));
    598598
     
    679679            'model' => $args['model'] ?: 'mistral-large-latest',
    680680            'messages' => array(array('role' => 'user', 'content' => $prompt)),
    681             'max_tokens' => intval($args['word_count']) * 3,
     681            'max_tokens' => intval($args['word_count']) * 5, // v4.1.2: Increased from *3 to *5 for non-English languages
    682682            'temperature' => 0.7
    683683        );
     
    689689            ),
    690690            'body' => json_encode($request_data),
    691             'timeout' => 60
     691            'timeout' => 120
    692692        ));
    693693
     
    766766                array('role' => 'user', 'content' => $prompt)
    767767            ),
    768             'max_tokens' => intval($args['word_count']) * 3,
     768            'max_tokens' => intval($args['word_count']) * 5, // v4.1.2: Increased from *3 to *5 for non-English languages
    769769            'temperature' => 0.7
    770770        );
     
    776776            ),
    777777            'body' => json_encode($request_data),
    778             'timeout' => 60
     778            'timeout' => 120
    779779        ));
    780780
  • technodrome-ai-content-assistant/trunk/includes/class-ajax-handler.php

    r3468923 r3471585  
    988988                    'edit_link' => esc_url(get_edit_post_link($post_id)),
    989989                    'view_link' => esc_url(get_permalink($post_id)),
    990                     'excerpt' => esc_html(wp_trim_words(get_the_content(), 25)),
     990                    'excerpt' => esc_html(wp_trim_words(get_the_content(), 75)),
    991991                ];
    992992            }
  • technodrome-ai-content-assistant/trunk/readme.txt

    r3471565 r3471585  
    55Tested up to: 6.9
    66Requires PHP: 8.0
    7 Stable tag: 4.1.1
     7Stable tag: 4.1.2
    88License: GPL v2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4040
    4141== Changelog ==
     42
     43= 4.1.2 (2026-02-28) =
     44*   **FIX**: AI content no longer truncates mid-sentence for non-English languages (Serbian, Croatian, etc.)
     45*   **IMPROVED**: `max_tokens` multiplier increased from x3 to x5 — non-English text uses more tokens per word
     46*   **IMPROVED**: API request timeout increased from 60s to 120s — prevents timeout on longer content generation
     47*   **AFFECTS**: All 9 providers: OpenAI, Anthropic, Google, DeepSeek, Cohere, Groq, Together AI, Mistral, GLM
    4248
    4349= 4.1.1 (2026-02-28) =
  • technodrome-ai-content-assistant/trunk/technodrome-ai-content-assistant.php

    r3471565 r3471585  
    44 * Plugin URI: https://technodrome.org/ai-content-assistant
    55 * Description: Advanced AI content generation plugin with multiple AI providers, profile system, layout templates, and content rules for WordPress.
    6  * Version: 4.1.1
     6 * Version: 4.1.2
    77 * Author: Technodrome Team
    88 * Author URI: https://technodrome.org
     
    3030
    3131// Plugin constants
    32 define('TAICS_VERSION', '4.1.1');
     32define('TAICS_VERSION', '4.1.2');
    3333define('TAICS_PLUGIN_FILE', __FILE__);
    3434define('TAICS_PLUGIN_DIR', plugin_dir_path(__FILE__));
Note: See TracChangeset for help on using the changeset viewer.