| @@ -1,107 +1,114 @@ | ||
| 1 | -<div class="row g-0"> | |
| 2 | - <div class="col-sm-10"> | |
| 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 Open AI ','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 | - | |
| 12 | - <div class="form-check form-switch my-4"> | |
| 13 | - <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"> | |
| 14 | - <label class="form-check-label" for="is_page_suggestion_enabled"> | |
| 15 | - <?php esc_html_e( 'Enable WordPress page suggestions with GPT Results (the links are suggested by WordPress and not AI)','chatbot'); ?> | |
| 16 | - </label> | |
| 17 | - </div> | |
| 18 | - <div class="mb-3"> | |
| 19 | - <label for="api_key" class="form-label"><?php esc_html_e( 'Api key','chatbot');?></label> | |
| 20 | - <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')); ?>"> | |
| 21 | - </div> | |
| 22 | - <div class="mb-3"> | |
| 23 | - <label for="max_tokens" class="form-label"><?php esc_html_e( 'Max tokens (0-4000) Depending on the model','chatbot');?></label> | |
| 24 | - <input id="max_tokens" class="form-control" type="text" name="max_tokens" value="<?php echo esc_attr(get_option( 'openai_max_tokens')); ?>"> | |
| 25 | - </div> | |
| 26 | - <div class="mb-3"> | |
| 27 | - <div class="row gx-0"> | |
| 28 | - <div class="col-8"> | |
| 29 | - <label for="temperature" class="form-label"><?php esc_html_e( 'Temperature','chatbot');?></label> | |
| 30 | - </div> | |
| 31 | - <div class="col-4 me-auto text-end"> | |
| 32 | - <span name="temperatureout" id="temperatureout" ><?php echo esc_html(get_option( 'openai_temperature')); ?></span></div> | |
| 33 | - </div> | |
| 34 | - <input id="temperature" type="range" class="form-range" min="0" max="2" step="0.01" name="temperature" value="<?php echo esc_attr(get_option( 'openai_temperature')); ?>" onchange="updateTemp(this.value);" /> | |
| 35 | - <label class="mb-3"> | |
| 36 | - <small><?php esc_html_e( 'Temperature is a value between 0 and 2 that essentially lets you control how confident the model should be when making these predictions','chatbot');?></small> | |
| 37 | - </label> | |
| 38 | - <span name="temperatureout" id="temperatureout" ><?php echo esc_html(get_option( 'openai_temperature')); ?></span> | |
| 39 | - </div> | |
| 40 | - <div class="mb-3"> | |
| 41 | - <div class="row gx-0"><div class="col-8"><label for="presence_penalty" class="form-label"><?php esc_html_e( 'Presence Penalty','chatbot');?></label></div><div class="col-4 me-auto text-end"><span id="presence_penalty_out" ><?php echo esc_html(get_option( 'presence_penalty')); ?></span></div></div> | |
| 42 | - <input id="presence_penalty" type="range" class="form-range" min="0" max="2" step="0.1" name="presence_penalty" value="<?php echo esc_attr(get_option( 'presence_penalty')); ?>"> | |
| 43 | - <p class="mb-3"><small><?php esc_html_e( 'Number between 0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics.','chatbot');?></small></p> | |
| 44 | - </div> | |
| 45 | - <div class="mb-3"> | |
| 46 | - <div class="row gx-0"><div class="col-8"><label for="frequency_penalty" class="form-label"><?php esc_html_e( 'Frequency Penalty','chatbot');?></label></div><div class="col-4 me-auto text-end"><span id="frequency_penalty_out" ><?php echo esc_html(get_option( 'frequency_penalty')); ?></span></div></div> | |
| 47 | - <input id="frequency_penalty" type="range" class="form-range" min="0" max="2" step="0.1" name="frequency_penalty" value="<?php echo esc_attr(get_option( 'frequency_penalty')); ?>"> | |
| 48 | - <label><small><?php esc_html_e( 'Number between 0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim.','chatbot');?></small></label> | |
| 49 | - </div> | |
| 50 | - | |
| 51 | - <div class="mb-3"> | |
| 52 | - <label for="max_tokens" id="openai_engines" class="form-label"><?php esc_html_e( 'OpenAI Model','chatbot');?></label> | |
| 53 | - <select class="form-select" aria-label="Default select example" name="openai_engines" id="openai_engines"> | |
| 54 | - <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> | |
| 55 | - <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> | |
| 56 | - <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> | |
| 57 | - <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> | |
| 58 | - <option value="gpt-4o" <?php echo ((get_option( 'openai_engines') == 'gpt-4o') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4o','chatbot');?></option> | |
| 59 | - <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> | |
| 60 | - <option value="gpt-4" <?php echo ((get_option( 'openai_engines') == 'gpt-4') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4','chatbot');?></option> | |
| 61 | - <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> | |
| 62 | - | |
| 63 | - | |
| 64 | - </select> | |
| 65 | - </div> | |
| 66 | - | |
| 67 | - <div class="mb-3"> | |
| 68 | - <label for="qcld_openai_system_content"><?php esc_attr_e( 'System Command (Use it to Instruct ChatGPT how to behave)','chatbot');?></label> | |
| 69 | - <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.'); ?>"><?php echo esc_html( get_option( 'qcld_openai_system_content')); ?></textarea> | |
| 70 | - <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> | |
| 71 | - <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> | |
| 72 | - </div> | |
| 73 | - <div class="alert alert-warning"> | |
| 74 | - <p> <?php echo esc_html('Danger Zone'); ?></p> | |
| 75 | - </div> | |
| 76 | - <div class="mb-3"> | |
| 77 | - <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> | |
| 78 | - <textarea type="text" class="form-control" id="qcld_openai_include_keyword"><?php echo esc_attr( get_option( 'openai_include_keyword')); ?></textarea> | |
| 79 | - </div> | |
| 80 | - <div class="mb-3"> | |
| 81 | - <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> | |
| 82 | - <textarea type="text" class="form-control" id="qcld_openai_exclude_keyword"><?php echo esc_attr( get_option( 'openai_exclude_keyword')); ?></textarea> | |
| 83 | - </div> | |
| 84 | - <div class="mb-3"> | |
| 85 | - <div class="form-check form-switch my-4"> | |
| 86 | - <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"> | |
| 87 | - <label class="form-check-label" for="is_relevant_enabled"> | |
| 88 | - <?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'); ?> | |
| 89 | - </label> | |
| 90 | - </div> | |
| 91 | - </div> | |
| 92 | - | |
| 93 | - <div class="mb-3"> | |
| 94 | - <a class="btn btn-success" id="save_setting"><?php esc_html_e( 'Save settings','chatbot');?></a> | |
| 95 | - </div> | |
| 96 | - <div class="mb-3"> | |
| 97 | - <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/> | |
| 98 | - <div id="qcld_openAI_trubleshooter"></div> | |
| 99 | - </div> | |
| 100 | - <div class="alert alert-danger"> | |
| 101 | - <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> | |
| 102 | - <p> | |
| 103 | - <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.'); ?> | |
| 104 | - </p> | |
| 105 | - </div> | |
| 106 | - </div> | |
| 107 | -</div> | |
| 1 | +<div class="<?php esc_attr_e( 'row g-0','wpbot');?>"> | |
| 2 | + <div class="<?php esc_attr_e( 'col-sm-10','wpbot');?>"> | |
| 3 | + <div class="<?php esc_attr_e( 'form-check form-switch my-4','wpbot');?>"> | |
| 4 | + <input class="<?php esc_attr_e( 'form-check-input','wpbot');?>" type="checkbox" <?php echo (get_option( 'ai_enabled') == 1) ? esc_attr( 'checked','wpbot') :'';?> role="switch" value="" id="<?php esc_attr_e( 'is_ai_enabled','wpbot'); ?>"> | |
| 5 | + <label class="<?php esc_attr_e( 'form-check-label','wpbot');?>" for="<?php esc_attr_e( 'is_ai_enabled','wpbot'); ?>"> | |
| 6 | + <?php esc_html_e( 'Enable Open AI','wpbot'); ?> | |
| 7 | + </label> | |
| 8 | + </div> | |
| 9 | + <div class="<?php esc_attr_e( 'form-check form-switch my-4','wpbot');?>"> | |
| 10 | + <input class="<?php esc_attr_e( 'form-check-input','wpbot');?>" type="checkbox" <?php echo (get_option( 'ai_only_mode') == 1) ? esc_attr( 'checked','wpbot') :'';?> role="switch" value="" id="<?php esc_attr_e( 'is_ai_only_mode','wpbot');?>"> | |
| 11 | + <label class="<?php esc_attr_e( 'form-check-label','wpbot');?>" for="<?php esc_attr_e( 'is_ai_only_mode','wpbot');?>"> | |
| 12 | + <?php esc_html_e( 'Enable OpenAI only mode and hide other chatBot features','wpbot');?> | |
| 13 | + </label> | |
| 14 | + </div> | |
| 15 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 16 | + <label for="<?php esc_attr_e( 'api_key','wpbot');?>" class="<?php esc_attr_e( 'form-label','wpbot');?>"><?php esc_html_e( 'Api key','wpbot');?></label> | |
| 17 | + <input type="text" class="<?php esc_attr_e( 'form-control','wpbot');?>" id="<?php esc_attr_e( 'api_key','wpbot');?>" name="api_key" placeholder="Api key" value="<?php esc_attr_e(get_option( 'open_ai_api_key'),'wpbot'); ?>"> | |
| 18 | + </div> | |
| 19 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 20 | + <label for="<?php esc_attr_e( 'max_tokens','wpbot');?>" class="<?php esc_attr_e( 'form-label','wpbot');?>"><?php esc_html_e( 'Max tokens (0-4000) Depending on the model','wpbot');?></label> | |
| 21 | + <input id="<?php esc_attr_e( 'max_tokens','wpbot');?>" class="<?php esc_attr_e( 'form-control','wpbot');?>" type="text" name="max_tokens" value="<?php esc_attr_e(get_option( 'openai_max_tokens'),'wpbot'); ?>"> | |
| 22 | + </div> | |
| 23 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 24 | + <div class="<?php esc_attr_e( 'row gx-0','wpbot');?>"> | |
| 25 | + <div class="<?php esc_attr_e( 'col-8','wpbot');?>"> | |
| 26 | + <label for="<?php esc_attr_e( 'temperature','wpbot');?>" class="<?php esc_attr_e( 'form-label','wpbot');?>"><?php esc_html_e( 'Temperature','wpbot');?></label> | |
| 27 | + </div> | |
| 28 | + <div class="<?php esc_attr_e( 'col-4 me-auto text-end','wpbot');?>"> | |
| 29 | + <span name="temperatureout" id="<?php esc_attr_e( 'temperatureout','wpbot');?>" ><?php echo esc_html(get_option( 'openai_temperature')); ?></span></div> | |
| 30 | + </div> | |
| 31 | + <input id="<?php esc_attr_e( 'temperature','wpbot');?>" type="range" class="<?php esc_attr_e( 'form-range','wpbot');?>" min="0" max="2" step="0.01" name="temperature" value="<?php esc_attr_e(get_option( 'openai_temperature'),'wpbot'); ?>" onchange="updateTemp(this.value);" /> | |
| 32 | + <label class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 33 | + <small><?php esc_html_e( 'Temperature is a value between 0 and 2 that essentially lets you control how confident the model should be when making these predictions','wpbot');?></small> | |
| 34 | + </label> | |
| 35 | + <span name="temperatureout" id="<?php esc_attr_e( 'temperatureout','wpbot');?>" ><?php echo esc_html(get_option( 'openai_temperature')); ?></span> | |
| 36 | + </div> | |
| 37 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 38 | + <div class="<?php esc_attr_e( 'row gx-0','wpbot');?>"><div class="<?php esc_attr_e( 'col-8','wpbot');?>"><label for="<?php esc_attr_e( 'presence_penalty','wpbot');?>" class="<?php esc_attr_e( 'form-label','wpbot');?>"><?php esc_html_e( 'Presence Penalty','wpbot');?></label></div><div class="<?php esc_attr_e( 'col-4 me-auto text-end','wpbot');?>"><span id="<?php esc_attr_e( 'presence_penalty_out','wpbot');?>" ><?php echo esc_html(get_option( 'presence_penalty')); ?></span></div></div> | |
| 39 | + <input id="<?php esc_attr_e( 'presence_penalty','wpbot');?>" type="range" class="<?php esc_attr_e( 'form-range','wpbot');?>" min="0" max="2" step="0.1" name="presence_penalty" value="<?php esc_attr_e(get_option( 'presence_penalty'),'wpbot'); ?>"> | |
| 40 | + <p class="<?php esc_attr_e( 'mb-3','wpbot');?>"><small><?php esc_html_e( 'Number between 0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics.','wpbot');?></small></p> | |
| 41 | + </div> | |
| 42 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 43 | + <div class="<?php esc_attr_e( 'row gx-0','wpbot');?>"><div class="<?php esc_attr_e( 'col-8','wpbot');?>"><label for="<?php esc_attr_e( 'frequency_penalty','wpbot');?>" class="<?php esc_attr_e( 'form-label','wpbot');?>"><?php esc_html_e( 'Frequency Penalty','wpbot');?></label></div><div class="<?php esc_attr_e( 'col-4 me-auto text-end','wpbot');?>"><span id="<?php esc_attr_e( 'frequency_penalty_out','wpbot');?>" ><?php esc_attr_e(get_option( 'frequency_penalty'),'wpbot'); ?></span></div></div> | |
| 44 | + <input id="<?php esc_attr_e( 'frequency_penalty','wpbot');?>" type="range" class="<?php esc_attr_e( 'form-range','wpbot');?>" min="0" max="2" step="0.1" name="frequency_penalty" value="<?php esc_attr_e(get_option( 'frequency_penalty'),'wpbot'); ?>"> | |
| 45 | + <label><small><?php esc_html_e( 'Number between 0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim.','wpbot');?></small></label> | |
| 46 | + </div> | |
| 47 | + | |
| 48 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 49 | + <label for="<?php esc_attr_e( 'max_tokens','wpbot');?>" id="<?php esc_attr_e( 'openai_engines','wpbot');?>" class="<?php esc_attr_e( 'form-label','wpbot');?>"><?php esc_html_e( 'OpenAI Model','wpbot');?></label> | |
| 50 | + <select class="<?php esc_attr_e( 'form-select','wpbot');?>" aria-label="Default select example" name="openai_engines" id="<?php esc_attr_e( 'openai_engines','wpbot');?>"> | |
| 51 | + <option value="<?php esc_attr_e( 'gpt-4o','wpbot'); ?>" <?php echo ((get_option( 'openai_engines') == 'gpt-4o') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4o','wpbot');?></option> | |
| 52 | + <option value="<?php esc_attr_e( 'gpt-4-turbo','wpbot'); ?>" <?php echo ((get_option( 'openai_engines') == 'gpt-4-turbo') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'gpt-4-turbo','wpbot');?></option> | |
| 53 | + <option value="<?php esc_attr_e( 'gpt-4','wpbot'); ?>" <?php echo ((get_option( 'openai_engines') == 'gpt-4') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4','wpbot');?></option> | |
| 54 | + <option value="<?php esc_attr_e( 'gpt-3.5-turbo','wpbot'); ?>" <?php echo ((get_option( 'openai_engines') == 'gpt-3.5-turbo') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-3 turbo','wpbot'); ?></option> | |
| 55 | + | |
| 56 | + | |
| 57 | + </select> | |
| 58 | + </div> | |
| 59 | + | |
| 60 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 61 | + <label for="<?php esc_attr_e( 'qcld_openai_include_keyword','wpbot');?>"><?php esc_attr_e( 'Connect to OpenAI only when user query includes one of the following Comma Separated Keywords','wpbot');?></label> | |
| 62 | + <textarea type="text" class="<?php esc_attr_e( 'form-control','wpbot');?>" id="<?php esc_attr_e( 'qcld_openai_include_keyword','wpbot');?>"><?php echo esc_attr( get_option( 'openai_include_keyword')); ?></textarea> | |
| 63 | + </div> | |
| 64 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 65 | + <label for="<?php esc_attr_e( 'qcld_openai_exclude_keyword','wpbot');?>"><?php esc_attr_e( 'Connect to OpenAI only when user query does NOT include one of the following Comma Separated Keywords','wpbot');?></label> | |
| 66 | + <textarea type="text" class="<?php esc_attr_e( 'form-control','wpbot');?>" id="<?php esc_attr_e( 'qcld_openai_exclude_keyword','wpbot');?>"><?php echo esc_attr( get_option( 'openai_exclude_keyword')); ?></textarea> | |
| 67 | + </div> | |
| 68 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 69 | + <div class="<?php esc_attr_e( 'form-check form-switch my-4','wpbot');?>"> | |
| 70 | + <input class="<?php esc_attr_e( 'form-check-input','wpbot');?>" type="checkbox" <?php echo (get_option( 'qcld_openai_relevant_enabled') == 1) ? esc_attr( 'checked','wpbot') :'';?> role="switch" value="" id="<?php esc_attr_e( 'is_relevant_enabled','wpbot'); ?>"> | |
| 71 | + <label class="<?php esc_attr_e( 'form-check-label','wpbot');?>" for="<?php esc_attr_e( 'is_relevant_enabled','wpbot'); ?>"> | |
| 72 | + <?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)'); ?> | |
| 73 | + </label> | |
| 74 | + </div> | |
| 75 | + </div> | |
| 76 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 77 | + <div class=""> | |
| 78 | + <label><?php esc_html_e('Conversation continuity Only works in promt Q/A, Chat and friend chat'); ?></label> | |
| 79 | + </div> | |
| 80 | + <div class="<?php esc_attr_e( 'form-check form-switch my-4','wpbot');?>"> | |
| 81 | + <input class="<?php esc_attr_e( 'form-check-input','wpbot');?>" type="checkbox" <?php echo (get_option( 'conversation_continuity') == 1) ? esc_attr( 'checked') : '';?> role="switch" value="" id="<?php esc_attr_e( 'conversation_continuity','wpbot');?>"> | |
| 82 | + <label class="<?php esc_attr_e( 'form-check-label','wpbot');?>" for="<?php esc_attr_e( 'conversation_continuity','wpbot');?>"><?php esc_html_e( 'Enable conversation continuity','wpbot'); ?></label> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + | |
| 86 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 87 | + | |
| 88 | + <label for="<?php esc_attr_e( 'qcld_openai_prompt','wpbot');?>" class="<?php esc_attr_e( 'form-label','wpbot');?>"><?php esc_html_e( 'Select Prompt','wpbot');?></label> | |
| 89 | + <select class="<?php esc_attr_e( 'form-select','wpbot');?>" aria-label="Default select example" name="qcld_openai_prompt" id="<?php esc_attr_e( 'qcld_openai_prompt','wpbot');?>"> | |
| 90 | + <option <?php echo ((get_option( 'qcld_openai_prompt') == '') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'Please select prompt','wpbot');?></option> | |
| 91 | + <option value="<?php esc_attr_e('q_and_a','wpbot'); ?>" <?php echo ((get_option( 'qcld_openai_prompt') == 'q_and_a') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'Q & A','wpbot');?></option> | |
| 92 | + <option value="<?php esc_attr_e('chat','wpbot'); ?>" <?php echo ((get_option( 'qcld_openai_prompt') == 'chat') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'Chat','wpbot');?></option> | |
| 93 | + <option value="<?php esc_attr_e('friend_chat','wpbot'); ?>" <?php echo ((get_option( 'qcld_openai_prompt') == 'friend_chat') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'Friend Chat','wpbot');?></option> | |
| 94 | + <option value="<?php esc_attr_e('grammar_correction','wpbot'); ?>" <?php echo ((get_option( 'qcld_openai_prompt') == 'grammar_correction') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'Grammar correction','wpbot');?></option> | |
| 95 | + <option value="<?php esc_attr_e('marv_sarcastic_chatbot','wpbot'); ?>" <?php echo ((get_option( 'qcld_openai_prompt') == 'marv_sarcastic_chatbot') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'Marv the sarcastic chat bot','wpbot');?></option> | |
| 96 | + <option value="<?php esc_attr_e('micro_horror','wpbot'); ?>" <?php echo ((get_option( 'qcld_openai_prompt') == 'micro_horror') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'Two-Sentence Horror Story:','wpbot');?></option> | |
| 97 | + <option value="<?php esc_attr_e('write_poem','wpbot'); ?>" <?php echo ((get_option( 'qcld_openai_prompt') == 'write_poem') ? esc_attr('selected') : '') ?>><?php esc_html_e( 'Write a poem (in English)','wpbot');?></option> | |
| 98 | + <option value="<?php esc_attr_e('translated_qa','wpbot'); ?>" <?php echo ((get_option( 'qcld_openai_prompt') == 'translated_qa') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'Translated Question Answer on your site language','wpbot');?></option> | |
| 99 | + <option value="<?php esc_attr_e('any_command','wpbot'); ?>" <?php echo ((get_option( 'qcld_openai_prompt') == 'any_command') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'Any command','wpbot');?></option> | |
| 100 | + <option value="<?php esc_attr_e('custom_prompt','wpbot'); ?>" <?php echo ((get_option( 'qcld_openai_prompt') == 'custom_prompt') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'Custom prompt will be appended before the user`s queries','wpbot');?></option> | |
| 101 | + </select> | |
| 102 | + <div id="<?php esc_attr_e( 'custom_prompt_wrapper','wpbot');?>"> | |
| 103 | + <input type="hidden" id="<?php esc_attr_e( 'custom_promt_value','wpbot');?>" value="<?php esc_attr_e(get_option('qcld_openai_prompt_custom'),'wpbot'); ?>"/> | |
| 104 | + </div> | |
| 105 | + <p class="<?php esc_attr_e( 'mb-3','wpbot');?>"><small><?php esc_html_e( 'Please Select a prompt. The default value of the prompt is Q&A','wpbot');?></small></p> | |
| 106 | + </div> | |
| 107 | + <div class="<?php esc_attr_e( 'mb-3','wpbot');?>"> | |
| 108 | + <a class="<?php esc_attr_e( 'btn btn-success','wpbot');?>" id="<?php esc_attr_e( 'save_setting','wpbot');?>"><?php esc_html_e( 'Save settings','wpbot');?></a> | |
| 109 | + </div> | |
| 110 | + <div class="<?php esc_attr_e( 'alert alert-danger','wpbot');?>"> | |
| 111 | + <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> | |
| 112 | + </div> | |
| 113 | + </div> | |
| 114 | +</div> | |