← All changes
|
includes/integration/openrouter/admin/settings.php
+190
-191
8.6.5
→
8.3.8
View file →
| @@ -1,192 +1,191 @@ | ||
| 1 | -<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?> | |
| 2 | - | |
| 3 | - | |
| 4 | - <div class="card-body p-sm-0"> | |
| 5 | - | |
| 6 | - <ul class="nav nav-tabs"> | |
| 7 | - <li class="active"><a data-toggle="tab" href="#wp-chatbot-openrouter-settings"><i class="dashicons dashicons-admin-home"></i><?php echo esc_html__('OpenRouter settings', 'chatbot'); ?></a></li> | |
| 8 | - <li><a data-toggle="tab" href="#wp-chatbot-openrouter-rag"><i class="dashicons dashicons-admin-generic"></i><?php echo esc_html__('RAG', 'chatbot'); ?></a></li> | |
| 9 | - <li><a data-toggle="tab" href="#wp-chatbot-openrouter-help"><i class="dashicons dashicons-editor-help"></i><?php echo esc_html__('OpenRouter Help', 'chatbot'); ?></a></li> | |
| 10 | - </ul> | |
| 11 | - | |
| 12 | - <div class="tab-content"> | |
| 13 | - <div id="wp-chatbot-openrouter-settings" class="tab-pane in active"> | |
| 14 | - <div class="col-sm-12"> | |
| 15 | - | |
| 16 | - <div class="row gx-0"> | |
| 17 | - <div class="mb-3"> | |
| 18 | - <div class="form-check form-switch my-4"> | |
| 19 | - <input class="form-check-input" type="checkbox" <?php echo (get_option('qcld_openrouter_enabled') == 1) ? esc_attr('checked','chatbot') :'';?> role="switch" value="" id="<?php esc_attr_e('qcld_openrouter_enabled','chatbot'); ?>"> | |
| 20 | - <label class="form-check-label" for="<?php esc_attr_e('qcld_openrouter_enabled','chatbot'); ?>"> | |
| 21 | - <?php esc_html_e('Enable OpenRouter AI','chatbot'); ?><span style="color:red"> <?php esc_html_e('(if you want results from OpenRouter only, disable Site Search from Settings->Start Menu)','chatbot'); ?></span> | |
| 22 | - </label> | |
| 23 | - </div> | |
| 24 | - </div> | |
| 25 | - </div> | |
| 26 | - <div class="row gx-0"> | |
| 27 | - <div class="form-check form-switch my-4"> | |
| 28 | - <input class="form-check-input" type="checkbox" <?php echo (get_option('opnrouter_context_awareness_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="opnrouter_is_context_awareness_enabled"> | |
| 29 | - <label class="form-check-label" for="opnrouter_is_context_awareness_enabled"> | |
| 30 | - <?php esc_html_e( 'Context awareness','chatbot'); ?> | |
| 31 | - </label> | |
| 32 | - | |
| 33 | - </div> | |
| 34 | - </div> | |
| 35 | - <div class="row gx-0"> | |
| 36 | - <div class="mb-3"> | |
| 37 | - <div class="form-check form-switch my-4"> | |
| 38 | - <input class="form-check-input" type="checkbox" <?php echo (get_option('qcld_openrouter_page_suggestion_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="qcld_openrouter_page_suggestion_enabled"> | |
| 39 | - <label class="form-check-label" for="<?php esc_attr_e( 'qcld_openrouter_page_suggestion_enabled','chatbot'); ?>"> | |
| 40 | - <?php esc_html_e( 'Enable page suggestions with OpenRouter Result','chatbot'); ?> | |
| 41 | - </label> | |
| 42 | - </div> | |
| 43 | - | |
| 44 | - <!-- POST TYPE --> | |
| 45 | - <div class="form-check form-switch my-4"> | |
| 46 | - <label><?php esc_html_e( 'Select POST TYPE(s) to include with search results', 'chatbot' ); ?></label> | |
| 47 | - <div id="wp-chatbot-post-converter"> | |
| 48 | - <ul class="checkbox-list"> | |
| 49 | - <?php | |
| 50 | - $get_cpt_args = array( | |
| 51 | - 'public' => true, | |
| 52 | - ); | |
| 53 | - $post_types = get_post_types($get_cpt_args, 'object'); | |
| 54 | - foreach ($post_types as $post_type) { | |
| 55 | - if ($post_type->name != 'attachment') { | |
| 56 | - $is_pro = !in_array($post_type->name, ['post', 'page']); | |
| 57 | - ?> | |
| 58 | - <div class="form-check form-check-inline"> | |
| 59 | - <input | |
| 60 | - id="site_openrouter_search_posttypes_<?php echo esc_html( $post_type->name ); ?>" | |
| 61 | - type="checkbox" | |
| 62 | - name="site_openrouter_search_posttypes[]" | |
| 63 | - value="<?php echo esc_html( $post_type->name ); ?>" | |
| 64 | - <?php echo (($is_pro) ? 'disabled' : ''); ?> | |
| 65 | - | |
| 66 | - <?php echo ((get_option('qcld_openai_relevant_post') != '') && in_array($post_type->name, get_option('qcld_openai_relevant_post'))) ? 'checked' : ''; ?>> | |
| 67 | - <label class="form-check-label <?php echo ($is_pro ? 'pro-locked' : ''); ?>" for="site_openrouter_search_posttypes_<?php echo esc_html( $post_type->name ); ?>"> | |
| 68 | - <?php echo esc_html( $post_type->name ); ?> | |
| 69 | - <?php if ($is_pro) { ?> | |
| 70 | - <span class="pro-badge">Pro</span> | |
| 71 | - <?php } ?> | |
| 72 | - </label> | |
| 73 | - </div> | |
| 74 | - <?php | |
| 75 | - } | |
| 76 | - } | |
| 77 | - ?> | |
| 78 | - </ul> | |
| 79 | - </div> | |
| 80 | - </div> | |
| 81 | - <!-- /POST TYPE --> | |
| 82 | - | |
| 83 | - </div> | |
| 84 | - </div> | |
| 85 | - <div class="row gx-0"> | |
| 86 | - <div class="mb-3 form-check "> | |
| 87 | - <label for="qcld_openrouter_api_key" class="form-label"><?php esc_html_e('OpenRouter API Key','chatbot');?></label> | |
| 88 | - <input type="password" class="form-control" id="qcld_openrouter_api_key" name="qcld_openrouter_api_key" placeholder="Enter your OpenRouter API Key" value="<?php echo esc_attr(get_option('qcld_openrouter_api_key')); ?>"> | |
| 89 | - <small class="form-text text-muted"><?php esc_html_e('Get your API key from https://openrouter.ai/workspaces/default/keys','chatbot'); ?></br><span style="color:red"><?php esc_html_e('It requires a paid OpenRouter API plan', 'chatbot'); ?> </span></small> | |
| 90 | - </div> | |
| 91 | - </div> | |
| 92 | - <div class="row g-0"> | |
| 93 | - <div class="mb-3 form-check "> | |
| 94 | - <label for="qcld_openrouter_model" class="form-label"><?php esc_html_e('OpenRouter Model','chatbot');?></label> | |
| 95 | - <select id="qcld_openrouter_model" class="form-control" name="qcld_openrouter_model" data-current-model="<?php echo esc_attr(get_option('qcld_openrouter_model')); ?>"> | |
| 96 | - <option value=""><?php esc_html_e('Loading models...','chatbot'); ?></option> | |
| 97 | - </select> | |
| 98 | - <small class="form-text text-muted"><?php esc_html_e('Select a model from OpenRouter','chatbot'); ?></small> | |
| 99 | - </div> | |
| 100 | - | |
| 101 | - <div class="row gx-0"> | |
| 102 | - <div class="mb-3 form-check "> | |
| 103 | - <label for="qcld_openrouter_prepend_content" class="form-label"><?php esc_html_e('Your Prompt to be Added before the User Query for Customized Results (Optional)','chatbot');?></label> | |
| 104 | - <input type="text" class="form-control" id="qcld_openrouter_prepend_content" name="qcld_openrouter_prepend_content" placeholder="Content for the response" value="<?php echo esc_attr( get_option('qcld_openrouter_prepend_content') ); ?>"> | |
| 105 | - | |
| 106 | - </div> | |
| 107 | - </div> | |
| 108 | - | |
| 109 | - <div class="row gx-0"> | |
| 110 | - <div class="mb-3 form-check "> | |
| 111 | - <label for="qcld_openrouter_append_content" class="form-label"><?php esc_html_e('Your Prompt to be Appended at the End of the User Query for Customized Results (Optional)','chatbot');?></label> | |
| 112 | - <input type="text" class="form-control" id="qcld_openrouter_append_content" name="qcld_openrouter_append_content" placeholder="Content for the response" value="<?php echo esc_attr( get_option('qcld_openrouter_append_content') ); ?>"> | |
| 113 | - | |
| 114 | - </div> | |
| 115 | - </div> | |
| 116 | - </div> | |
| 117 | - <div class="mb-3"> | |
| 118 | - <a class="btn btn-success" id="qcld_save_openrouter_setting"><?php esc_html_e('Save settings','chatbot');?></a> | |
| 119 | - </div> | |
| 120 | - </div> | |
| 121 | - | |
| 122 | - | |
| 123 | - </div> | |
| 124 | - <div id="wp-chatbot-openrouter-rag" class="tab-pane"> | |
| 125 | - <div class="col-sm-12"> | |
| 126 | - <div class="wrap"> | |
| 127 | - <h3>OpenRouter RAG Settings</h3> | |
| 128 | - <p>If you enable RAG, you must configure the <a id="ai-knowledge-base-tab-openrouter" href="<?php echo esc_url( admin_url('admin.php?page=wpbot_openAi#ai-knowledge-base-tab') ); ?>">Knowledgebase</a> for Post types and other data to embed.</p></br> | |
| 129 | - <span style="color:red"><?php esc_html_e('It requires a paid OpenRouter API plan', 'chatbot'); ?> </span> | |
| 130 | - <div class="form-check form-switch my-4"> | |
| 131 | - <input class="form-check-input" | |
| 132 | - type="checkbox" | |
| 133 | - id="is_page_rag_enabled_openrouter" | |
| 134 | - <?php echo (get_option('is_page_rag_enabled') == '1') ? 'checked' : ''; ?>> | |
| 135 | - <label class="form-check-label" for="is_page_rag_enabled_openrouter"> | |
| 136 | - Enable RAG | |
| 137 | - </label> | |
| 138 | - </div> | |
| 139 | - <div class="mb-3"> | |
| 140 | - <a class="btn btn-success" id="qcld_save_openrouter_setting"><?php esc_html_e( 'Save settings','chatbot');?></a> | |
| 141 | - </div> | |
| 142 | - </div> | |
| 143 | - <div class="qcld-row"> | |
| 144 | - <div class="alert alert-info mt-20" role="alert"> | |
| 145 | - <p><b><?php echo esc_html__( 'Fine Tuning VS GPT Assistants VS RAG:', 'chatbot'); ?></b></p> | |
| 146 | - <p> | |
| 147 | - <?php echo esc_html__( 'We suggest using GPT Assistants or RAG instead of Fine Tuning as Fine Tuning requires a lot of properly formatted data and GPT Assistants are easier to set up. You can still use your website data to train the bot.', 'chatbot'); ?> | |
| 148 | - </p></br> | |
| 149 | - <p> | |
| 150 | - <b><?php echo esc_html__( 'How to Use RAG in This Plugin:', 'chatbot'); ?></b> | |
| 151 | - <ol> | |
| 152 | - <li><?php echo esc_html__( 'Enable RAG from the settings panel', 'chatbot'); ?></li> | |
| 153 | - <li><?php echo esc_html__( 'Click "Embed All Selected Sources" button, after selecting the sources from the', 'chatbot'); ?> <a href="<?php echo esc_url( admin_url('admin.php?page=wpbot_openAi#ai-knowledge-base-tab') ); ?>" target="_blank">knowledgebase tab</a></li> | |
| 154 | - <li><?php echo esc_html__( '(Optional) Upload PDFs or CSV files for embedding', 'chatbot'); ?></li> | |
| 155 | - <li><?php echo esc_html__( 'The system automatically stores embeddings in the database', 'chatbot'); ?></li> | |
| 156 | - <li><?php echo esc_html__( 'User questions will now be answered using your site’s knowledge base', 'chatbot'); ?></li> | |
| 157 | - <li><?php echo esc_html__( 'You need to configure the OpenAI API key, AI Model and System Command under the main OpenAI Settings', 'chatbot'); ?></li> | |
| 158 | - </ol> | |
| 159 | - <strong><?php echo esc_html__( 'You can update or re-embed content at any time without retraining.', 'chatbot'); ?></strong> | |
| 160 | - </p> | |
| 161 | - | |
| 162 | - </div> | |
| 163 | - | |
| 164 | - </div> | |
| 165 | - </div> | |
| 166 | - </div> | |
| 167 | - <div id="wp-chatbot-openrouter-help" class="tab-pane"> | |
| 168 | - <div class="accordion" id="qcldopenaiaccordion"> | |
| 169 | - <div class="card"> | |
| 170 | - <div class="card-header" id="panelsStayOpen-headingZero-openrouter"> | |
| 171 | - <h2 class="mb-0"> | |
| 172 | - <button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseZero-openrouter" aria-expanded="true" aria-controls="panelsStayOpen-collapseZero-openrouter"> | |
| 173 | - <?php esc_html_e( 'Getting Started with openrouter','chatbot');?> | |
| 174 | - </button> | |
| 175 | - </h2> | |
| 176 | - </div> | |
| 177 | - <div id="panelsStayOpen-collapseZero-openrouter" class="collapse" aria-labelledby="panelsStayOpen-headingZero-openrouter" data-parent="#qcldopenaiaccordion"> | |
| 178 | - <div class="card-body-openrouter"> | |
| 179 | - <h5><?php esc_html_e( 'OpenRouter is an unified Interface or Aggregator for LLMs. You can choose from hundreds of different AI models from OpenAI to Deepseek or Claude to get AI responses.','chatbot');?></h5> | |
| 180 | - <h5><?php esc_html_e( 'All you have to do is add the OpenRouter API Key and select an OpenRouter Model.','chatbot');?></h5> | |
| 181 | - <h5><?php esc_html_e( 'Grab your OpenAI API key from','chatbot');?> <a href="https://openrouter.ai/workspaces/default/keys">HERE</a></h5> | |
| 182 | - <p><?php esc_html_e( 'Please make sure that DialogFlow, OpenAI are Disabled if you want OpenRouter to work.','chatbot');?></p> | |
| 183 | - </div> | |
| 184 | - </div> | |
| 185 | - </div> | |
| 186 | - | |
| 187 | - | |
| 188 | - | |
| 189 | - </div> | |
| 190 | - </div> | |
| 191 | - </div> | |
| 1 | + | |
| 2 | + | |
| 3 | + <div class="card-body p-sm-0"> | |
| 4 | + | |
| 5 | + <ul class="nav nav-tabs"> | |
| 6 | + <li class="active"><a data-toggle="tab" href="#wp-chatbot-openrouter-settings"><i class="dashicons dashicons-admin-home"></i><?php echo esc_html__('OpenRouter settings', 'chatbot'); ?></a></li> | |
| 7 | + <li><a data-toggle="tab" href="#wp-chatbot-openrouter-rag"><i class="dashicons dashicons-admin-generic"></i><?php echo esc_html__('RAG', 'chatbot'); ?></a></li> | |
| 8 | + <li><a data-toggle="tab" href="#wp-chatbot-openrouter-help"><i class="dashicons dashicons-editor-help"></i><?php echo esc_html__('OpenRouter Help', 'chatbot'); ?></a></li> | |
| 9 | + </ul> | |
| 10 | + | |
| 11 | + <div class="tab-content"> | |
| 12 | + <div id="wp-chatbot-openrouter-settings" class="tab-pane in active"> | |
| 13 | + <div class="col-sm-12"> | |
| 14 | + | |
| 15 | + <div class="row gx-0"> | |
| 16 | + <div class="mb-3"> | |
| 17 | + <div class="form-check form-switch my-4"> | |
| 18 | + <input class="form-check-input" type="checkbox" <?php echo (get_option('qcld_openrouter_enabled') == 1) ? esc_attr('checked','chatbot') :'';?> role="switch" value="" id="<?php esc_attr_e('qcld_openrouter_enabled','chatbot'); ?>"> | |
| 19 | + <label class="form-check-label" for="<?php esc_attr_e('qcld_openrouter_enabled','chatbot'); ?>"> | |
| 20 | + <?php esc_html_e('Enable OpenRouter AI','chatbot'); ?><span style="color:red"> <?php esc_html_e('(if you want results from OpenRouter only, disable Site Search from Settings->Start Menu)','chatbot'); ?></span> | |
| 21 | + </label> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + </div> | |
| 25 | + <div class="row gx-0"> | |
| 26 | + <div class="form-check form-switch my-4"> | |
| 27 | + <input class="form-check-input" type="checkbox" <?php echo (get_option('opnrouter_context_awareness_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="opnrouter_is_context_awareness_enabled"> | |
| 28 | + <label class="form-check-label" for="opnrouter_is_context_awareness_enabled"> | |
| 29 | + <?php esc_html_e( 'Context awareness','chatbot'); ?> | |
| 30 | + </label> | |
| 31 | + | |
| 32 | + </div> | |
| 33 | + </div> | |
| 34 | + <div class="row gx-0"> | |
| 35 | + <div class="mb-3"> | |
| 36 | + <div class="form-check form-switch my-4"> | |
| 37 | + <input class="form-check-input" type="checkbox" <?php echo (get_option('qcld_openrouter_page_suggestion_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="qcld_openrouter_page_suggestion_enabled"> | |
| 38 | + <label class="form-check-label" for="<?php esc_attr_e( 'qcld_openrouter_page_suggestion_enabled','chatbot'); ?>"> | |
| 39 | + <?php esc_html_e( 'Enable page suggestions with OpenRouter Result','chatbot'); ?> | |
| 40 | + </label> | |
| 41 | + </div> | |
| 42 | + | |
| 43 | + <!-- POST TYPE --> | |
| 44 | + <div class="form-check form-switch my-4"> | |
| 45 | + <label><?php esc_html_e( 'Select POST TYPE(s) to include with search results', 'chatbot' ); ?></label> | |
| 46 | + <div id="wp-chatbot-post-converter"> | |
| 47 | + <ul class="checkbox-list"> | |
| 48 | + <?php | |
| 49 | + $get_cpt_args = array( | |
| 50 | + 'public' => true, | |
| 51 | + ); | |
| 52 | + $post_types = get_post_types($get_cpt_args, 'object'); | |
| 53 | + foreach ($post_types as $post_type) { | |
| 54 | + if ($post_type->name != 'attachment') { | |
| 55 | + $is_pro = !in_array($post_type->name, ['post', 'page']); | |
| 56 | + ?> | |
| 57 | + <div class="form-check form-check-inline"> | |
| 58 | + <input | |
| 59 | + id="site_openrouter_search_posttypes_<?php echo esc_html( $post_type->name ); ?>" | |
| 60 | + type="checkbox" | |
| 61 | + name="site_openrouter_search_posttypes[]" | |
| 62 | + value="<?php echo esc_html( $post_type->name ); ?>" | |
| 63 | + <?php echo (($is_pro) ? 'disabled' : ''); ?> | |
| 64 | + | |
| 65 | + <?php echo ((get_option('qcld_openai_relevant_post') != '') && in_array($post_type->name, get_option('qcld_openai_relevant_post'))) ? 'checked' : ''; ?>> | |
| 66 | + <label class="form-check-label <?php echo ($is_pro ? 'pro-locked' : ''); ?>" for="site_openrouter_search_posttypes_<?php echo esc_html( $post_type->name ); ?>"> | |
| 67 | + <?php echo esc_html( $post_type->name ); ?> | |
| 68 | + <?php if ($is_pro) { ?> | |
| 69 | + <span class="pro-badge">Pro</span> | |
| 70 | + <?php } ?> | |
| 71 | + </label> | |
| 72 | + </div> | |
| 73 | + <?php | |
| 74 | + } | |
| 75 | + } | |
| 76 | + ?> | |
| 77 | + </ul> | |
| 78 | + </div> | |
| 79 | + </div> | |
| 80 | + <!-- /POST TYPE --> | |
| 81 | + | |
| 82 | + </div> | |
| 83 | + </div> | |
| 84 | + <div class="row gx-0"> | |
| 85 | + <div class="mb-3 form-check "> | |
| 86 | + <label for="qcld_openrouter_api_key" class="form-label"><?php esc_html_e('OpenRouter API Key','chatbot');?></label> | |
| 87 | + <input type="password" class="form-control" id="qcld_openrouter_api_key" name="qcld_openrouter_api_key" placeholder="Enter your OpenRouter API Key" value="<?php echo esc_attr(get_option('qcld_openrouter_api_key')); ?>"> | |
| 88 | + <small class="form-text text-muted"><?php esc_html_e('Get your API key from https://openrouter.ai/settings/keys','chatbot'); ?></br><span style="color:red"><?php esc_html_e('It requires a paid OpenRouter API plan', 'chatbot'); ?> </span></small> | |
| 89 | + </div> | |
| 90 | + </div> | |
| 91 | + <div class="row g-0"> | |
| 92 | + <div class="mb-3 form-check "> | |
| 93 | + <label for="qcld_openrouter_model" class="form-label"><?php esc_html_e('OpenRouter Model','chatbot');?></label> | |
| 94 | + <select id="qcld_openrouter_model" class="form-control" name="qcld_openrouter_model" data-current-model="<?php echo esc_attr(get_option('qcld_openrouter_model')); ?>"> | |
| 95 | + <option value=""><?php esc_html_e('Loading models...','chatbot'); ?></option> | |
| 96 | + </select> | |
| 97 | + <small class="form-text text-muted"><?php esc_html_e('Select a model from OpenRouter','chatbot'); ?></small> | |
| 98 | + </div> | |
| 99 | + | |
| 100 | + <div class="row gx-0"> | |
| 101 | + <div class="mb-3 form-check "> | |
| 102 | + <label for="qcld_openrouter_prepend_content" class="form-label"><?php esc_html_e('Your Prompt to be Added before the User Query for Customized Results (Optional)','chatbot');?></label> | |
| 103 | + <input type="text" class="form-control" id="qcld_openrouter_prepend_content" name="qcld_openrouter_prepend_content" placeholder="Content for the response" value="<?php echo esc_attr( get_option('qcld_openrouter_prepend_content') ); ?>"> | |
| 104 | + | |
| 105 | + </div> | |
| 106 | + </div> | |
| 107 | + | |
| 108 | + <div class="row gx-0"> | |
| 109 | + <div class="mb-3 form-check "> | |
| 110 | + <label for="qcld_openrouter_append_content" class="form-label"><?php esc_html_e('Your Prompt to be Appended at the End of the User Query for Customized Results (Optional)','chatbot');?></label> | |
| 111 | + <input type="text" class="form-control" id="qcld_openrouter_append_content" name="qcld_openrouter_append_content" placeholder="Content for the response" value="<?php echo esc_attr( get_option('qcld_openrouter_append_content') ); ?>"> | |
| 112 | + | |
| 113 | + </div> | |
| 114 | + </div> | |
| 115 | + </div> | |
| 116 | + <div class="mb-3"> | |
| 117 | + <a class="btn btn-success" id="qcld_save_openrouter_setting"><?php esc_html_e('Save settings','chatbot');?></a> | |
| 118 | + </div> | |
| 119 | + </div> | |
| 120 | + | |
| 121 | + | |
| 122 | + </div> | |
| 123 | + <div id="wp-chatbot-openrouter-rag" class="tab-pane"> | |
| 124 | + <div class="col-sm-12"> | |
| 125 | + <div class="wrap"> | |
| 126 | + <h3>OpenRouter RAG Settings</h3> | |
| 127 | + <p>If you enable RAG, you must configure the <a id="ai-knowledge-base-tab-openrouter" href="<?php echo admin_url('admin.php?page=wpbot_openAi#ai-knowledge-base-tab'); ?>">Knowledgebase</a> for Post types and other data to embed.</p></br> | |
| 128 | + <span style="color:red"><?php esc_html_e('It requires a paid OpenRouter API plan', 'chatbot'); ?> </span> | |
| 129 | + <div class="form-check form-switch my-4"> | |
| 130 | + <input class="form-check-input" | |
| 131 | + type="checkbox" | |
| 132 | + id="is_page_rag_enabled_openrouter" | |
| 133 | + <?php echo (get_option('is_page_rag_enabled') == '1') ? 'checked' : ''; ?>> | |
| 134 | + <label class="form-check-label" for="is_page_rag_enabled_openrouter"> | |
| 135 | + Enable RAG | |
| 136 | + </label> | |
| 137 | + </div> | |
| 138 | + <div class="mb-3"> | |
| 139 | + <a class="btn btn-success" id="qcld_save_openrouter_setting"><?php esc_html_e( 'Save settings','chatbot');?></a> | |
| 140 | + </div> | |
| 141 | + </div> | |
| 142 | + <div class="qcld-row"> | |
| 143 | + <div class="alert alert-info mt-20" role="alert"> | |
| 144 | + <p><b><?php echo esc_html__( 'Fine Tuning VS GPT Assistants VS RAG:', 'chatbot'); ?></b></p> | |
| 145 | + <p> | |
| 146 | + <?php echo esc_html__( 'We suggest using GPT Assistants or RAG instead of Fine Tuning as Fine Tuning requires a lot of properly formatted data and GPT Assistants are easier to set up. You can still use your website data to train the bot.', 'chatbot'); ?> | |
| 147 | + </p></br> | |
| 148 | + <p> | |
| 149 | + <b><?php echo esc_html__( 'How to Use RAG in This Plugin:', 'chatbot'); ?></b> | |
| 150 | + <ol> | |
| 151 | + <li><?php echo esc_html__( 'Enable RAG from the settings panel', 'chatbot'); ?></li> | |
| 152 | + <li><?php echo esc_html__( 'Click “Embed All Selected Sources” button, after selecting the sources from the', 'chatbot'); ?> <a href="<?php echo admin_url('admin.php?page=wpbot_openAi#ai-knowledge-base-tab'); ?>" target="_blank">knowledgebase tab</a></li> | |
| 153 | + <li><?php echo esc_html__( '(Optional) Upload PDFs or CSV files for embedding', 'chatbot'); ?></li> | |
| 154 | + <li><?php echo esc_html__( 'The system automatically stores embeddings in the database', 'chatbot'); ?></li> | |
| 155 | + <li><?php echo esc_html__( 'User questions will now be answered using your site’s knowledge base', 'chatbot'); ?></li> | |
| 156 | + <li><?php echo esc_html__( 'You need to configure the OpenAI API key, AI Model and System Command under the main OpenAI Settings', 'chatbot'); ?></li> | |
| 157 | + </ol> | |
| 158 | + <strong><?php echo esc_html__( 'You can update or re-embed content at any time without retraining.', 'chatbot'); ?></strong> | |
| 159 | + </p> | |
| 160 | + | |
| 161 | + </div> | |
| 162 | + | |
| 163 | + </div> | |
| 164 | + </div> | |
| 165 | + </div> | |
| 166 | + <div id="wp-chatbot-openrouter-help" class="tab-pane"> | |
| 167 | + <div class="accordion" id="qcldopenaiaccordion"> | |
| 168 | + <div class="card"> | |
| 169 | + <div class="card-header" id="panelsStayOpen-headingZero-openrouter"> | |
| 170 | + <h2 class="mb-0"> | |
| 171 | + <button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseZero-openrouter" aria-expanded="true" aria-controls="panelsStayOpen-collapseZero-openrouter"> | |
| 172 | + <?php esc_html_e( 'Getting Started with openrouter','chatbot');?> | |
| 173 | + </button> | |
| 174 | + </h2> | |
| 175 | + </div> | |
| 176 | + <div id="panelsStayOpen-collapseZero-openrouter" class="collapse" aria-labelledby="panelsStayOpen-headingZero-openrouter" data-parent="#qcldopenaiaccordion"> | |
| 177 | + <div class="card-body-openrouter"> | |
| 178 | + <h5><?php esc_html_e( 'OpenRouter is an unified Interface or Aggregator for LLMs. You can choose from hundreds of different AI models from OpenAI to Deepseek or Claude to get AI responses.','chatbot');?></h5> | |
| 179 | + <h5><?php esc_html_e( 'All you have to do is add the OpenRouter API Key and select an OpenRouter Model.','chatbot');?></h5> | |
| 180 | + <h5><?php esc_html_e( 'Grab your OpenAI API key from','chatbot');?> <a href="https://openrouter.ai/settings/keys">HERE</a></h5> | |
| 181 | + <p><?php esc_html_e( 'Please make sure that DialogFlow, OpenAI are Disabled if you want OpenRouter to work.','chatbot');?></p> | |
| 182 | + </div> | |
| 183 | + </div> | |
| 184 | + </div> | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + </div> | |
| 189 | + </div> | |
| 190 | + </div> | |
| 192 | 191 | </div> |