| @@ -1,204 +1,203 @@ | ||
| 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-gemini-settings"><i class="dashicons dashicons-admin-home"></i><?php echo esc_html__('Gemini settings', 'chatbot'); ?></a></li> | |
| 8 | - <li><a data-toggle="tab" href="#wp-chatbot-gemini-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-gemini-help"><i class="dashicons dashicons-editor-help"></i><?php echo esc_html__('Gemini Help', 'chatbot'); ?></a></li> | |
| 10 | - </ul> | |
| 11 | - | |
| 12 | - <div class="tab-content"> | |
| 13 | - <div id="wp-chatbot-gemini-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_gemini_enabled') == 1) ? esc_attr('checked','chatbot') :'';?> role="switch" value="" id="<?php esc_attr_e('qcld_gemini_enabled','chatbot'); ?>"> | |
| 20 | - <label class="form-check-label" for="<?php esc_attr_e('qcld_gemini_enabled','chatbot'); ?>"> | |
| 21 | - <?php esc_html_e('Enable Gemini AI','chatbot'); ?><span style="color:red"> <?php esc_html_e('(if you want results from Gemini only, disable Site Search from Settings->Action 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('gemeni_context_awareness_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="gemini_is_context_awareness_enabled"> | |
| 29 | - <label class="form-check-label" for="gemini_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_gemini_page_suggestion_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="qcld_gemini_page_suggestion_enabled"> | |
| 39 | - <label class="form-check-label" for="<?php esc_attr_e( 'qcld_gemini_page_suggestion_enabled','chatbot'); ?>"> | |
| 40 | - <?php esc_html_e( 'Enable page suggestions with Gemini 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_gemini_search_posttypes_<?php echo esc_html( $post_type->name ); ?>" | |
| 61 | - type="checkbox" | |
| 62 | - name="site_gemini_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_gemini_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_gemini_api_key" class="form-label"><?php esc_html_e('Gemini API Key','chatbot');?></label> | |
| 88 | - <input type="password" class="form-control" id="qcld_gemini_api_key" name="qcld_gemini_api_key" placeholder="Enter your Gemini API Key" value="<?php echo esc_attr(get_option('qcld_gemini_api_key')); ?>"> | |
| 89 | - <small class="form-text text-muted"><?php esc_html_e('Get your API key from https://aistudio.google.com/app/api-keys. ','chatbot'); ?></br><span style="color:red"><?php esc_html_e('It requires a paid Gemini API plan', 'chatbot'); ?> </span></small> | |
| 90 | - </div> | |
| 91 | - </div> | |
| 92 | - <div class="row gx-0"> | |
| 93 | - <div class="mb-3 form-check "> | |
| 94 | - <label for="qcld_gemini_model" class="form-label"><?php esc_html_e('Gemini Model','chatbot');?></label> | |
| 95 | - <div class="input-group"> | |
| 96 | - <select class="form-control" id="qcld_gemini_model" name="qcld_gemini_model"> | |
| 97 | - <?php | |
| 98 | - $selected_model = get_option('qcld_gemini_model'); | |
| 99 | - if($selected_model){ | |
| 100 | - echo '<option value="'.esc_attr($selected_model).'" selected>'.esc_html($selected_model).'</option>'; | |
| 101 | - } else { | |
| 102 | - echo '<option value="gemini-2.5-flash" selected>gemini-2.5-flash</option>'; | |
| 103 | - } | |
| 104 | - ?> | |
| 105 | - </select> | |
| 106 | - <button type="button" class="btn btn-primary" id="qcld_gemini_fetch_models"><?php esc_html_e('Fetch Models', 'chatbot'); ?></button> | |
| 107 | - </div> | |
| 108 | - <small class="form-text text-muted"><?php esc_html_e('Select your Gemini model. Click "Fetch Models" to update the list if you just added your API key.','chatbot'); ?><br><span style="color:red"><?php esc_html_e('Please select a your paid model all model on the list are might not be available for free plans', 'chatbot'); ?> </span></small> | |
| 109 | - </div> | |
| 110 | - </div> | |
| 111 | - <div class="row g-0"> | |
| 112 | - | |
| 113 | - <div class="row gx-0"> | |
| 114 | - <div class="mb-3 form-check "> | |
| 115 | - <label for="qcld_gemini_prepend_content" class="form-label"><?php esc_html_e('Your Prompt to be Added before the User Query for Customized Results (Optional)','chatbot');?></label> | |
| 116 | - <input type="text" class="form-control" id="qcld_gemini_prepend_content" name="qcld_gemini_prepend_content" placeholder="Content for the response" value="<?php echo esc_attr( get_option('qcld_gemini_prepend_content') ); ?>"> | |
| 117 | - | |
| 118 | - </div> | |
| 119 | - </div> | |
| 120 | - | |
| 121 | - <div class="row gx-0"> | |
| 122 | - <div class="mb-3 form-check "> | |
| 123 | - <label for="qcld_gemini_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> | |
| 124 | - <input type="text" class="form-control" id="qcld_gemini_append_content" name="qcld_gemini_append_content" placeholder="Content for the response" value="<?php echo esc_attr( get_option('qcld_gemini_append_content') ); ?>"> | |
| 125 | - | |
| 126 | - </div> | |
| 127 | - </div> | |
| 128 | - </div> | |
| 129 | - <div class="mb-3"> | |
| 130 | - <a class="btn btn-success" id="qcld_save_gemini_setting"><?php esc_html_e('Save settings','chatbot');?></a> | |
| 131 | - </div> | |
| 132 | - </div> | |
| 133 | - | |
| 134 | - | |
| 135 | - </div> | |
| 136 | - <div id="wp-chatbot-gemini-rag" class="tab-pane"> | |
| 137 | - <div class="col-sm-12"> | |
| 138 | - <div class="wrap"> | |
| 139 | - <h3>Gemini RAG Settings</h3> | |
| 140 | - <p>If you enable RAG, you must configure the <a id="ai-knowledge-base-tab-gemini" 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><span style="color:red"><?php esc_html_e('It requires a paid Gemini API plan', 'chatbot'); ?> </span> | |
| 141 | - <div class="form-check form-switch my-4"> | |
| 142 | - <input class="form-check-input" | |
| 143 | - type="checkbox" | |
| 144 | - id="is_page_rag_enabled_gemini" | |
| 145 | - <?php echo (get_option('is_page_rag_enabled') == '1') ? 'checked' : ''; ?>> | |
| 146 | - <label class="form-check-label" for="is_page_rag_enabled_gemini"> | |
| 147 | - Enable RAG | |
| 148 | - </label> | |
| 149 | - </div> | |
| 150 | - <div class="mb-3"> | |
| 151 | - <a class="btn btn-success" id="qcld_save_gemini_setting"><?php esc_html_e( 'Save settings','chatbot');?></a> | |
| 152 | - </div> | |
| 153 | - </div> | |
| 154 | - <div class="qcld-row"> | |
| 155 | - <div class="alert alert-info mt-20" role="alert"> | |
| 156 | - <p><b><?php echo esc_html__( 'Fine Tuning VS GPT Assistants VS RAG:', 'chatbot'); ?></b></p> | |
| 157 | - <p> | |
| 158 | - <?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'); ?> | |
| 159 | - </p></br> | |
| 160 | - <p> | |
| 161 | - <b><?php echo esc_html__( 'How to Use RAG in This Plugin:', 'chatbot'); ?></b> | |
| 162 | - <ol> | |
| 163 | - <li><?php echo esc_html__( 'Enable RAG from the settings panel', 'chatbot'); ?></li> | |
| 164 | - <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> | |
| 165 | - <li><?php echo esc_html__( '(Optional) Upload PDFs or CSV files for embedding', 'chatbot'); ?></li> | |
| 166 | - <li><?php echo esc_html__( 'The system automatically stores embeddings in the database', 'chatbot'); ?></li> | |
| 167 | - <li><?php echo esc_html__( 'User questions will now be answered using your site’s knowledge base', 'chatbot'); ?></li> | |
| 168 | - <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> | |
| 169 | - </ol> | |
| 170 | - <strong><?php echo esc_html__( 'You can update or re-embed content at any time without retraining.', 'chatbot'); ?></strong> | |
| 171 | - </p> | |
| 172 | - | |
| 173 | - </div> | |
| 174 | - | |
| 175 | - </div> | |
| 176 | - </div> | |
| 177 | - </div> | |
| 178 | - <div id="wp-chatbot-gemini-help" class="tab-pane"> | |
| 179 | - <div class="accordion" id="qcldopenaiaccordion"> | |
| 180 | - <div class="card"> | |
| 181 | - <div class="card-header" id="panelsStayOpen-headingZero-gemini"> | |
| 182 | - <h2 class="mb-0"> | |
| 183 | - <button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseZero-gemini" aria-expanded="true" aria-controls="panelsStayOpen-collapseZero-gemini"> | |
| 184 | - <?php esc_html_e( 'Getting Started with gemini','chatbot');?> | |
| 185 | - </button> | |
| 186 | - </h2> | |
| 187 | - </div> | |
| 188 | - <div id="panelsStayOpen-collapseZero-gemini" class="collapse" aria-labelledby="panelsStayOpen-headingZero-gemini" data-parent="#qcldopenaiaccordion"> | |
| 189 | - <div class="card-body-gemini"> | |
| 190 | - <h5><?php esc_html_e( 'Gemini 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> | |
| 191 | - <h5><?php esc_html_e( 'All you have to do is add the Gemini API Key and select an Gemini Model.','chatbot');?></h5> | |
| 192 | - <h5><?php esc_html_e( 'Grab your OpenAI API key from','chatbot');?> <a href="https://gemini.ai/settings/keys">HERE</a></h5> | |
| 193 | - <p><?php esc_html_e( 'Please make sure that DialogFlow, OpenAI are Disabled if you want Gemini to work.','chatbot');?></p> | |
| 194 | - </div> | |
| 195 | - </div> | |
| 196 | - </div> | |
| 197 | - | |
| 198 | - | |
| 199 | - | |
| 200 | - </div> | |
| 201 | - </div> | |
| 202 | - </div> | |
| 203 | - </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-gemini-settings"><i class="dashicons dashicons-admin-home"></i><?php echo esc_html__('Gemini settings', 'chatbot'); ?></a></li> | |
| 7 | + <li><a data-toggle="tab" href="#wp-chatbot-gemini-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-gemini-help"><i class="dashicons dashicons-editor-help"></i><?php echo esc_html__('Gemini Help', 'chatbot'); ?></a></li> | |
| 9 | + </ul> | |
| 10 | + | |
| 11 | + <div class="tab-content"> | |
| 12 | + <div id="wp-chatbot-gemini-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_gemini_enabled') == 1) ? esc_attr('checked','chatbot') :'';?> role="switch" value="" id="<?php esc_attr_e('qcld_gemini_enabled','chatbot'); ?>"> | |
| 19 | + <label class="form-check-label" for="<?php esc_attr_e('qcld_gemini_enabled','chatbot'); ?>"> | |
| 20 | + <?php esc_html_e('Enable Gemini AI','chatbot'); ?><span style="color:red"> <?php esc_html_e('(if you want results from Gemini 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('gemeni_context_awareness_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="gemini_is_context_awareness_enabled"> | |
| 28 | + <label class="form-check-label" for="gemini_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_gemini_page_suggestion_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="qcld_gemini_page_suggestion_enabled"> | |
| 38 | + <label class="form-check-label" for="<?php esc_attr_e( 'qcld_gemini_page_suggestion_enabled','chatbot'); ?>"> | |
| 39 | + <?php esc_html_e( 'Enable page suggestions with Gemini 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_gemini_search_posttypes_<?php echo esc_html( $post_type->name ); ?>" | |
| 60 | + type="checkbox" | |
| 61 | + name="site_gemini_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_gemini_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_gemini_api_key" class="form-label"><?php esc_html_e('Gemini API Key','chatbot');?></label> | |
| 87 | + <input type="password" class="form-control" id="qcld_gemini_api_key" name="qcld_gemini_api_key" placeholder="Enter your Gemini API Key" value="<?php echo esc_attr(get_option('qcld_gemini_api_key')); ?>"> | |
| 88 | + <small class="form-text text-muted"><?php esc_html_e('Get your API key from https://aistudio.google.com/app/apikey. ','chatbot'); ?></br><span style="color:red"><?php esc_html_e('It requires a paid Gemini API plan', 'chatbot'); ?> </span></small> | |
| 89 | + </div> | |
| 90 | + </div> | |
| 91 | + <div class="row gx-0"> | |
| 92 | + <div class="mb-3 form-check "> | |
| 93 | + <label for="qcld_gemini_model" class="form-label"><?php esc_html_e('Gemini Model','chatbot');?></label> | |
| 94 | + <div class="input-group"> | |
| 95 | + <select class="form-control" id="qcld_gemini_model" name="qcld_gemini_model"> | |
| 96 | + <?php | |
| 97 | + $selected_model = get_option('qcld_gemini_model'); | |
| 98 | + if($selected_model){ | |
| 99 | + echo '<option value="'.esc_attr($selected_model).'" selected>'.esc_html($selected_model).'</option>'; | |
| 100 | + } else { | |
| 101 | + echo '<option value="gemini-2.5-flash" selected>gemini-2.5-flash</option>'; | |
| 102 | + } | |
| 103 | + ?> | |
| 104 | + </select> | |
| 105 | + <button type="button" class="btn btn-primary" id="qcld_gemini_fetch_models"><?php esc_html_e('Fetch Models', 'chatbot'); ?></button> | |
| 106 | + </div> | |
| 107 | + <small class="form-text text-muted"><?php esc_html_e('Select your Gemini model. Click "Fetch Models" to update the list if you just added your API key.','chatbot'); ?><br><span style="color:red"><?php esc_html_e('Please select a your paid model all model on the list are might not be available for free plans', 'chatbot'); ?> </span></small> | |
| 108 | + </div> | |
| 109 | + </div> | |
| 110 | + <div class="row g-0"> | |
| 111 | + | |
| 112 | + <div class="row gx-0"> | |
| 113 | + <div class="mb-3 form-check "> | |
| 114 | + <label for="qcld_gemini_prepend_content" class="form-label"><?php esc_html_e('Your Prompt to be Added before the User Query for Customized Results (Optional)','chatbot');?></label> | |
| 115 | + <input type="text" class="form-control" id="qcld_gemini_prepend_content" name="qcld_gemini_prepend_content" placeholder="Content for the response" value="<?php echo esc_attr( get_option('qcld_gemini_prepend_content') ); ?>"> | |
| 116 | + | |
| 117 | + </div> | |
| 118 | + </div> | |
| 119 | + | |
| 120 | + <div class="row gx-0"> | |
| 121 | + <div class="mb-3 form-check "> | |
| 122 | + <label for="qcld_gemini_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> | |
| 123 | + <input type="text" class="form-control" id="qcld_gemini_append_content" name="qcld_gemini_append_content" placeholder="Content for the response" value="<?php echo esc_attr( get_option('qcld_gemini_append_content') ); ?>"> | |
| 124 | + | |
| 125 | + </div> | |
| 126 | + </div> | |
| 127 | + </div> | |
| 128 | + <div class="mb-3"> | |
| 129 | + <a class="btn btn-success" id="qcld_save_gemini_setting"><?php esc_html_e('Save settings','chatbot');?></a> | |
| 130 | + </div> | |
| 131 | + </div> | |
| 132 | + | |
| 133 | + | |
| 134 | + </div> | |
| 135 | + <div id="wp-chatbot-gemini-rag" class="tab-pane"> | |
| 136 | + <div class="col-sm-12"> | |
| 137 | + <div class="wrap"> | |
| 138 | + <h3>Gemini RAG Settings</h3> | |
| 139 | + <p>If you enable RAG, you must configure the <a id="ai-knowledge-base-tab-gemini" 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><span style="color:red"><?php esc_html_e('It requires a paid Gemini API plan', 'chatbot'); ?> </span> | |
| 140 | + <div class="form-check form-switch my-4"> | |
| 141 | + <input class="form-check-input" | |
| 142 | + type="checkbox" | |
| 143 | + id="is_page_rag_enabled_gemini" | |
| 144 | + <?php echo (get_option('is_page_rag_enabled') == '1') ? 'checked' : ''; ?>> | |
| 145 | + <label class="form-check-label" for="is_page_rag_enabled_gemini"> | |
| 146 | + Enable RAG | |
| 147 | + </label> | |
| 148 | + </div> | |
| 149 | + <div class="mb-3"> | |
| 150 | + <a class="btn btn-success" id="qcld_save_gemini_setting"><?php esc_html_e( 'Save settings','chatbot');?></a> | |
| 151 | + </div> | |
| 152 | + </div> | |
| 153 | + <div class="qcld-row"> | |
| 154 | + <div class="alert alert-info mt-20" role="alert"> | |
| 155 | + <p><b><?php echo esc_html__( 'Fine Tuning VS GPT Assistants VS RAG:', 'chatbot'); ?></b></p> | |
| 156 | + <p> | |
| 157 | + <?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'); ?> | |
| 158 | + </p></br> | |
| 159 | + <p> | |
| 160 | + <b><?php echo esc_html__( 'How to Use RAG in This Plugin:', 'chatbot'); ?></b> | |
| 161 | + <ol> | |
| 162 | + <li><?php echo esc_html__( 'Enable RAG from the settings panel', 'chatbot'); ?></li> | |
| 163 | + <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> | |
| 164 | + <li><?php echo esc_html__( '(Optional) Upload PDFs or CSV files for embedding', 'chatbot'); ?></li> | |
| 165 | + <li><?php echo esc_html__( 'The system automatically stores embeddings in the database', 'chatbot'); ?></li> | |
| 166 | + <li><?php echo esc_html__( 'User questions will now be answered using your site’s knowledge base', 'chatbot'); ?></li> | |
| 167 | + <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> | |
| 168 | + </ol> | |
| 169 | + <strong><?php echo esc_html__( 'You can update or re-embed content at any time without retraining.', 'chatbot'); ?></strong> | |
| 170 | + </p> | |
| 171 | + | |
| 172 | + </div> | |
| 173 | + | |
| 174 | + </div> | |
| 175 | + </div> | |
| 176 | + </div> | |
| 177 | + <div id="wp-chatbot-gemini-help" class="tab-pane"> | |
| 178 | + <div class="accordion" id="qcldopenaiaccordion"> | |
| 179 | + <div class="card"> | |
| 180 | + <div class="card-header" id="panelsStayOpen-headingZero-gemini"> | |
| 181 | + <h2 class="mb-0"> | |
| 182 | + <button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseZero-gemini" aria-expanded="true" aria-controls="panelsStayOpen-collapseZero-gemini"> | |
| 183 | + <?php esc_html_e( 'Getting Started with gemini','chatbot');?> | |
| 184 | + </button> | |
| 185 | + </h2> | |
| 186 | + </div> | |
| 187 | + <div id="panelsStayOpen-collapseZero-gemini" class="collapse" aria-labelledby="panelsStayOpen-headingZero-gemini" data-parent="#qcldopenaiaccordion"> | |
| 188 | + <div class="card-body-gemini"> | |
| 189 | + <h5><?php esc_html_e( 'Gemini 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> | |
| 190 | + <h5><?php esc_html_e( 'All you have to do is add the Gemini API Key and select an Gemini Model.','chatbot');?></h5> | |
| 191 | + <h5><?php esc_html_e( 'Grab your OpenAI API key from','chatbot');?> <a href="https://gemini.ai/settings/keys">HERE</a></h5> | |
| 192 | + <p><?php esc_html_e( 'Please make sure that DialogFlow, OpenAI are Disabled if you want Gemini to work.','chatbot');?></p> | |
| 193 | + </div> | |
| 194 | + </div> | |
| 195 | + </div> | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + </div> | |
| 200 | + </div> | |
| 201 | + </div> | |
| 202 | + </div> | |
| 204 | 203 | |