# chatbot/4.4.8/includes/openai/admin/settings.php

WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services, version 4.4.8. 102 lines.

- Page: https://pluginprobe.com/plugins/chatbot/4.4.8/code/includes/openai/admin/settings.php
- Raw: https://pluginprobe.com/plugins/chatbot/4.4.8/raw/includes/openai/admin/settings.php
- Modified: 2023-03-29T11:44:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/chatbot/4.4.8/code/includes/openai/admin/settings.php#L10-L20`.

```php
<div class="<?php esc_attr_e( 'row g-0','openai_addon');?>">
    <div class="<?php esc_attr_e( 'col-sm-10','openai_addon');?>">
        <div class="<?php esc_attr_e( 'form-check form-switch my-4','openai_addon');?>">
            <input class="<?php esc_attr_e( 'form-check-input','openai_addon');?>" type="checkbox" <?php echo (get_option( 'ai_enabled') == 1) ? 'checked' :'';?>  role="switch" value="" id="<?php esc_attr_e( 'is_ai_enabled','openai_addon');?>">
            <label class="<?php esc_attr_e( 'form-check-label','openai_addon');?>" for="<?php esc_attr_e( 'is_ai_enabled','openai_addon');?>">
            <?php  esc_html_e( 'Enable Open AI','openai_addon');?>
            </label>
        </div>
        <div class="<?php esc_attr_e( 'form-check form-switch my-4','openai_addon');?>">
            <input class="<?php esc_attr_e( 'form-check-input','openai_addon');?>" type="checkbox" <?php echo (get_option( 'ai_only_mode') == 1) ? 'checked' :'';?>  role="switch" value="" id="<?php esc_attr_e( 'is_ai_only_mode','openai_addon');?>">
            <label class="<?php esc_attr_e( 'form-check-label','openai_addon');?>" for="<?php esc_attr_e( 'is_ai_only_mode','openai_addon');?>">
            <?php  esc_html_e( 'Enable OpenAI only mode and hide other chatBot features','openai_addon');?>
            </label>
        </div>
        <div class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
                <label for="<?php esc_attr_e( 'api_key','openai_addon');?>" class="<?php esc_attr_e( 'form-label','openai_addon');?>"><?php esc_html_e( 'Api key','openai_addon');?></label>
                <input type="text" class="<?php esc_attr_e( 'form-control','openai_addon');?>" id="<?php esc_attr_e( 'api_key','openai_addon');?>" name="api_key" placeholder="Api key" value="<?php echo get_option( 'open_ai_api_key'); ?>">
        </div>
        <div class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
            <label for="<?php esc_attr_e( 'max_tokens','openai_addon');?>" class="<?php esc_attr_e( 'form-label','openai_addon');?>"><?php esc_html_e( 'Max tokens (0-4000) Depending on the model','openai_addon');?></label>
            <input id="<?php esc_attr_e( 'max_tokens','openai_addon');?>" class="<?php esc_attr_e( 'form-control','openai_addon');?>" type="text" name="max_tokens" value="<?php echo get_option( 'openai_max_tokens'); ?>">
        </div>
        <div class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
            <div class="<?php esc_attr_e( 'row gx-0','openai_addon');?>">
                <div class="<?php esc_attr_e( 'col-8','openai_addon');?>">
                    <label for="<?php esc_attr_e( 'temperature','openai_addon');?>" class="<?php esc_attr_e( 'form-label','openai_addon');?>"><?php esc_html_e( 'Temperature','openai_addon');?></label>
                </div>
                <div class="<?php esc_attr_e( 'col-4 me-auto text-end','openai_addon');?>">
                    <span name="temperatureout" id="<?php esc_attr_e( 'temperatureout','openai_addon');?>" ><?php echo get_option( 'openai_temperature'); ?></span></div>
                </div>
            <input id="<?php esc_attr_e( 'temperature','openai_addon');?>" type="range" class="<?php esc_attr_e( 'form-range','openai_addon');?>" min="0" max="1" step="0.01" name="temperature" value="<?php echo get_option( 'openai_temperature'); ?>"  onchange="updateTemp(this.value);" />
            <label class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
                <small><?php  esc_html_e( 'Temperature is a value between 0 and 1 that essentially lets you control how confident the model should be when making these predictions','openai_addon');?></small>
            </label>
            <span name="temperatureout" id="<?php esc_attr_e( 'temperatureout','openai_addon');?>" ><?php // echo get_option( 'openai_temperature'); ?></span>
        </div>
        <div class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
            <div class="<?php esc_attr_e( 'row gx-0','openai_addon');?>"><div class="<?php esc_attr_e( 'col-8','openai_addon');?>"><label for="<?php esc_attr_e( 'presence_penalty','openai_addon');?>" class="<?php esc_attr_e( 'form-label','openai_addon');?>"><?php esc_html_e( 'Presence Penalty','openai_addon');?></label></div><div class="<?php esc_attr_e( 'col-4 me-auto text-end','openai_addon');?>"><span id="<?php esc_attr_e( 'presence_penalty_out','openai_addon');?>" ><?php echo get_option( 'presence_penalty'); ?></span></div></div>
            <input id="<?php esc_attr_e( 'presence_penalty','openai_addon');?>" type="range" class="<?php esc_attr_e( 'form-range','openai_addon');?>" min="-2" max="2" step="0.1" name="presence_penalty" value="<?php echo get_option( 'presence_penalty'); ?>">
            <p class="<?php esc_attr_e( 'mb-3','openai_addon');?>"><small><?php  esc_html_e( 'Number between -2.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.','openai_addon');?></small></p>
        </div>
        <div class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
            <div class="<?php esc_attr_e( 'row gx-0','openai_addon');?>"><div class="<?php esc_attr_e( 'col-8','openai_addon');?>"><label for="<?php esc_attr_e( 'frequency_penalty','openai_addon');?>" class="<?php esc_attr_e( 'form-label','openai_addon');?>"><?php esc_html_e( 'Frequency penalty','openai_addon');?></label></div><div class="<?php esc_attr_e( 'col-4 me-auto text-end','openai_addon');?>"><span id="<?php esc_attr_e( 'frequency_penalty_out','openai_addon');?>" ><?php echo get_option( 'frequency_penalty'); ?></span></div></div>
            <input id="<?php esc_attr_e( 'frequency_penalty','openai_addon');?>" type="range" class="<?php esc_attr_e( 'form-range','openai_addon');?>" min="-2" max="2" step="0.1" name="frequency_penalty" value="<?php echo get_option( 'frequency_penalty'); ?>">
            <label><small><?php  esc_html_e( 'Number between -2.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.','openai_addon');?></small></label>
        </div>

        <div class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
            <label for="<?php esc_attr_e( 'max_tokens','openai_addon');?>" id="<?php esc_attr_e( 'openai_engines','openai_addon');?>" class="<?php esc_attr_e( 'form-label','openai_addon');?>"><?php esc_html_e( 'Open AI model','openai_addon');?></label>
            <select class="<?php esc_attr_e( 'form-select','openai_addon');?>" aria-label="Default select example" name="openai_engines" id="<?php esc_attr_e( 'openai_engines','openai_addon');?>">
                <option <?php echo ((get_option( 'openai_engines') == '') ? 'selected' : '') ; ?>><?php esc_html_e( 'Please select Engines','openai_addon');?></option>

                <option value="gpt-4" <?php echo ((get_option( 'openai_engines') == 'gpt-4') ? 'selected' : '') ; ?>><?php esc_html_e( 'GPT-4','openai_addon');?></option>
                <option value="gpt-3.5-turbo" <?php echo ((get_option( 'openai_engines') == 'gpt-3.5-turbo') ? 'selected' : '') ; ?>><?php esc_html_e( 'GPT-3 turbo','openai_addon');?></option>
                <option value="text-davinci-003" <?php echo ((get_option( 'openai_engines') == 'text-davinci-003') ? 'selected' : '') ; ?>><?php esc_html_e( 'Davinci (GPT-3 model)','openai_addon');?></option>
                <option value="text-davinci-001" <?php echo ((get_option( 'openai_engines') == 'text-davinci-001') ? 'selected' : '') ; ?>><?php esc_html_e( 'Davinci','openai_addon');?></option>
                <option value="text-ada-001" <?php echo ((get_option( 'openai_engines') == 'text-ada-001') ? 'selected' : '') ; ?>><?php esc_html_e( 'Ada','openai_addon');?></option>
                <option value="text-curie-001" <?php echo ((get_option( 'openai_engines') == 'text-curie-001') ? 'selected' : '') ; ?>><?php esc_html_e( 'Curie','openai_addon');?></option>
                <option value="text-babbage-001" <?php echo ((get_option( 'openai_engines') == 'text-babbage-001') ? 'selected' : '' ); ?>><?php esc_html_e( 'Babbag','openai_addon');?></option>
            </select>
        </div> 
        <div class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
            <div class="">
                <label><?php esc_html_e('Conversation continuity Only works in promt Q/A, Chat and friend chat'); ?></label>
            </div>
            <div class="<?php esc_attr_e( 'form-check form-switch my-4','openai_addon');?>">
                <input class="<?php esc_attr_e( 'form-check-input','openai_addon');?>" type="checkbox" <?php echo (get_option( 'conversation_continuity') == 1) ? 'checked' :'';?>  role="switch" value="" id="<?php esc_attr_e( 'conversation_continuity','openai_addon');?>">
                <label class="<?php esc_attr_e( 'form-check-label','openai_addon');?>" for="<?php esc_attr_e( 'conversation_continuity','openai_addon');?>"><?php esc_html_e( 'Enable conversation continuity','openai_addon');  ?></label>
            </div>
        </div>
        <div class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
            <label for="<?php esc_attr_e( 'qcld_openai_custom_model','openai_addon');?>" class="<?php esc_attr_e( 'form-label','openai_addon');?>"><?php esc_html_e( 'Custom Fine Tuned Model','openai_addon');?></label>
            <input id="<?php esc_attr_e( 'qcld_openai_custom_model','openai_addon');?>" class="<?php esc_attr_e( 'form-control','openai_addon');?>" type="text" name="qcld_openai_custom_model" value="<?php echo get_option( 'qcld_openai_custom_model'); ?>">
            <label><small><?php  esc_html_e( 'Pick your custom model from fine tune list','openai_addon','openai_addon');?></small></label>
        </div>
        <div class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
            
            <label for="<?php esc_attr_e( 'qcld_openai_prompt','openai_addon');?>" class="<?php esc_attr_e( 'form-label','openai_addon');?>"><?php esc_html_e( 'Select Prompt','openai_addon');?></label>
            <select class="<?php esc_attr_e( 'form-select','openai_addon');?>" aria-label="Default select example" name="qcld_openai_prompt" id="<?php esc_attr_e( 'qcld_openai_prompt','openai_addon');?>">
                <option <?php echo ((get_option( 'qcld_openai_prompt') == '') ? 'selected' : '') ; ?>><?php esc_html_e( 'Please select prompt','openai_addon');?></option>
                <option value="q_and_a" <?php echo ((get_option( 'qcld_openai_prompt') == 'q_and_a') ? 'selected' : '') ; ?>><?php esc_html_e( 'Q & A','openai_addon');?></option>
                <option value="chat" <?php echo ((get_option( 'qcld_openai_prompt') == 'chat') ? 'selected' : '') ; ?>><?php esc_html_e( 'Chat','openai_addon');?></option>
                <option value="friend_chat" <?php echo ((get_option( 'qcld_openai_prompt') == 'friend_chat') ? 'selected' : '') ; ?>><?php esc_html_e( 'Friend Chat','openai_addon');?></option>
                <option value="grammar_correction" <?php echo ((get_option( 'qcld_openai_prompt') == 'grammar_correction') ? 'selected' : '') ; ?>><?php esc_html_e( 'Grammar correction','openai_addon');?></option>
                <option value="marv_sarcastic_chatbot" <?php echo ((get_option( 'qcld_openai_prompt') == 'marv_sarcastic_chatbot') ? 'selected' : '') ; ?>><?php esc_html_e( 'Marv the sarcastic chat bot','openai_addon');?></option>
                <option value="micro_horror" <?php echo ((get_option( 'qcld_openai_prompt') == 'micro_horror') ? 'selected' : '') ; ?>><?php esc_html_e( 'Two-Sentence Horror Story:','openai_addon');?></option> 
                <option value="write_poem" <?php echo ((get_option( 'qcld_openai_prompt') == 'write_poem') ? 'selected' : '') ; ?>><?php esc_html_e( 'Write a poem (in English)','openai_addon');?></option>
                <option value="translated_qa" <?php echo ((get_option( 'qcld_openai_prompt') == 'translated_qa') ? 'selected' : '') ; ?>><?php esc_html_e( 'Translated Question Answer on your site language','openai_addon');?></option>
                <option value="any_command" <?php echo ((get_option( 'qcld_openai_prompt') == 'any_command') ? 'selected' : '') ; ?>><?php esc_html_e( 'Any command','openai_addon');?></option>
                <option value="custom_prompt"  <?php echo ((get_option( 'qcld_openai_prompt') == 'custom_prompt') ? 'selected' : '') ; ?>><?php esc_html_e( 'Custom prompt will be appended before the user`s queries','openai_addon');?></option>
            </select>
            <div id="<?php esc_attr_e( 'custom_prompt_wrapper','openai_addon');?>">
                <input type="hidden" id="<?php esc_attr_e( 'custom_promt_value','openai_addon');?>" value="<?php echo get_option('qcld_openai_prompt_custom'); ?>"/>
            </div>
            <p class="<?php esc_attr_e( 'mb-3','openai_addon');?>"><small><?php  esc_html_e( 'Please Select a prompt. The default value of the prompt is Q&A','openai_addon');?></small></p>
        </div>
        <div class="<?php esc_attr_e( 'mb-3','openai_addon');?>">
            <a class="<?php esc_attr_e( 'btn btn-success','openai_addon');?>" id="<?php esc_attr_e( 'save_setting','openai_addon');?>"><?php esc_html_e( 'Save settings','openai_addon');?></a>
        </div>
    </div>
</div>

```
