| @@ -1,165 +1,159 @@ | ||
| 1 | -<div class="row g-0"> | |
| 2 | - <div class="col-sm-6"> | |
| 3 | - <div class="form-check form-switch my-4"> | |
| 4 | - <input class="form-check-input" type="checkbox" <?php | |
| 5 | - if (!defined('ABSPATH')) exit; // Exit if accessed directly | |
| 6 | - echo (get_option( 'ai_enabled') == 1) ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_ai_enabled"> | |
| 7 | - <label class="form-check-label" for="is_ai_enabled"> | |
| 8 | - <?php esc_html_e( 'Enable OpenAI','chatbot'); ?> | |
| 9 | - </label> | |
| 10 | - <span style="color:red"> <?php esc_html_e( '(if you want results from OpenAI only, disable Site Search from Settings->Start Menu)','chatbot'); ?></span> | |
| 11 | - </div> | |
| 12 | - </div> | |
| 13 | - <div class="col-sm-6"> | |
| 14 | - <div class="mb-3"> | |
| 15 | - <div class="form-check form-switch my-4"> | |
| 16 | - <input class="form-check-input" type="checkbox" <?php echo ( get_option( 'is_stream_enabled', '1' ) == '1' ) ? esc_attr( 'checked', 'chatbot' ) : ''; ?> role="switch" value="" id="is_stream_enabled"> | |
| 17 | - <label class="form-check-label" for="is_stream_enabled"> | |
| 18 | - <?php esc_html_e( 'Enable Streaming ', 'chatbot' ); ?> | |
| 19 | - </label> | |
| 20 | - <span> <?php esc_html_e( '(stream AI responses in real-time as they are generated)', 'chatbot' ); ?></span> | |
| 21 | - | |
| 22 | - </div> | |
| 23 | - </div> | |
| 24 | - </div> | |
| 25 | -</div> | |
| 26 | -<div class="row g-0"> | |
| 27 | - <div class="col-sm-12"> | |
| 28 | - <!-- /POST TYPE --> | |
| 29 | - <div class="mb-3 form-check"> | |
| 30 | - <label for="api_key" class="form-label"><?php esc_html_e( 'Api key','chatbot');?></label> | |
| 31 | - <input type="password" class="form-control" id="api_key" name="api_key" placeholder="Api key" value="<?php echo esc_attr(get_option( 'open_ai_api_key')); ?>"> | |
| 32 | - <span><?php esc_html_e('Get your API key from','chatbot'); ?> <a href="https://platform.openai.com/settings/organization/api-keys" target="_blank"><?php esc_html_e('HERE','chatbot'); ?></a></span><br> | |
| 33 | - <span style="color:red"><?php esc_html_e('It requires a paid OpenAI API plan', 'chatbot'); ?> </span> | |
| 34 | - </div> | |
| 35 | - <div class="mb-3 form-check"> | |
| 36 | - <label for="qcld_openai_system_content"><?php esc_attr_e( 'System Command (Use it to Instruct ChatGPT how to behave). You can write a detailed prompt here that includes details about your services, products, and how to contact you or anything relevant to get','chatbot');?> <span class="qcls_openAI_customized"><?php esc_attr_e( 'Customized Results','chatbot');?></span> <?php esc_attr_e( '. Upto 3000 words is fine.','chatbot');?> | |
| 37 | - | |
| 38 | - <br><br> | |
| 39 | - | |
| 40 | - </label> | |
| 41 | - <textarea type="text" class="form-control" id="qcld_openai_system_content" placeholder="<?php echo esc_attr('You are a helpful and intelligent assistant for the website "' . site_url() . '". Use live website data and the provided context to respond accurately and briefly. Stay relevant and do not introduce additional topics.','chatbot'); ?>"><?php echo esc_html( get_option( 'qcld_openai_system_content')); ?></textarea> | |
| 42 | - <label><small><?php esc_html_e("To set the ChatBot's tone and character set a system message according to your need",'chatbot'); ?></small></label></br> | |
| 43 | - <label><small><?php esc_html_e("Example: You are a helpful and intelligent assistant for the website " . site_url() . ". Use live website data and the provided context to respond accurately and briefly. Stay relevant and do not introduce additional topics.",'chatbot'); ?></small></label> | |
| 44 | - </div> | |
| 45 | - <div class="form-check form-switch my-4"> | |
| 46 | - <input class="form-check-input" type="checkbox" <?php echo (get_option('context_awareness_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_context_awareness_enabled"> | |
| 47 | - <label class="form-check-label" for="is_context_awareness_enabled"> | |
| 48 | - <?php esc_html_e( 'Context awareness','chatbot'); ?> | |
| 49 | - </label> | |
| 50 | - | |
| 51 | - </div> | |
| 52 | - <div class="form-check form-switch my-4"> | |
| 53 | - <input class="form-check-input" type="checkbox" <?php echo (get_option('page_suggestion_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_page_suggestion_enabled"> | |
| 54 | - <label class="form-check-label" for="is_page_suggestion_enabled"> | |
| 55 | - <?php esc_html_e( 'Enable WordPress page suggestions with GPT Results (the links are suggested by WordPress and not AI)','chatbot'); ?> | |
| 56 | - </label> | |
| 57 | - </div> | |
| 58 | - | |
| 59 | - <!-- POST TYPE --> | |
| 60 | - <div class="form-check form-switch my-4"> | |
| 61 | - <label><?php esc_html_e( 'Select POST TYPE(s) to include with search results', 'chatbot' ); ?></label> | |
| 62 | - <div id="wp-chatbot-post-converter"> | |
| 63 | - <ul class="checkbox-list"> | |
| 64 | - <?php | |
| 65 | - $get_cpt_args = array( | |
| 66 | - 'public' => true, | |
| 67 | - ); | |
| 68 | - $post_types = get_post_types( $get_cpt_args, 'object' ); | |
| 69 | - | |
| 70 | - foreach ($post_types as $post_type) { | |
| 71 | - if ($post_type->name != 'attachment') { | |
| 72 | - $is_pro = !in_array($post_type->name, ['post', 'page']); | |
| 73 | - ?> | |
| 74 | - <div class="form-check form-check-inline"> | |
| 75 | - <input | |
| 76 | - id="site_search_posttypes_<?php echo esc_html( $post_type->name ); ?>" | |
| 77 | - type="checkbox" | |
| 78 | - name="site_search_posttypes[]" | |
| 79 | - value="<?php echo esc_html( $post_type->name ); ?>" | |
| 80 | - <?php echo (($is_pro) ? 'disabled' : ''); ?> | |
| 81 | - | |
| 82 | - <?php echo ((get_option('qcld_openai_relevant_post') != '') && in_array($post_type->name, get_option('qcld_openai_relevant_post'))) ? 'checked' : ''; ?>> | |
| 83 | - <label class="form-check-label <?php echo ($is_pro ? 'pro-locked' : ''); ?>" for="site_search_posttypes_<?php echo esc_html( $post_type->name ); ?>"> | |
| 84 | - <?php echo esc_html( $post_type->name ); ?> | |
| 85 | - <?php if ($is_pro) { ?> | |
| 86 | - <span class="pro-badge">PRO</span> | |
| 87 | - <?php } ?> | |
| 88 | - </label> | |
| 89 | - </div> | |
| 90 | - <?php | |
| 91 | - } | |
| 92 | - } | |
| 93 | - ?> | |
| 94 | - </ul> | |
| 95 | - </div> | |
| 96 | - </div> | |
| 97 | - | |
| 98 | - | |
| 99 | - | |
| 100 | - | |
| 101 | - <div class="qcld-wpbot-pricing-filter-form-check"> | |
| 102 | - </div> | |
| 103 | - <div class="mb-3 form-check"> | |
| 104 | - <label for="max_tokens" id="openai_engines" class="form-label"><?php esc_html_e( 'OpenAI Model','chatbot');?></label> | |
| 105 | - <select class="form-select" aria-label="Default select example" name="openai_engines" id="openai_engines"> | |
| 106 | - <option value="gpt-5.5" <?php echo ((get_option( 'openai_engines') == 'gpt-5.5') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5.5','chatbot');?></option> | |
| 107 | - <option value="gpt-5.4-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-5.4-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5.4-Mini','chatbot');?></option> | |
| 108 | - <option value="gpt-5.4-nano" <?php echo ((get_option( 'openai_engines') == 'gpt-5.4-nano') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5.4-Nano','chatbot');?></option> | |
| 109 | - <option value="gpt-5-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-5-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5-Mini','chatbot');?></option> | |
| 110 | - <option value="gpt-5-nano" <?php echo ((get_option( 'openai_engines') == 'gpt-5-nano') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5-Nano','chatbot');?></option> | |
| 111 | - <option value="gpt-5" <?php echo ((get_option( 'openai_engines') == 'gpt-5') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5','chatbot');?></option> | |
| 112 | - <option value="gpt-4.1-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-4.1-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4.1-Mini','chatbot');?></option> | |
| 113 | - <option value="gpt-4.1-nano" <?php echo ((get_option( 'openai_engines') == 'gpt-4.1-nano') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4.1-Nano','chatbot');?></option> | |
| 114 | - <option value="gpt-4.1" <?php echo ((get_option( 'openai_engines') == 'gpt-4.1') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4.1','chatbot');?></option> | |
| 115 | - <option value="gpt-4o-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-4o-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4o-Mini','chatbot');?></option> | |
| 116 | - <option value="gpt-4o" <?php echo ((get_option( 'openai_engines') == 'gpt-4o') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4o','chatbot');?></option> | |
| 117 | - <option value="gpt-4-turbo" <?php echo ((get_option( 'openai_engines') == 'gpt-4-turbo') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'gpt-4-turbo','chatbot');?></option> | |
| 118 | - <option value="gpt-4" <?php echo ((get_option( 'openai_engines') == 'gpt-4') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4','chatbot');?></option> | |
| 119 | - <option value="gpt-3.5-turbo" <?php echo ((get_option( 'openai_engines') == 'gpt-3.5-turbo') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-3 turbo','chatbot'); ?></option> | |
| 120 | - </select> | |
| 121 | - </div> | |
| 122 | - | |
| 123 | - | |
| 124 | - <div class="mb-3 form-check"> | |
| 125 | - <label for="qcld_openai_append_content"><?php esc_attr_e( 'Prompt to be Appended at the End of the User Query (Optional)','chatbot');?></label> | |
| 126 | - <textarea type="text" class="form-control" id="qcld_openai_append_content" placeholder="<?php echo esc_attr('Content for the response'); ?>"><?php echo esc_html( get_option( 'qcld_openai_append_content')); ?></textarea> | |
| 127 | - | |
| 128 | - </div> | |
| 129 | - <div class="alert alert-warning"> | |
| 130 | - <p> <?php echo esc_html('Danger Zone (you may not get any responses from AI if the keywords are not set properly. Remove keywords if you face problems )'); ?></p> | |
| 131 | - </div> | |
| 132 | - <div class="mb-3 form-check"> | |
| 133 | - <label for="qcld_openai_include_keyword"><?php esc_attr_e( 'Connect to OpenAI only when user query includes one of the following Comma Separated Keywords','chatbot');?></label> | |
| 134 | - <textarea type="text" class="form-control" id="qcld_openai_include_keyword"><?php echo esc_attr( get_option( 'openai_include_keyword')); ?></textarea> | |
| 135 | - </div> | |
| 136 | - <div class="mb-3 form-check"> | |
| 137 | - <label for="qcld_openai_exclude_keyword"><?php esc_attr_e( 'Connect to OpenAI only when user query does NOT include one of the following Comma Separated Keywords','chatbot');?></label> | |
| 138 | - <textarea type="text" class="form-control" id="qcld_openai_exclude_keyword"><?php echo esc_attr( get_option( 'openai_exclude_keyword')); ?></textarea> | |
| 139 | - </div> | |
| 140 | - <div class="mb-3"> | |
| 141 | - <div class="form-check form-switch my-4"> | |
| 142 | - <input class="form-check-input" type="checkbox" <?php echo (get_option( 'qcld_openai_relevant_enabled') == 1) ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_relevant_enabled"> | |
| 143 | - <label class="form-check-label" for="is_relevant_enabled"> | |
| 144 | - <?php esc_html_e( 'Ask OpenAI to reply when question is relevant to above Keywords (Enabling this option will improve accuracy but it will use OpenAI Tokens)','chatbot'); ?> | |
| 145 | - </label> | |
| 146 | - </div> | |
| 147 | - </div> | |
| 148 | - | |
| 149 | - | |
| 150 | - <div class="mb-3"> | |
| 151 | - <a class="btn btn-success" id="save_setting"><?php esc_html_e( 'Save settings','chatbot');?></a> | |
| 152 | - </div> | |
| 153 | - </br> | |
| 154 | - <div class="mb-3 form-check"> | |
| 155 | - <a class="btn btn-warning" id="qcld_check_connection"><?php esc_html_e( 'Check Connection ','chatbot');?><i class="dashicons dashicons-image-rotate" id="rotationloader"></i></a> <?php echo esc_html('Save the Settings first and then press the Check Connection button'); ?><br/> | |
| 156 | - <div id="qcld_openAI_trubleshooter"></div> | |
| 157 | - </div> | |
| 158 | - <div class="alert alert-danger"> | |
| 159 | - <p> <?php echo esc_html('**If OpenAI is not responding back and the bot is just loading, then likely you hit your OpenAI usage limit. Please pre-purchase credit to use OpenAI API and increase the Usage limit. You can add credits to your API account by visiting the '); ?> <a href="https://platform.openai.com/account/billing"><?php echo esc_html('billing page.'); ?></a></p> | |
| 160 | - <p> | |
| 161 | - <a href="https://wpbot.pro/docs/knowledgebase/how-to-save-money-and-reduce-openai-api-cost-for-your-chatbot/"> <?php echo esc_html('How to reduce cost '); ?></a><?php echo esc_html('and save money on OpenAI API cost for your ChatBot.'); ?> | |
| 162 | - </p> | |
| 163 | - </div> | |
| 164 | - </div> | |
| 165 | -</div> | |
| 1 | +<div class="row g-0"> | |
| 2 | + <div class="col-sm-12"> | |
| 3 | + <div class="form-check form-switch my-4"> | |
| 4 | + <input class="form-check-input" type="checkbox" <?php | |
| 5 | +if (!defined('ABSPATH')) exit; // Exit if accessed directly | |
| 6 | +echo (get_option( 'ai_enabled') == 1) ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_ai_enabled"> | |
| 7 | + <label class="form-check-label" for="is_ai_enabled"> | |
| 8 | + <?php esc_html_e( 'Enable OpenAI','chatbot'); ?><span style="color:red"> <?php esc_html_e( '(if you want results from OpenAI only, disable Site Search from Settings->Start Menu)','chatbot'); ?></span> | |
| 9 | + </label> | |
| 10 | + </div> | |
| 11 | + <div class="mb-3"> | |
| 12 | + <div class="form-check form-switch my-4"> | |
| 13 | + <input class="form-check-input" type="checkbox" <?php echo ( get_option( 'is_stream_enabled', '1' ) == '1' ) ? esc_attr( 'checked', 'chatbot' ) : ''; ?> role="switch" value="" id="is_stream_enabled"> | |
| 14 | + <label class="form-check-label" for="is_stream_enabled"> | |
| 15 | + <?php esc_html_e( 'Enable Streaming (stream AI responses in real-time as they are generated)', 'chatbot' ); ?> | |
| 16 | + </label> | |
| 17 | + </div> | |
| 18 | + </div> | |
| 19 | + <div class="form-check form-switch my-4"> | |
| 20 | + <input class="form-check-input" type="checkbox" <?php echo (get_option('context_awareness_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_context_awareness_enabled"> | |
| 21 | + <label class="form-check-label" for="is_context_awareness_enabled"> | |
| 22 | + <?php esc_html_e( 'Context awareness','chatbot'); ?> | |
| 23 | + </label> | |
| 24 | + | |
| 25 | + </div> | |
| 26 | + <div class="form-check form-switch my-4"> | |
| 27 | + <input class="form-check-input" type="checkbox" <?php echo (get_option('page_suggestion_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_page_suggestion_enabled"> | |
| 28 | + <label class="form-check-label" for="is_page_suggestion_enabled"> | |
| 29 | + <?php esc_html_e( 'Enable WordPress page suggestions with GPT Results (the links are suggested by WordPress and not AI)','chatbot'); ?> | |
| 30 | + </label> | |
| 31 | + </div> | |
| 32 | + | |
| 33 | + <!-- POST TYPE --> | |
| 34 | + <div class="form-check form-switch my-4"> | |
| 35 | + <label><?php esc_html_e( 'Select POST TYPE(s) to include with search results', 'chatbot' ); ?></label> | |
| 36 | + <div id="wp-chatbot-post-converter"> | |
| 37 | + <ul class="checkbox-list"> | |
| 38 | + <?php | |
| 39 | + $get_cpt_args = array( | |
| 40 | + 'public' => true, | |
| 41 | + ); | |
| 42 | + $post_types = get_post_types( $get_cpt_args, 'object' ); | |
| 43 | + | |
| 44 | + foreach ($post_types as $post_type) { | |
| 45 | + if ($post_type->name != 'attachment') { | |
| 46 | + $is_pro = !in_array($post_type->name, ['post', 'page']); | |
| 47 | + ?> | |
| 48 | + <div class="form-check form-check-inline"> | |
| 49 | + <input | |
| 50 | + id="site_search_posttypes_<?php echo esc_html( $post_type->name ); ?>" | |
| 51 | + type="checkbox" | |
| 52 | + name="site_search_posttypes[]" | |
| 53 | + value="<?php echo esc_html( $post_type->name ); ?>" | |
| 54 | + <?php echo (($is_pro) ? 'disabled' : ''); ?> | |
| 55 | + | |
| 56 | + <?php echo ((get_option('qcld_openai_relevant_post') != '') && in_array($post_type->name, get_option('qcld_openai_relevant_post'))) ? 'checked' : ''; ?>> | |
| 57 | + <label class="form-check-label <?php echo ($is_pro ? 'pro-locked' : ''); ?>" for="site_search_posttypes_<?php echo esc_html( $post_type->name ); ?>"> | |
| 58 | + <?php echo esc_html( $post_type->name ); ?> | |
| 59 | + <?php if ($is_pro) { ?> | |
| 60 | + <span class="pro-badge">PRO</span> | |
| 61 | + <?php } ?> | |
| 62 | + </label> | |
| 63 | + </div> | |
| 64 | + <?php | |
| 65 | + } | |
| 66 | + } | |
| 67 | + ?> | |
| 68 | + </ul> | |
| 69 | + </div> | |
| 70 | + </div> | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + <!-- /POST TYPE --> | |
| 75 | + <div class="mb-3 form-check"> | |
| 76 | + <label for="api_key" class="form-label"><?php esc_html_e( 'Api key','chatbot');?></label> | |
| 77 | + <input type="password" class="form-control" id="api_key" name="api_key" placeholder="Api key" value="<?php echo esc_attr(get_option( 'open_ai_api_key')); ?>"> | |
| 78 | + <span style="color:red"><?php esc_html_e('It requires a paid OpenAI API plan', 'chatbot'); ?> </span> | |
| 79 | + </div> | |
| 80 | + <div class="qcld-wpbot-pricing-filter-form-check"> | |
| 81 | + </div> | |
| 82 | + <div class="mb-3 form-check"> | |
| 83 | + <label for="max_tokens" id="openai_engines" class="form-label"><?php esc_html_e( 'OpenAI Model','chatbot');?></label> | |
| 84 | + <select class="form-select" aria-label="Default select example" name="openai_engines" id="openai_engines"> | |
| 85 | + <option value="gpt-5.5" <?php echo ((get_option( 'openai_engines') == 'gpt-5.5') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5.5','chatbot');?></option> | |
| 86 | + <option value="gpt-5.4-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-5.4-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5.4-Mini','chatbot');?></option> | |
| 87 | + <option value="gpt-5.4-nano" <?php echo ((get_option( 'openai_engines') == 'gpt-5.4-nano') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5.4-Nano','chatbot');?></option> | |
| 88 | + <option value="gpt-5-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-5-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5-Mini','chatbot');?></option> | |
| 89 | + <option value="gpt-5-nano" <?php echo ((get_option( 'openai_engines') == 'gpt-5-nano') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5-Nano','chatbot');?></option> | |
| 90 | + <option value="gpt-5" <?php echo ((get_option( 'openai_engines') == 'gpt-5') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5','chatbot');?></option> | |
| 91 | + <option value="gpt-4.1-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-4.1-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4.1-Mini','chatbot');?></option> | |
| 92 | + <option value="gpt-4.1-nano" <?php echo ((get_option( 'openai_engines') == 'gpt-4.1-nano') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4.1-Nano','chatbot');?></option> | |
| 93 | + <option value="gpt-4.1" <?php echo ((get_option( 'openai_engines') == 'gpt-4.1') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4.1','chatbot');?></option> | |
| 94 | + <option value="gpt-4o-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-4o-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4o-Mini','chatbot');?></option> | |
| 95 | + <option value="gpt-4o" <?php echo ((get_option( 'openai_engines') == 'gpt-4o') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4o','chatbot');?></option> | |
| 96 | + <option value="gpt-4-turbo" <?php echo ((get_option( 'openai_engines') == 'gpt-4-turbo') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'gpt-4-turbo','chatbot');?></option> | |
| 97 | + <option value="gpt-4" <?php echo ((get_option( 'openai_engines') == 'gpt-4') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4','chatbot');?></option> | |
| 98 | + <option value="gpt-3.5-turbo" <?php echo ((get_option( 'openai_engines') == 'gpt-3.5-turbo') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-3 turbo','chatbot'); ?></option> | |
| 99 | + </select> | |
| 100 | + </div> | |
| 101 | + | |
| 102 | + <div class="mb-3 form-check"> | |
| 103 | + <label for="qcld_openai_system_content"><?php esc_attr_e( 'System Command (Use it to Instruct ChatGPT how to behave). You can write a detailed prompt here that includes details about your services, products, and how to contact you or anything relevant to get','chatbot');?> <span class="qcls_openAI_customized"><?php esc_attr_e( 'Customized Results','chatbot');?></span> <?php esc_attr_e( '. Upto 3000 words is fine.','chatbot');?> | |
| 104 | + | |
| 105 | + <br><br> | |
| 106 | + <?php esc_attr_e( '**','chatbot');?> | |
| 107 | + <a href="https://wpbot.pro/docs/knowledgebase/how-wpbot-chatbot-free-users-can-get-customized-results-from-the-chatbot-how-to-train-the-chatbot/#customize" class="qcls_openAI_customized_link" target="_blank"> | |
| 108 | + <?php esc_attr_e( 'Check this article','chatbot');?> | |
| 109 | + </a> | |
| 110 | + | |
| 111 | + <?php esc_attr_e( 'for more details abou how to get Customized Results from OpenAI.','chatbot');?> | |
| 112 | + <br> | |
| 113 | + | |
| 114 | + </label> | |
| 115 | + <textarea type="text" class="form-control" id="qcld_openai_system_content" placeholder="<?php echo esc_attr('You are a helpful and intelligent assistant for the website "' . site_url() . '". Use live website data and the provided context to respond accurately and briefly. Stay relevant and do not introduce additional topics.','chatbot'); ?>"><?php echo esc_html( get_option( 'qcld_openai_system_content')); ?></textarea> | |
| 116 | + <label><small><?php esc_html_e("To set the ChatBot's tone and character set a system message according to your need",'chatbot'); ?></small></label></br> | |
| 117 | + <label><small><?php esc_html_e("Example: You are a helpful and intelligent assistant for the website " . site_url() . ". Use live website data and the provided context to respond accurately and briefly. Stay relevant and do not introduce additional topics.",'chatbot'); ?></small></label> | |
| 118 | + </div> | |
| 119 | + <div class="mb-3 form-check"> | |
| 120 | + <label for="qcld_openai_append_content"><?php esc_attr_e( 'Prompt to be Appended at the End of the User Query (Optional)','chatbot');?></label> | |
| 121 | + <textarea type="text" class="form-control" id="qcld_openai_append_content" placeholder="<?php echo esc_attr('Content for the response'); ?>"><?php echo esc_html( get_option( 'qcld_openai_append_content')); ?></textarea> | |
| 122 | + | |
| 123 | + </div> | |
| 124 | + <div class="alert alert-warning"> | |
| 125 | + <p> <?php echo esc_html('Danger Zone (you may not get any responses from AI if the keywords are not set properly. Remove keywords if you face problems )'); ?></p> | |
| 126 | + </div> | |
| 127 | + <div class="mb-3 form-check"> | |
| 128 | + <label for="qcld_openai_include_keyword"><?php esc_attr_e( 'Connect to OpenAI only when user query includes one of the following Comma Separated Keywords','chatbot');?></label> | |
| 129 | + <textarea type="text" class="form-control" id="qcld_openai_include_keyword"><?php echo esc_attr( get_option( 'openai_include_keyword')); ?></textarea> | |
| 130 | + </div> | |
| 131 | + <div class="mb-3 form-check"> | |
| 132 | + <label for="qcld_openai_exclude_keyword"><?php esc_attr_e( 'Connect to OpenAI only when user query does NOT include one of the following Comma Separated Keywords','chatbot');?></label> | |
| 133 | + <textarea type="text" class="form-control" id="qcld_openai_exclude_keyword"><?php echo esc_attr( get_option( 'openai_exclude_keyword')); ?></textarea> | |
| 134 | + </div> | |
| 135 | + <div class="mb-3"> | |
| 136 | + <div class="form-check form-switch my-4"> | |
| 137 | + <input class="form-check-input" type="checkbox" <?php echo (get_option( 'qcld_openai_relevant_enabled') == 1) ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_relevant_enabled"> | |
| 138 | + <label class="form-check-label" for="is_relevant_enabled"> | |
| 139 | + <?php esc_html_e( 'Ask OpenAI to reply when question is relevant to above Keywords (Enabling this option will improve accuracy but it will use OpenAI Tokens)','chatbot'); ?> | |
| 140 | + </label> | |
| 141 | + </div> | |
| 142 | + </div> | |
| 143 | + | |
| 144 | + | |
| 145 | + <div class="mb-3"> | |
| 146 | + <a class="btn btn-success" id="save_setting"><?php esc_html_e( 'Save settings','chatbot');?></a> | |
| 147 | + </div> | |
| 148 | + <div class="mb-3 form-check"> | |
| 149 | + <a class="btn btn-warning" id="qcld_check_connection"><?php esc_html_e( 'Check Connection ','chatbot');?><i class="dashicons dashicons-image-rotate" id="rotationloader"></i></a> <?php echo esc_html('Save the Settings first and then press the Check Connection button'); ?><br/> | |
| 150 | + <div id="qcld_openAI_trubleshooter"></div> | |
| 151 | + </div> | |
| 152 | + <div class="alert alert-danger"> | |
| 153 | + <p> <?php echo esc_html('**If OpenAI is not responding back and the bot is just loading, then likely you hit your OpenAI usage limit. Please pre-purchase credit to use OpenAI API and increase the Usage limit. You can add credits to your API account by visiting the '); ?> <a href="https://platform.openai.com/account/billing"><?php echo esc_html('billing page.'); ?></a></p> | |
| 154 | + <p> | |
| 155 | + <a href="https://wpbot.pro/docs/knowledgebase/how-to-save-money-and-reduce-openai-api-cost-for-your-chatbot/"> <?php echo esc_html('How to reduce cost '); ?></a><?php echo esc_html('and save money on OpenAI API cost for your ChatBot.'); ?> | |
| 156 | + </p> | |
| 157 | + </div> | |
| 158 | + </div> | |
| 159 | +</div> | |