<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
<div class="accordion" id="qcldopenaiaccordion">
    <div class="qcld-wocard">
      
            <h2 class="mb-0">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseZerocollapseZeroServices" aria-expanded="false" aria-controls="panelsStayOpen-collapseZerocollapseZeroServices">
                <?php esc_html_e( 'Getting Customized Results from the AI Services','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
    
        <div id="panelsStayOpen-collapseZerocollapseZeroServices" class="collapse" aria-labelledby="panelsStayOpen-headingZer">
        <div class="card-body">
        <p>
        <?php esc_html_e( 'The best possible customized results you can get from AI services is to use the OpenAI GPT Assistant which allows you to upload documents and your website data (generated by our Pro versions). However, you can still get customized results by writing a detailed prompt. Under the System Command section in OpenAI Settings area (there is a prompt section for other AI services as well) you can write a detailed prompt that includes details about your services, products, how to contact you, or anything relevant to get customized results. Up to 3000 words is fine. This should be enough for most small to mid-sized websites.','woowbot-woocommerce-chatbot');?> </p>

        <b> 
                       <?php esc_attr_e( '**','woowbot-woocommerce-chatbot');?><a href="https://woowbot.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">
            <?php esc_attr_e( 'Check this article','woowbot-woocommerce-chatbot');?>
            </a> 
            
            <?php esc_attr_e( 'for more details abou how to get Customized Results from OpenAI.','woowbot-woocommerce-chatbot');?> 
        </b>
</br></br>
        <p>
       <b> <a href="https://www.woowbot.pro/pricing/" target="_blank"><?php esc_html_e( 'Upgrade to WoowbotPro Professional or the Master License to use GPT Assistant.','woowbot-woocommerce-chatbot');?></a></b></p>
        </div>
        </div>
    </div>
    <div class="qcld-wocard">
       
            <h2 class="mb-0">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseZero" aria-expanded="false" aria-controls="panelsStayOpen-collapseZero">
                <?php esc_html_e( 'Getting Started with OpenAI','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
       
        <div id="panelsStayOpen-collapseZero" class="collapse" aria-labelledby="panelsStayOpen-headingZer">
        <div class="card-body">
        <p>
        <?php esc_html_e( 'OpenAI has changed their API billing policy lately. You have to ','woowbot-woocommerce-chatbot');?><strong><?php esc_html_e( 'pre-purchase API credits','woowbot-woocommerce-chatbot');?></strong><?php esc_html_e( ' now. Go to ','woowbot-woocommerce-chatbot');?><a href="https://platform.openai.com/account/billing/" target="blank"><?php esc_html_e( 'https://platform.openai.com/account/billing/ ','woowbot-woocommerce-chatbot');?></a><?php esc_html_e( 'and add credits to your API account. Then increase the usage limit.','woowbot-woocommerce-chatbot');?>
        </p>
        <p>
        <?php esc_html_e( 'Once you add the OpenAI API key, it should already start working for generic questions. Open a new browser window in Incognito mode and test by asking "What is the capital of Russia?"','woowbot-woocommerce-chatbot');?></br>
        <?php esc_html_e( 'Please make sure DialogFlow is Disabled if you want OpenAI to work','woowbot-woocommerce-chatbot');?></p>
        </div>
        </div>
    </div>
    	<div class="qcld-wocard">
		
			<h2 class="mb-0">
				<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseOne-compare" aria-expanded="false" aria-controls="panelsStayOpen-collapseOne-compare">
					<?php esc_html_e( 'Fine Tuning VS GPT Assistants VS RAG', 'woowbot-woocommerce-chatbot' ); ?>
				</button>
			</h2>
		
		<div id="panelsStayOpen-collapseOne-compare" class=" collapse" aria-labelledby="panelsStayOpen-headingOne-compare">
			<div class="card-body">
				<p>
				<?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.', 'woowbot-woocommerce-chatbot' ); ?>
				</p></br>
			</div>
		</div>
	</div>
    <div class="qcld-wocard">
        
            <h2 class="mb-0">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseZeroone" aria-expanded="false" aria-controls="panelsStayOpen-collapseZeroone">
                <?php esc_html_e( 'GPT Assistants:','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
        
        <div id="panelsStayOpen-collapseZeroone" class="collapse" aria-labelledby="panelsStayOpen-headingZer">
        <div class="card-body">
            <p>
                <?php echo esc_html__('We suggest using GPT Assistants 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.', 'woowbot-woocommerce-chatbot'); ?>
            </p>
            <p>
                <b><?php echo esc_html__('Setting up GPT Assistants:', 'woowbot-woocommerce-chatbot'); ?></b>
                <ol>
                    <li><?php echo esc_html__('Go to the GPT training with Website Data tab. Select all the Post types you need and press the button Convert Data for Assistant. Once it is done, download the data file in JSON format', 'woowbot-woocommerce-chatbot'); ?></li>
                    <li><?php echo esc_html__('Go to ', 'woowbot-woocommerce-chatbot'); ?><a href="https://platform.openai.com/playground/assistants"><?php echo esc_html__('Assistants playground', 'woowbot-woocommerce-chatbot'); ?></a><?php echo esc_html__(' and create a new Assistant', 'woowbot-woocommerce-chatbot'); ?></li>
                    <li><?php echo esc_html__('Upload the JSON file you downloaded and give the GPT an Instruction similar to the one below but customize it to your website URL:', 'woowbot-woocommerce-chatbot'); ?>
                    <p><?php echo esc_html__('Your name is Carry. You are a ChatBot assistant for the website ', 'woowbot-woocommerce-chatbot'); ?><a href="https://www.quantumcloud.com"><?php echo esc_html__('https://www.quantumcloud.com. ', 'woowbot-woocommerce-chatbot'); ?></a><?php echo esc_html__('Use the website data and the uploaded file to answer any questions from our website users.', 'woowbot-woocommerce-chatbot'); ?></p>
                    </li>
                    <li><?php echo esc_html__('Copy the Assistants ID and paste under the GPT Assistants tab under the OpenAI settings on your website. You are done. If you have purchased credits from the OpenAI API platform, it will start working.', 'woowbot-woocommerce-chatbot'); ?></li>
                    <!-- <li><?php // echo esc_html__('', 'woowbot-woocommerce-chatbot'); ?></li>
                    <li><?php // echo esc_html__('', 'woowbot-woocommerce-chatbot'); ?></li> -->
                </ol>
            </p>
        </div>
        </div>
    </div>
    <div class="qcld-wocard">
        
            <h2 class="">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseOne" aria-expanded="false" aria-controls="panelsStayOpen-collapseOne">
                    <?php esc_html_e( 'How to get an OpenAI API Key','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
       
        <div id="panelsStayOpen-collapseOne" class=" collapse" aria-labelledby="panelsStayOpen-headingOne">
            <div class="card-body">
                <p><?php esc_html_e( 'The OpenAI API uses API keys for authentication. Visit your API Keys page to retrieve the API key you’ll use in your requests.Remember that your API key is a secret! Do not share it with others or expose it in any client-side code (browsers, apps). Production requests must be routed through your own backend server where your API key can be securely loaded from an environment variable or key management service.','woowbot-woocommerce-chatbot');?></p>
                <p><?php esc_html_e( 'You can generate the API key from here: ','woowbot-woocommerce-chatbot');?><a href="https://platform.openai.com/api-keys" target="blank"><?php esc_html_e( 'https://platform.openai.com/api-keys. ','woowbot-woocommerce-chatbot');?></a></p>
                
                <img class="img-responsive" src="<?php echo esc_url(QCLD_openai_addon_PLUGIN_URL.'image/api_screenshort.png'); ?>"/>
                
            </div>
        </div>
    </div>
    
    <div class="qcld-wocard">
        
            <h2 class="mb-0" id="panelsStayOpen-headingSeven">
            <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseseven" aria-expanded="false" aria-controls="panelsStayOpen-collapseseven">
                    <?php esc_html_e( 'Training or Fine Tuning OpenAI','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
        
        <div id="panelsStayOpen-collapseseven" class=" collapse" aria-labelledby="panelsStayOpen-headingSeven">
        <div class="card-body">
            
        <p><?php esc_html_e( 'To train OpenAI','woowbot-woocommerce-chatbot');?>
            <ul>
                <li><?php esc_html_e('a. To train or fine tune a model, 1st you need to:
                ','woowbot-woocommerce-chatbot'); ?>
                    <ol>
                        <li><?php esc_html_e('Gather the necessary data you want to train with','woowbot-woocommerce-chatbot'); ?></li>
                        <li><?php esc_html_e('Format the data correctly according to OpenAI API requirements (Download sample data format to see how it works). A dataset should have a at least 500 rows to offer useful results. According to the OpenAI documentation, numbers of 3,000 and 5,000 rows are recommended.','woowbot-woocommerce-chatbot'); ?></li>
                        <li><?php esc_html_e('Upload the data to OpenAI in .JSONL format','woowbot-woocommerce-chatbot'); ?></li>
                        <li><?php esc_html_e('Train an existing OpenAI model(select from the Bot OpenAI settings page) with your data','woowbot-woocommerce-chatbot'); ?></li>
                    </ol>
                </li>
                <li><?php esc_html_e('b. Once you have your JSONL file ready, please go to the Training model section.
                Upload your training file in .JSONL format.','woowbot-woocommerce-chatbot'); ?></li>
                <li><?php esc_html_e('c. Once you upload your training file, it will return a file id and the training will start once you click the Create FT Model button. Set a suffix (to recognize the model yourself later) and base model in the popup and create.','woowbot-woocommerce-chatbot'); ?></li>
                <li><?php esc_html_e('d. Once the training is done and the file is ready, it will return the fine tuned model. It will be listed under the Fine Tuned Models List, the status will be shown as "Succeeded" and you will also get a FT(Fine Tuned) Model ID (to copy to the settings page).','woowbot-woocommerce-chatbot'); ?></li>
                <li><?php esc_html_e('e. You can create multiple Fine Tuned models following the above procedure. Copy the Fine Tuned model ID you want to use.','woowbot-woocommerce-chatbot'); ?></li>
                <li><?php esc_html_e('f. Go to the main Bot OpenAI settings page and paste the Fine Tuned model ID to the Custom Fine Tuned Model field and save. Now the bot will start responding according to the Training data.','woowbot-woocommerce-chatbot'); ?></li>

                <li><?php esc_html_e('h. To Prepare your data model for GPT3.5/4:','woowbot-woocommerce-chatbot'); ?>
                    <ol>
                        <li><?php esc_html_e('1st you need to create a jsonl file like the formate below','woowbot-woocommerce-chatbot'); ?></li>
                        <li><?php esc_html_e('Each prompt and completion should be in a single line','woowbot-woocommerce-chatbot'); ?></li>
                    </ol>
            <ul>
        </p>
        <b><?php esc_html_e( 'Fine tuning file format with GPT 3.5/4','woowbot-woocommerce-chatbot'); ?></b></br>
        <pre><?php esc_html_e('{ "messages": [  { "role": "system", "content": "You are an assistant that occasionally misspells words" },{ "role": "user", "content": "Tell me a story." }, { "role": "assistant", "content": "One day a student went to schoool." }]}','woowbot-woocommerce-chatbot'); ?>
        </pre>
       
        <a href="https://woowbot.pro/myfile.jsonl" download><?php esc_html_e( 'Right click and Save the Example jsonl file for Fine Tuning with GPT 3.5/4','woowbot-woocommerce-chatbot');?></a></br>
        </div>
        </div>
    </div>
    		<div class="qcld-wocard">
		
			<h2 class="mb-0" id="panelsStayOpen-OpenAI-RAG">
				<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-OpenAI-RAG-collapse" aria-expanded="false" aria-controls="panelsStayOpen-OpenAI-RAG">
					<?php esc_html_e( 'OpenAI RAG', 'woowbot-woocommerce-chatbot' ); ?>
				</button>
			</h2>
		
		<div id="panelsStayOpen-OpenAI-RAG-collapse" class=" collapse" aria-labelledby="panelsStayOpen-OpenAI-RAG">
		<div class="card-body">
			
		<p><?php esc_html_e( 'To Embed OpenAI', 'woowbot-woocommerce-chatbot' ); ?></p>
		<p><?php esc_html_e( 'Enable RAG from the settings panel', 'woowbot-woocommerce-chatbot' ); ?></p>
			<ul>
				<li>
					<ol>
						<li><?php esc_html_e( 'Enable RAG from the settings panel', 'woowbot-woocommerce-chatbot' ); ?></li>
						<li><?php esc_html_e( 'Click “Embed All Selected Sources” button, after selecting the sources from the', 'woowbot-woocommerce-chatbot' ); ?> <a href="<?php echo esc_url( admin_url('admin.php?page=chatbot_ai_setting#ai-knowledge-base-tab') ); ?>" target="_blank">knowledgebase tab</a></li>
						<li><?php esc_html_e( '(Optional) Upload PDFs or CSV files for embedding', 'woowbot-woocommerce-chatbot' ); ?></li>
						<li><?php esc_html_e( 'The system automatically stores embeddings in the database', 'woowbot-woocommerce-chatbot' ); ?></li>
						<li><?php esc_html_e( 'User questions will now be answered using your site’s knowledge base', 'woowbot-woocommerce-chatbot' ); ?></li> 
						<li><?php esc_html_e( 'You need to configure the OpenAI API key, AI Model and System Command under the main OpenAI Settings', 'woowbot-woocommerce-chatbot' ); ?></li> 
					</ol>
				</li>
			<ul>
		</p>
		<b><?php esc_html_e( 'You can update or re-embed content at any time without retraining.', 'woowbot-woocommerce-chatbot' ); ?></b></br>

		</div>
	</div>
	</div>
    <div class="qcld-wocard">
       
            <h2 class="">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseSixteen" aria-expanded="false" aria-controls="panelsStayOpen-collapsesixteen">
                    <?php esc_html_e( 'Important points about fine tuning','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
        
        <div id="panelsStayOpen-collapseSixteen" class=" collapse" aria-labelledby="panelsStayOpen-headingSixteen">
            <div class="card-body">
                <p><?php esc_html_e( 'For better results, you need at least 500+ prompts. Otherwise, OpenAI will mix the response with generic knowledge. Also, the prompts should be as descriptive as possible. Follow the FAQ type format with  descriptive questions and answers. Example prompt: Instead of just "Vintage Denim Jacket" you can write "Why one should wear our Vintage Denim Jacket?".','woowbot-woocommerce-chatbot');?></p>
                <p><?php esc_html_e( 'If your completion is short like below or around 100 words, keep the Max Tokens value 200. Tweak the Temperature, Presence Penalty and Frequency penalty settings until you get results that you like.','woowbot-woocommerce-chatbot');?></p>
                <p><?php esc_html_e( 'If you are Fine tuning with website data, the Bot will use the Post titles as prompts. If the Page/Post titles are not descriptive you will not get good results. In such caes, you can download the JSONL file from the Training Model page and improve the prompts.Then fine tune again.','woowbot-woocommerce-chatbot');?></p>
                <p><?php esc_html_e( 'Keep the Site search disabled from Settings->Start Menu so that the bot does not bring answers from the site search. Please log out and log in again so our settings do not get overwritten.','woowbot-woocommerce-chatbot');?></p>
                
            </div>
        </div>
    </div>
    <div class="qcld-wocard">
        
            <h2 class="mb-0" id="panelsStayOpen-headingNine">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseNine" aria-expanded="false" aria-controls="panelsStayOpen-collapseNine">
                    <?php esc_html_e( 'How to Optimize Fine Tuning','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
       
        <div id="panelsStayOpen-collapseNine" class=" collapse" aria-labelledby="panelsStayOpen-headingNine">
            <div class="card-body">
            <?php esc_html_e('To get better results from fine-tuning please follow the following steps:','woowbot-woocommerce-chatbot'); ?>
            <ol>
                <li><?php esc_html_e('Set a lower value for Temperature','woowbot-woocommerce-chatbot'); ?></li>
                <li><?php esc_html_e('Use a higher value for the Presence Penalty and Frequency penalty.','woowbot-woocommerce-chatbot'); ?></li>
                <li><?php esc_html_e('If possible use the Curie model as your base model when you create the custom model.','woowbot-woocommerce-chatbot'); ?></li>
                <li><?php esc_html_e('Use max token depending on your prompt and completions. If you use a higher value of max token, AI will create more information which can be irrelevant to your context. The same for the lower max token. If you chose too low a value for max token then it will cut your data short or give errors.','woowbot-woocommerce-chatbot'); ?></li>
            </ol>
            </div>
        </div>
    </div>
    <div class="qcld-wocard">
        
            <h2 class="mb-0" id="panelsStayOpen-headingTwo">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseTwo" aria-expanded="false" aria-controls="panelsStayOpen-collapseTwo">
                <?php esc_html_e( 'Presence Penalty','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
       
        <div id="panelsStayOpen-collapseTwo" class=" collapse" aria-labelledby="panelsStayOpen-headingTwo">
        <div class="card-body">
        <?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.','woowbot-woocommerce-chatbot');?>
        </div>
        </div>
    </div>
    <div class="qcld-wocard">
       
            <h2 class="mb-0" id="panelsStayOpen-headingThree">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseThree" aria-expanded="false" aria-controls="panelsStayOpen-collapseThree">
                    <?php esc_html_e( 'Frequency Penalty','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
      
        <div id="panelsStayOpen-collapseThree" class=" collapse" aria-labelledby="panelsStayOpen-headingThree">
            <div class="card-body">
            <?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.','woowbot-woocommerce-chatbot');?>
            
            </div>
        </div>
    </div>
    
    <div class="qcld-wocard">
        
            <h2 class="mb-0" id="panelsStayOpen-headingFour">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapsefour" aria-expanded="false" aria-controls="panelsStayOpen-collapseFour">
                    <?php esc_html_e( 'Temperature','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
      
        <div id="panelsStayOpen-collapsefour" class=" collapse" aria-labelledby="panelsStayOpen-headingFour">
        <div class="card-body">
        <?php esc_html_e( ' One of the most important settings is called temperature.When the temperature is above 0, submitting the same prompt results in different completions each time.Remember that the model predicts which text is most likely to follow the text preceding it. Temperature is a value between 0 and 1 that essentially lets you control how confident the model should be when making these predictions. Lowering temperature means it will take fewer risks, and completions will be more accurate and deterministic. Increasing temperature will result in more diverse completions.','woowbot-woocommerce-chatbot');?>
        </div>
        </div>
    </div>
    <div class="qcld-wocard">
       
            <h2 class="mb-0" id="panelsStayOpen-headingSix">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapsesix" aria-expanded="false" aria-controls="panelsStayOpen-collapsesix">
                    <?php esc_html_e( 'My OpenAI does not work','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
      
        <div id="panelsStayOpen-collapsesix" class=" collapse" aria-labelledby="panelsStayOpen-headingSix">
        <div class="card-body">
        <?php esc_html_e( ' Please check your settings( i.e: Api keys, Max token etc.). Depending on the model (GPT3 was maximum 4000 ) used, requests can use up to 4097 tokens shared between prompt and completion. If your prompt is 4000 tokens, your completion can be 97 tokens at most. Also check the dialogflow is inactive. Dialogflow and OpenAI does not work together.','woowbot-woocommerce-chatbot');?>
        </div>
        </div>
    </div>
    <div class="qcld-wocard">
      
            <h2 class="mb-0" id="panelsStayOpen-headingEight">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#panelsStayOpen-collapseEight" aria-expanded="false" aria-controls="panelsStayOpen-collapseEight">
                    <?php esc_html_e( 'Fine Tune with Website Data','woowbot-woocommerce-chatbot');?>
                </button>
            </h2>
    
        <div id="panelsStayOpen-collapseEight" class=" collapse" aria-labelledby="panelsStayOpen-headingEight">
        <div class="card-body">
        <?php esc_html_e( 'You can create multiple Fine Tuned models based on your post types and pages. You can download your training data as a JSONL file to modify and then upload it in the same process as other file (see above for instructions). Also, you can upload it by clicking the `Upload As FT Model` button. Then you can create a Fine Tuned model from the Training Model tab.','woowbot-woocommerce-chatbot');?>
        </div>
        </div>
    </div>
</div>





