| @@ -4,14 +4,18 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package Botmaster |
| 6 | 6 | * @since 14.8.2 |
| 7 | 7 | */ |
| 8 | + | |
| 9 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | + exit; // Exit if accessed directly. | |
| 11 | +} | |
| 8 | 12 | ?> |
| 9 | 13 | |
| 10 | 14 | <div class="card-header bg-dark text-white py-sm-4 border-0"> |
| 11 | 15 | <div class="row"> |
| 12 | 16 | <div class="col-auto me-auto"> |
| 13 | - <h4><?php esc_html_e( 'Claude AI Settings', 'wpchatbot' ); ?></h4> | |
| 17 | + <h4><?php esc_html_e( 'Claude AI Settings', 'chatbot' ); ?></h4> | |
| 14 | 18 | </div> |
| 15 | 19 | </div> |
| 16 | 20 | </div> |
| 17 | 21 | <div class="card-body p-sm-0"> |
| @@ -16,10 +20,10 @@ | ||
| 16 | 20 | </div> |
| 17 | 21 | <div class="card-body p-sm-0"> |
| 18 | 22 | |
| 19 | 23 | <ul class="nav nav-tabs"> |
| 20 | - <li class="active"><a data-toggle="tab" href="#wp-chatbot-claude-settings"><?php echo esc_html__( 'Claude AI settings', 'wpchatbot' ); ?></a></li> | |
| 21 | - <li><a data-toggle="tab" href="#wp-chatbot-claude-help"><?php echo esc_html__( 'Claude AI Help', 'wpchatbot' ); ?></a></li> | |
| 24 | + <li class="active"><a data-toggle="tab" href="#wp-chatbot-claude-settings"><?php echo esc_html__( 'Claude AI settings', 'chatbot' ); ?></a></li> | |
| 25 | + <li><a data-toggle="tab" href="#wp-chatbot-claude-help"><?php echo esc_html__( 'Claude AI Help', 'chatbot' ); ?></a></li> | |
| 22 | 26 | </ul> |
| 23 | 27 | |
| 24 | 28 | <div class="tab-content"> |
| 25 | 29 | <div id="wp-chatbot-claude-settings" class="tab-pane in active"> |
| @@ -27,9 +31,9 @@ | ||
| 27 | 31 | <div class="mb-3"> |
| 28 | 32 | <div class="form-check form-switch my-4"> |
| 29 | 33 | <input class="form-check-input" type="checkbox" <?php echo ( get_option( 'qcld_claude_enabled' ) == 1 ) ? esc_attr( 'checked' ) : ''; ?> role="switch" value="" id="qcld_claude_enabled"> |
| 30 | 34 | <label class="form-check-label" for="qcld_claude_enabled"> |
| 31 | - <?php esc_html_e( 'Enable Claude AI', 'wpchatbot' ); ?><span style="color:red"> <?php esc_html_e( '(if you want results from claude only, disable Site Search from Settings->Start Menu)', 'wpchatbot' ); ?></span> | |
| 35 | + <?php esc_html_e( 'Enable Claude AI', 'chatbot' ); ?><span style="color:red"> <?php esc_html_e( '(if you want results from claude only, disable Site Search from Settings->Start Menu)', 'chatbot' ); ?></span> | |
| 32 | 36 | </label> |
| 33 | 37 | </div> |
| 34 | 38 | </div> |
| 35 | 39 | </div> |
| @@ -38,9 +42,9 @@ | ||
| 38 | 42 | <div class="mb-3"> |
| 39 | 43 | <div class="form-check form-switch my-4"> |
| 40 | 44 | <input class="form-check-input" type="checkbox" <?php echo ( get_option( 'qcld_claude_stream_enabled' ) == 1 ) ? esc_attr( 'checked' ) : ''; ?> role="switch" value="" id="qcld_claude_stream_enabled"> |
| 41 | 45 | <label class="form-check-label" for="qcld_claude_stream_enabled"> |
| 42 | - <?php esc_html_e( 'Enable Streaming', 'wpchatbot' ); ?> | |
| 46 | + <?php esc_html_e( 'Enable Streaming', 'chatbot' ); ?> | |
| 43 | 47 | </label> |
| 44 | 48 | </div> |
| 45 | 49 | </div> |
| 46 | 50 | </div> |
| @@ -49,9 +53,9 @@ | ||
| 49 | 53 | <div class="mb-3"> |
| 50 | 54 | <div class="form-check form-switch my-4"> |
| 51 | 55 | <input class="form-check-input" type="checkbox" <?php echo ( get_option( 'qcld_claude_rag_enabled' ) == 1 ) ? esc_attr( 'checked' ) : ''; ?> role="switch" value="" id="qcld_claude_rag_enabled"> |
| 52 | 56 | <label class="form-check-label" for="qcld_claude_rag_enabled"> |
| 53 | - <?php esc_html_e( 'Enable Claude RAG', 'wpchatbot' ); ?> | |
| 57 | + <?php esc_html_e( 'Enable Claude RAG', 'chatbot' ); ?> | |
| 54 | 58 | </label> |
| 55 | 59 | </div> |
| 56 | 60 | </div> |
| 57 | 61 | </div> |
| @@ -59,14 +63,14 @@ | ||
| 59 | 63 | <div class="mb-3"> |
| 60 | 64 | <div class="form-check form-switch my-4"> |
| 61 | 65 | <input class="form-check-input" type="checkbox" <?php echo ( get_option( 'qcld_claude_page_suggestion_enabled' ) == '1' ) ? esc_attr( 'checked' ) : ''; ?> role="switch" value="" id="qcld_claude_page_suggestion_enabled"> |
| 62 | 66 | <label class="form-check-label" for="qcld_claude_page_suggestion_enabled"> |
| 63 | - <?php esc_html_e( 'Enable page suggestions with claude Result', 'wpchatbot' ); ?> | |
| 67 | + <?php esc_html_e( 'Enable page suggestions with claude Result', 'chatbot' ); ?> | |
| 64 | 68 | </label> |
| 65 | 69 | </div> |
| 66 | 70 | <!-- POST TYPE --> |
| 67 | 71 | <div class="form-check form-switch my-4"> |
| 68 | - <label><?php esc_html_e( 'Select POST TYPE(s) to include with search results', 'wpchatbot' ); ?></label> | |
| 72 | + <label><?php esc_html_e( 'Select POST TYPE(s) to include with search results', 'chatbot' ); ?></label> | |
| 69 | 73 | <div id="wp-chatbot-post-converter"> |
| 70 | 74 | <ul class="checkbox-list"> |
| 71 | 75 | <?php |
| 72 | 76 | $get_cpt_args = array( |
| @@ -77,13 +81,13 @@ | ||
| 77 | 81 | if ( $post_type->name != 'attachment' ) { |
| 78 | 82 | ?> |
| 79 | 83 | <div class="form-check form-check-inline"> |
| 80 | 84 | <input |
| 81 | - id="site_claude_search_posttypes_<?php echo $post_type->name; ?>" | |
| 85 | + id="site_claude_search_posttypes_<?php echo esc_attr( $post_type->name ); ?>" | |
| 82 | 86 | type="checkbox" |
| 83 | 87 | name="site_claude_search_posttypes[]" |
| 84 | - value="<?php echo $post_type->name; ?>" <?php echo ( ( get_option( 'qcld_openai_relevant_post' ) != '' ) && in_array( $post_type->name, get_option( 'qcld_openai_relevant_post' ) ) ) ? 'checked' : ''; ?>> | |
| 85 | - <label class="form-check-label" for="site_claude_search_posttypes_<?php echo $post_type->name; ?>"> <?php echo $post_type->name; ?></label> | |
| 88 | + value="<?php echo esc_attr( $post_type->name ); ?>" <?php echo ( ( get_option( 'qcld_openai_relevant_post' ) != '' ) && in_array( $post_type->name, get_option( 'qcld_openai_relevant_post' ) ) ) ? 'checked' : ''; ?>> | |
| 89 | + <label class="form-check-label" for="site_claude_search_posttypes_<?php echo esc_attr( $post_type->name ); ?>"> <?php echo esc_html( $post_type->name ); ?></label> | |
| 86 | 90 | </div> |
| 87 | 91 | <?php |
| 88 | 92 | } |
| 89 | 93 | } |
| @@ -95,27 +99,27 @@ | ||
| 95 | 99 | </div> |
| 96 | 100 | </div> |
| 97 | 101 | <div class="row gx-0"> |
| 98 | 102 | <div class="form-group mb-3"> |
| 99 | - <label for="qcld_claude_api_key" class="form-label"><?php esc_html_e( 'Claude API Key', 'wpchatbot' ); ?></label> | |
| 103 | + <label for="qcld_claude_api_key" class="form-label"><?php esc_html_e( 'Claude API Key', 'chatbot' ); ?></label> | |
| 100 | 104 | <div class="input-group"> |
| 101 | 105 | <input type="password" class="form-control" id="qcld_claude_api_key" name="qcld_claude_api_key" placeholder="Enter your Claude API Key" value="<?php echo esc_attr( get_option( 'qcld_claude_api_key' ) ); ?>"> |
| 102 | 106 | </div> |
| 103 | - <small class="form-text text-muted"><?php esc_html_e( 'Get your API key from https://console.anthropic.com/', 'wpchatbot' ); ?> </small> | |
| 107 | + <small class="form-text text-muted"><?php esc_html_e( 'Get your API key from https://console.anthropic.com/', 'chatbot' ); ?> </small> | |
| 104 | 108 | </div> |
| 105 | 109 | </div> |
| 106 | 110 | <div class="row gx-0"> |
| 107 | 111 | <div class="form-group mb-3"> |
| 108 | - <label for="qcld_voyage_api_key" class="form-label"><?php esc_html_e( 'Voyage AI API Key (Required for RAG)', 'wpchatbot' ); ?></label> | |
| 112 | + <label for="qcld_voyage_api_key" class="form-label"><?php esc_html_e( 'Voyage AI API Key (Required for RAG)', 'chatbot' ); ?></label> | |
| 109 | 113 | <div class="input-group"> |
| 110 | 114 | <input type="password" class="form-control" id="qcld_voyage_api_key" name="qcld_voyage_api_key" placeholder="Enter your Voyage AI API Key" value="<?php echo esc_attr( get_option( 'qcld_voyage_api_key' ) ); ?>"> |
| 111 | 115 | </div> |
| 112 | - <small class="form-text text-muted"><?php esc_html_e( 'Anthropic uses Voyage AI for embeddings. Get your Voyage API key from https://dash.voyageai.com/api-keys to use RAG with Claude.', 'wpchatbot' ); ?> </small> | |
| 116 | + <small class="form-text text-muted"><?php esc_html_e( 'Anthropic uses Voyage AI for embeddings. Get your Voyage API key from https://dash.voyageai.com/api-keys to use RAG with Claude.', 'chatbot' ); ?> </small> | |
| 113 | 117 | </div> |
| 114 | 118 | </div> |
| 115 | 119 | <div class="row gx-0"> |
| 116 | 120 | <div class="form-group mb-3"> |
| 117 | - <label for="qcld_claude_model" class="form-label"><?php esc_html_e( 'Select Claude Model', 'wpchatbot' ); ?></label> | |
| 121 | + <label for="qcld_claude_model" class="form-label"><?php esc_html_e( 'Select Claude Model', 'chatbot' ); ?></label> | |
| 118 | 122 | <select class="form-control" id="qcld_claude_model" name="qcld_claude_model"> |
| 119 | 123 | <?php |
| 120 | 124 | $models = array( |
| 121 | 125 | 'claude-fable-5' => 'Claude Fable 5', |
| @@ -131,9 +135,9 @@ | ||
| 131 | 135 | $current_model = 'claude-3-opus-20240229'; |
| 132 | 136 | } |
| 133 | 137 | foreach($models as $key => $val) { |
| 134 | 138 | $selected = ($key == $current_model) ? 'selected' : ''; |
| 135 | - echo '<option value="' . esc_attr( $key ) . '" ' . $selected . '>' . esc_html( $val ) . '</option>'; | |
| 139 | + echo '<option value="' . esc_attr( $key ) . '" ' . esc_attr( $selected ) . '>' . esc_html( $val ) . '</option>'; | |
| 136 | 140 | } |
| 137 | 141 | ?> |
| 138 | 142 | </select> |
| 139 | 143 | </div> |
| @@ -140,15 +144,15 @@ | ||
| 140 | 144 | </div> |
| 141 | 145 | <div class="row g-0"> |
| 142 | 146 | <div class="gx-0"> |
| 143 | 147 | <div class="form-group mb-3"> |
| 144 | - <label for="qcld_claude_system_content" class="form-label"><?php esc_html_e( 'System Content for Claude (Optional)', 'wpchatbot' ); ?></label> | |
| 148 | + <label for="qcld_claude_system_content" class="form-label"><?php esc_html_e( 'System Content for Claude (Optional)', 'chatbot' ); ?></label> | |
| 145 | 149 | <textarea rows="5" class="form-control" id="qcld_claude_system_content" name="qcld_claude_system_content" placeholder="Content for the response"><?php echo esc_textarea( get_option( 'qcld_claude_system_content' ) ); ?></textarea> |
| 146 | 150 | </div> |
| 147 | 151 | </div> |
| 148 | 152 | <div class="gx-0"> |
| 149 | 153 | <div class="form-group mb-3"> |
| 150 | - <label for="qcld_claude_prepend_content" class="form-label"><?php esc_html_e( 'Your Prompt to be Added before the User Query for Customized Results (Optional)', 'wpchatbot' ); ?></label> | |
| 154 | + <label for="qcld_claude_prepend_content" class="form-label"><?php esc_html_e( 'Your Prompt to be Added before the User Query for Customized Results (Optional)', 'chatbot' ); ?></label> | |
| 151 | 155 | <textarea rows="5" class="form-control" id="qcld_claude_prepend_content" name="qcld_claude_prepend_content" placeholder="Content for the response"><?php echo esc_textarea( get_option( 'qcld_claude_prepend_content' ) ); ?></textarea> |
| 152 | 156 | |
| 153 | 157 | </div> |
| 154 | 158 | </div> |
| @@ -153,15 +157,15 @@ | ||
| 153 | 157 | </div> |
| 154 | 158 | </div> |
| 155 | 159 | <div class="gx-0"> |
| 156 | 160 | <div class="form-group mb-3"> |
| 157 | - <label for="qcld_claude_append_content" class="form-label"><?php esc_html_e( 'Your Prompt to be Appended at the End of the User Query for Customized Results (Optional)', 'wpchatbot' ); ?></label> | |
| 161 | + <label for="qcld_claude_append_content" class="form-label"><?php esc_html_e( 'Your Prompt to be Appended at the End of the User Query for Customized Results (Optional)', 'chatbot' ); ?></label> | |
| 158 | 162 | <textarea rows="5" class="form-control" id="qcld_claude_append_content" name="qcld_claude_append_content" placeholder="Content for the response"><?php echo esc_textarea( get_option( 'qcld_claude_append_content' ) ); ?></textarea> |
| 159 | 163 | |
| 160 | 164 | </div> |
| 161 | 165 | </div> |
| 162 | 166 | <div class="form-group mb-3"> |
| 163 | - <a class="btn btn-success" id="qcld_save_claude_setting"><?php esc_html_e( 'Save settings', 'wpchatbot' ); ?></a> | |
| 167 | + <a class="btn btn-success" id="qcld_save_claude_setting"><?php esc_html_e( 'Save settings', 'chatbot' ); ?></a> | |
| 164 | 168 | </div> |
| 165 | 169 | </div> |
| 166 | 170 | </div> |
| 167 | 171 | <div id="wp-chatbot-claude-help" class="tab-pane"> |