| 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 echo (get_option( 'ai_enabled') == 1) ? esc_attr( 'checked','wpbot') :'';?> role="switch" value="" id="is_ai_enabled"> |
| 5 |
<label class="form-check-label" for="is_ai_enabled"> |
| 6 |
<?php esc_html_e( 'Enable OpenAI','wpbot'); ?><span style="color:red"> <?php esc_html_e( '(if you want results from OpenAI only, disable Site Search from Settings->Start Menu)','wpbot'); ?></span> |
| 7 |
</label> |
| 8 |
</div> |
| 9 |
<div class="form-check form-switch my-4"> |
| 10 |
<input class="form-check-input" type="checkbox" <?php echo (get_option('context_awareness_enabled') == '1') ? esc_attr( 'checked','wpbot') :'';?> role="switch" value="" id="is_context_awareness_enabled"> |
| 11 |
<label class="form-check-label" for="is_context_awareness_enabled"> |
| 12 |
<?php esc_html_e( 'Context awareness','wpbot'); ?> |
| 13 |
</label> |
| 14 |
|
| 15 |
</div> |
| 16 |
<div class="form-check form-switch my-4"> |
| 17 |
<input class="form-check-input" type="checkbox" <?php echo (get_option('page_suggestion_enabled') == '1') ? esc_attr( 'checked','wpbot') :'';?> role="switch" value="" id="is_page_suggestion_enabled"> |
| 18 |
<label class="form-check-label" for="is_page_suggestion_enabled"> |
| 19 |
<?php esc_html_e( 'Enable page suggestions with GPT Result','wpbot'); ?> |
| 20 |
</label> |
| 21 |
</div> |
| 22 |
|
| 23 |
<!-- POST TYPE --> |
| 24 |
<div class="form-check form-switch my-4"> |
| 25 |
<label><?php esc_html_e( 'Select POST TYPE(s) to include with search results', 'wpchatbot' ); ?></label> |
| 26 |
<div id="wp-chatbot-post-converter"> |
| 27 |
<ul class="checkbox-list"> |
| 28 |
<?php |
| 29 |
$get_cpt_args = array( |
| 30 |
'public' => true, |
| 31 |
); |
| 32 |
$post_types = get_post_types( $get_cpt_args, 'object' ); |
| 33 |
|
| 34 |
foreach ($post_types as $post_type) { |
| 35 |
if ($post_type->name != 'attachment') { |
| 36 |
$is_pro = !in_array($post_type->name, ['post', 'page']); |
| 37 |
?> |
| 38 |
<div class="form-check form-check-inline"> |
| 39 |
<input |
| 40 |
id="site_search_posttypes_<?php echo $post_type->name; ?>" |
| 41 |
type="checkbox" |
| 42 |
name="site_search_posttypes[]" |
| 43 |
value="<?php echo $post_type->name; ?>" |
| 44 |
<?php echo (($is_pro) ? 'disabled' : ''); ?> |
| 45 |
|
| 46 |
<?php echo ((get_option('qcld_openai_relevant_post') != '') && in_array($post_type->name, get_option('qcld_openai_relevant_post'))) ? 'checked' : ''; ?>> |
| 47 |
<label class="form-check-label <?php echo ($is_pro ? 'pro-locked' : ''); ?>" for="site_search_posttypes_<?php echo $post_type->name; ?>"> |
| 48 |
<?php echo $post_type->name; ?> |
| 49 |
<?php if ($is_pro) { ?> |
| 50 |
<span class="pro-badge">PRO</span> |
| 51 |
<?php } ?> |
| 52 |
</label> |
| 53 |
</div> |
| 54 |
<?php |
| 55 |
} |
| 56 |
} |
| 57 |
?> |
| 58 |
</ul> |
| 59 |
</div> |
| 60 |
</div> |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
<!-- /POST TYPE --> |
| 65 |
<div class="mb-3 form-check"> |
| 66 |
<label for="api_key" class="form-label"><?php esc_html_e( 'Api key','wpbot');?></label> |
| 67 |
<input type="password" class="form-control" id="api_key" name="api_key" placeholder="Api key" value="<?php esc_attr_e(get_option( 'open_ai_api_key'),'wpbot'); ?>"> |
| 68 |
</div> |
| 69 |
<div class="qcld-wpbot-pricing-filter-form-check"> |
| 70 |
</div> |
| 71 |
|
| 72 |
<?php echo ((get_option( 'openai_engines') == 'gpt-5-mini') ? get_option( 'openai_engines') : '') ; ?> |
| 73 |
<div class="mb-3 form-check"> |
| 74 |
<label for="max_tokens" id="openai_engines" class="form-label"><?php esc_html_e( 'OpenAI Model','wpbot');?></label> |
| 75 |
<select class="form-select" aria-label="Default select example" name="openai_engines" id="openai_engines"> |
| 76 |
<option value="gpt-5-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-5-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5-Mini','wpbot');?></option> |
| 77 |
<option value="gpt-5-nano" <?php echo ((get_option( 'openai_engines') == 'gpt-5-nano') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5-Nano','wpbot');?></option> |
| 78 |
<option value="gpt-5" <?php echo ((get_option( 'openai_engines') == 'gpt-5') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5','wpbot');?></option> |
| 79 |
<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','wpbot');?></option> |
| 80 |
<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','wpbot');?></option> |
| 81 |
<option value="gpt-4.1" <?php echo ((get_option( 'openai_engines') == 'gpt-4.1') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4.1','wpbot');?></option> |
| 82 |
<option value="gpt-4o-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-4o-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4o-Mini','wpbot');?></option> |
| 83 |
<option value="gpt-4o" <?php echo ((get_option( 'openai_engines') == 'gpt-4o') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4o','wpbot');?></option> |
| 84 |
<option value="gpt-4-turbo" <?php echo ((get_option( 'openai_engines') == 'gpt-4-turbo') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'gpt-4-turbo','wpbot');?></option> |
| 85 |
<option value="gpt-4" <?php echo ((get_option( 'openai_engines') == 'gpt-4') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4','wpbot');?></option> |
| 86 |
<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','wpbot'); ?></option> |
| 87 |
</select> |
| 88 |
</div> |
| 89 |
|
| 90 |
<div class="mb-3 form-check"> |
| 91 |
<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','wpbot');?> <span class="qcls_openAI_customized"><?php esc_attr_e( 'Customized Results','wpbot');?></span> <?php esc_attr_e( '. Upto 3000 words is fine.','wpbot');?></label> |
| 92 |
<textarea type="text" class="form-control" id="qcld_openai_system_content" placeholder="<?php echo esc_attr('You are a helpful Assistant. Be concise and relevant in your answers and do not introduce new topic.'); ?>"><?php echo esc_html( get_option( 'qcld_openai_system_content')); ?></textarea> |
| 93 |
<label><small><?php esc_html_e("To set the ChatBot's tone and character set a system message according to your need","wpbot"); ?></small></label></br> |
| 94 |
<label><small><?php esc_html_e("Example: You are a helpful Assistant. Be concise and relevant in your answers and do not introduce new topic.","wpbot"); ?></small></label> |
| 95 |
</div> |
| 96 |
<div class="mb-3 form-check"> |
| 97 |
<label for="qcld_openai_append_content"><?php esc_attr_e( 'Prompt to be Appended at the End of the User Query (Optional)','wpbot');?></label> |
| 98 |
<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> |
| 99 |
|
| 100 |
</div> |
| 101 |
<div class="alert alert-warning"> |
| 102 |
<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> |
| 103 |
</div> |
| 104 |
<div class="mb-3 form-check"> |
| 105 |
<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','wpbot');?></label> |
| 106 |
<textarea type="text" class="form-control" id="qcld_openai_include_keyword"><?php echo esc_attr( get_option( 'openai_include_keyword')); ?></textarea> |
| 107 |
</div> |
| 108 |
<div class="mb-3 form-check"> |
| 109 |
<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','wpbot');?></label> |
| 110 |
<textarea type="text" class="form-control" id="qcld_openai_exclude_keyword"><?php echo esc_attr( get_option( 'openai_exclude_keyword')); ?></textarea> |
| 111 |
</div> |
| 112 |
<div class="mb-3"> |
| 113 |
<div class="form-check form-switch my-4"> |
| 114 |
<input class="form-check-input" type="checkbox" <?php echo (get_option( 'qcld_openai_relevant_enabled') == 1) ? esc_attr( 'checked','wpbot') :'';?> role="switch" value="" id="is_relevant_enabled"> |
| 115 |
<label class="form-check-label" for="is_relevant_enabled"> |
| 116 |
<?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)'); ?> |
| 117 |
</label> |
| 118 |
</div> |
| 119 |
</div> |
| 120 |
|
| 121 |
<div class="mb-3"> |
| 122 |
<a class="btn btn-success" id="save_setting"><?php esc_html_e( 'Save settings','wpbot');?></a> |
| 123 |
</div> |
| 124 |
<div class="mb-3 form-check"> |
| 125 |
<a class="btn btn-warning" id="qcld_check_connection"><?php esc_html_e( 'Check Connection ','wpbot');?><i class="fa fa-spinner" id="rotationloader"></i></a> <?php echo esc_html('Save the Settings first and then press the Check Connection button'); ?><br/> |
| 126 |
<div id="qcld_openAI_trubleshooter"></div> |
| 127 |
</div> |
| 128 |
<div class="alert alert-danger"> |
| 129 |
<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> |
| 130 |
<p> |
| 131 |
<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.'); ?> |
| 132 |
</p> |
| 133 |
</div> |
| 134 |
</div> |
| 135 |
</div> |
| 136 |
|