Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/aimogen-pro/res/aiomatic-assistants.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
if ( ! defined( 'ABSPATH' ) ) exit;
3
+
function aiomatic_assistants_panel()
4
+
{
5
+
if(!function_exists('is_plugin_active'))
6
+
{
7
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
8
+
}
9
+
$toubiz_active = false;
10
+
if (is_plugin_active('aiomatic-extension-toubiz-api/aiomatic-extension-toubiz-api.php'))
11
+
{
12
+
$toubiz_active = true;
13
+
}
14
+
$fbomatic_active = false;
15
+
if (is_plugin_active('fbomatic-facebook-post-generator/fbomatic-facebook-post-generator.php'))
16
+
{
17
+
$fbomatic_active = true;
18
+
}
19
+
$twitomatic_active = false;
20
+
if (is_plugin_active('twitomatic-twitter-post-generator/twitomatic-twitter-post-generator.php'))
21
+
{
22
+
$twitomatic_active = true;
23
+
}
24
+
$instamatic_active = false;
25
+
if (is_plugin_active('instamatic-instagram-post-generator/instamatic-instagram-post-generator.php'))
26
+
{
27
+
$instamatic_active = true;
28
+
}
29
+
$threadsomatic_active = false;
30
+
if (is_plugin_active('threadsomatic-threads-auto-poster/threadsomatic-threads-auto-poster.php'))
31
+
{
32
+
$threadsomatic_active = true;
33
+
}
34
+
$pinterestomatic_active = false;
35
+
if (is_plugin_active('pinterestomatic-pinterest-post-generator/pinterestomatic-pinterest-post-generator.php'))
36
+
{
37
+
$pinterestomatic_active = true;
38
+
}
39
+
$businessomatic_active = false;
40
+
if (is_plugin_active('businessomatic-google-my-business-post-generator/businessomatic-google-my-business-post-generator.php'))
41
+
{
42
+
$businessomatic_active = true;
43
+
}
44
+
$youtubomatic_active = false;
45
+
if (is_plugin_active('youtubomatic-youtube-post-generator/youtubomatic-youtube-post-generator.php'))
46
+
{
47
+
$youtubomatic_active = true;
48
+
}
49
+
$redditomatic_active = false;
50
+
if (is_plugin_active('redditomatic-reddit-post-generator/redditomatic-reddit-post-generator.php'))
51
+
{
52
+
$redditomatic_active = true;
53
+
}
54
+
$linkedinomatic_active = false;
55
+
if (is_plugin_active('linkedinomatic-linkedin-post-generator/linkedinomatic-linkedin-post-generator.php'))
56
+
{
57
+
$linkedinomatic_active = true;
58
+
}
59
+
$aiomatic_Main_Settings = get_option('aiomatic_Main_Settings', false);
60
+
if (!isset($aiomatic_Main_Settings['app_id']) || trim($aiomatic_Main_Settings['app_id']) == '')
61
+
{
62
+
?>
63
+
<h1><?php echo esc_html__("You must add an OpenAI API Key into the plugin's 'Settings' menu before you can use this feature!", 'aiomatic-automatic-ai-content-writer');?></h1>
64
+
<?php
65
+
return;
66
+
}
67
+
if (!aiomatic_check_if_azure($aiomatic_Main_Settings) && aiomatic_check_if_azure_or_others($aiomatic_Main_Settings))
68
+
{
69
+
?>
70
+
<h1><?php echo esc_html__("This feature is currently not supported when using Azure/Claude API!", 'aiomatic-automatic-ai-content-writer');?></h1>
71
+
<?php
72
+
return;
73
+
}
74
+
$appids = preg_split('/\r\n|\r|\n/', trim($aiomatic_Main_Settings['app_id']));
75
+
$appids = array_filter($appids);
76
+
if(count($appids) > 1)
77
+
{
78
+
?>
79
+
<h1><?php echo esc_html__("This feature is currently supported only if you enter a single OpenAI API key in the plugin's 'Settings' menu.", 'aiomatic-automatic-ai-content-writer');?></h1>
80
+
<?php
81
+
return;
82
+
}
83
+
if(count($appids) == 0)
84
+
{
85
+
?>
86
+
<h1><?php echo esc_html__("You need to add an API key in plugin settings for this to work.", 'aiomatic-automatic-ai-content-writer');?></h1>
87
+
<?php
88
+
return;
89
+
}
90
+
$token = $appids[array_rand($appids)];
91
+
$token = apply_filters('aimogen_openai_api_key', $token);$token = apply_filters('aiomatic_openai_api_key', $token);
92
+
if(aiomatic_is_aiomaticapi_key($token))
93
+
{
94
+
?>
95
+
<h1><?php echo esc_html__("This feature is currently supported only for OpenAI API keys.", 'aiomatic-automatic-ai-content-writer');?></h1>
96
+
<?php
97
+
return;
98
+
}
99
+
?>
100
+
<div class="wp-header-end"></div>
101
+
<div class="wrap gs_popuptype_holder seo_pops">
102
+
<h2 class="cr_center"><?php echo esc_html__("AI Assistants", 'aiomatic-automatic-ai-content-writer');?></h2>
103
+
<div class="wrap">
104
+
<nav class="nav-tab-wrapper">
105
+
<a href="#tab-1" class="nav-tab"><?php echo esc_html__("Tutorial", 'aiomatic-automatic-ai-content-writer');?></a>
106
+
<a href="#tab-6" class="nav-tab"><?php echo esc_html__("Manage Assistants", 'aiomatic-automatic-ai-content-writer');?></a>
107
+
<a href="#tab-2" class="nav-tab"><?php echo esc_html__("Manage Assistant Files", 'aiomatic-automatic-ai-content-writer');?></a>
108
+
</nav>
109
+
<div id="tab-1" class="tab-content">
110
+
<br/>
111
+
<h3><?php echo esc_html__("What are AI Assistants?", 'aiomatic-automatic-ai-content-writer');?></h3>
112
+
<p><?php echo esc_html__('The Assistants API (or AI GPTs) is a cool feature that lets you create AI helpers in your applications, like your WordPress site. These assistants can do a bunch of stuff like run code, find information, and even call functions to get things done. Right now, it works with a few handy tools, and there\'s more coming soon.', 'aiomatic-automatic-ai-content-writer');?></p>
113
+
<h3><?php echo esc_html__("To add an Assistants to your WordPress site, you'll follow steps like these:", 'aiomatic-automatic-ai-content-writer');?></h3>
114
+
<h4><?php echo esc_html__("Step 1a: Set Up Your Assistant", 'aiomatic-automatic-ai-content-writer');?></h3>
115
+
<p><?php echo esc_html__("Go to the 'Manage Assistants' tab and click the 'Add New Assistant' button. Fill out an intuitive name for the assistant, select an AI model, add a description and in the 'Assistant Context Prompt' settings field, be sure to add any information that the Assistant should be aware of. Here you can teach it about its name, role and purpose. You can also enable advanced features like 'Code Interpreter' and 'File Search', add your own functions or even upload files for the assistant to process and to extract content from them. Finally, you can assign also an avatar for the Assistant, which will be used for the chatbot, when this assistant is used.", 'aiomatic-automatic-ai-content-writer');?></p>
116
+
<h4><?php echo esc_html__("Step 1b: Set Up Your Assistant", 'aiomatic-automatic-ai-content-writer');?></h3>
117
+
<p><?php echo esc_html__("If you already have assistants created on OpenAI's platform, you can import these assistants, using the 'Import Assistants From OpenAI' button. All create assistants will appear in the plugin and will be able to be used.", 'aiomatic-automatic-ai-content-writer');?></p>
118
+
<h4><?php echo esc_html__("Step 2: Select The Assistants To Be Used In Plugin Settings", 'aiomatic-automatic-ai-content-writer');?></h3>
119
+
<p><?php echo esc_html__("The bulk of the work is done, now you can go to the part of the plugin where you want to use assistants and select the assistant instead of the AI model (usually, you will find an 'AI Assistant Name' settings field, where you will be able to select the imported assistants.", 'aiomatic-automatic-ai-content-writer');?></p>
120
+
<p><?php echo esc_html__("That's it! You've successfully set up an AI-powered Assistant on your WordPress website using the Aimogen plugin. This Assistant can be a valuable tool for engaging with your website visitors, answering frequently asked questions, and providing personalized assistance, or even create content for your site which is highly focused on your specific needs.", 'aiomatic-automatic-ai-content-writer');?></p>
121
+
<h3><?php echo esc_html__("AI Assistants Tutorial Video", 'aiomatic-automatic-ai-content-writer');?></h3>
122
+
<?php if(!isset($aiomatic_Main_Settings['hide_videos']) || trim($aiomatic_Main_Settings['hide_videos']) != 'on'){
123
+
?>
124
+
<p class="cr_center"><div class="embedtool"><iframe src="https://www.youtube.com/embed/x2mkjdOZI9Y" frameborder="0" allowfullscreen></iframe></div></p>
125
+
<?php
126
+
}
127
+
?>
128
+
</div>
129
+
<div id="tab-2" class="tab-content">
130
+
<br/>
131
+
<?php
132
+
$aiomaticMaxFileSize = wp_max_upload_size();
133
+
?>
134
+
<hr/>
135
+
<h3 class="margin5"><?php echo esc_html__("Upload A New Assistant File", 'aiomatic-automatic-ai-content-writer');?></h3>
136
+
<div class="aiomatic_form_upload_file">
137
+
<table class="form-table">
138
+
<tbody>
139
+
<tr>
140
+
<th scope="row"><?php echo esc_html__("Select A File To Upload", 'aiomatic-automatic-ai-content-writer');?></th>
141
+
<td>
142
+
<input type="file" id="aiomatic_assistant_file_upload">
143
+
</td>
144
+
</tr>
145
+
<tr>
146
+
<td colspan="2">
147
+
<div class="aiomatic_upload_success aiomatic_none margin5 colorgr"><?php echo esc_html__("File uploaded successfully!", 'aiomatic-automatic-ai-content-writer');?></div>
148
+
<div class="aiomatic_progress aiomatic_none"><span></span><small><?php echo esc_html__("Uploading", 'aiomatic-automatic-ai-content-writer');?></small></div>
149
+
<div class="aiomatic-error-msg"></div>
150
+
</td>
151
+
</tr>
152
+
<tr>
153
+
<td colspan="2">
154
+
<button class="button button-primary coderevolution_block_input" id="aiomatic_file_button"><?php echo esc_html__("Upload to OpenAI", 'aiomatic-automatic-ai-content-writer');?></button><br>
155
+
<p class="cr_center"><?php echo esc_html__("Maximum upload file size:", 'aiomatic-automatic-ai-content-writer');?> <?php echo esc_html(size_format($aiomaticMaxFileSize));?>
156
+
<?php
157
+
if(wp_max_upload_size() < 104857600){
158
+
?>
159
+
<?php echo esc_html__("(Please increase this value if you want to upload larger files)", 'aiomatic-automatic-ai-content-writer');?>
160
+
<?php
161
+
}
162
+
?></p>
163
+
</td>
164
+
</tr>
165
+
</tbody>
166
+
</table>
167
+
</div>
168
+
<hr/>
169
+
<h3 class="margin5"><?php echo esc_html__("Manage Uploaded Assistant Files", 'aiomatic-automatic-ai-content-writer');?></h3>
170
+
<br/><br/>
171
+
<button href="javascript:void(0)" id="aiomatic_sync_assistant_files" class="page-title-action aiomatic_sync_assistant_files"><?php echo esc_html__("Sync Files", 'aiomatic-automatic-ai-content-writer');?></button>
172
+
<a href="https://platform.openai.com/storage" target="_blank" id="aiomatic_view_storage" class="page-title-action aiomatic_view_storage"><?php echo esc_html__("View Files On OpenAI", 'aiomatic-automatic-ai-content-writer');?></a>
173
+
<table class="wp-list-table widefat fixed striped table-view-list comments" id="aiomatic-assistants-files">
174
+
<thead>
175
+
<tr>
176
+
<th><?php echo esc_html__("ID", 'aiomatic-automatic-ai-content-writer');?></th>
177
+
<th class="width50p"><?php echo esc_html__("Size", 'aiomatic-automatic-ai-content-writer');?></th>
178
+
<th><?php echo esc_html__("Purpose", 'aiomatic-automatic-ai-content-writer');?></th>
179
+
<th><?php echo esc_html__("Created At", 'aiomatic-automatic-ai-content-writer');?></th>
180
+
<th><?php echo esc_html__("Filename", 'aiomatic-automatic-ai-content-writer');?></th>
181
+
<th><?php echo esc_html__("Status", 'aiomatic-automatic-ai-content-writer');?></th>
182
+
<th><?php echo esc_html__("Action", 'aiomatic-automatic-ai-content-writer');?></th>
183
+
</tr>
184
+
</thead>
185
+
<tbody>
186
+
</tbody>
187
+
</table>
188
+
</div>
189
+
<div id="tab-6" class="tab-content">
190
+
<h2><?php echo esc_html__("Manage Assistants:", 'aiomatic-automatic-ai-content-writer');?></h2>
191
+
<br/>
192
+
<button href="#" id="aiomatic_sync_assistants" class="page-title-action"><?php
193
+
echo esc_html__("Import Assistants From OpenAI", 'aiomatic-automatic-ai-content-writer');
194
+
?></button>
195
+
<button id="aiomatic_manage_assistants" class="page-title-action"><?php
196
+
echo esc_html__("Add New Assistant", 'aiomatic-automatic-ai-content-writer');
197
+
?></button>
198
+
<button id="aiomatic_backup_assistants" class="page-title-action"><?php
199
+
echo esc_html__("Backup/Restore Assistants", 'aiomatic-automatic-ai-content-writer');
200
+
?></button>
201
+
<a href="https://platform.openai.com/assistants" target="_blank" class="page-title-action"><?php
202
+
echo esc_html__("Check On OpenAI", 'aiomatic-automatic-ai-content-writer');
203
+
?></a>
204
+
<button href="#" id="aiomatic_delete_selected_assistants" class="page-title-action"><?php
205
+
echo esc_html__("Delete Selected Assistants", 'aiomatic-automatic-ai-content-writer');
206
+
?></button>
207
+
<?php
208
+
$orderby = 'date';
209
+
$order = 'DESC';
210
+
if (isset($_GET['order']) && in_array(strtolower($_GET['order']), ['asc', 'desc'])) {
211
+
$order = strtoupper($_GET['order']);
212
+
}
213
+
if (isset($_GET['orderby']) && in_array(strtolower($_GET['orderby']), ['title', 'date'])) {
214
+
$orderby = strtolower($_GET['orderby']);
215
+
}
216
+
$aiomatic_assistant_page = isset($_GET['wpage']) && !empty($_GET['wpage']) ? sanitize_text_field($_GET['wpage']) : 1;
217
+
$aiomatic_assistants = new WP_Query(array(
218
+
'post_type' => 'aiomatic_assistants',
219
+
'posts_per_page' => 40,
220
+
'paged' => $aiomatic_assistant_page,
221
+
'order' => $order,
222
+
'orderby' => $orderby,
223
+
'post_status' => 'any'
224
+
));
225
+
if($aiomatic_assistants->have_posts()){
226
+
echo '<br><br>' . esc_html__('All assistants', 'aiomatic-automatic-ai-content-writer') . ' (' . esc_html($aiomatic_assistants->found_posts) . ')<br>';
227
+
}
228
+
$current_order = filter_input(INPUT_GET, 'order', FILTER_DEFAULT) === 'asc' ? 'desc' : 'asc';
229
+
$title_url = add_query_arg([
230
+
'orderby' => 'title',
231
+
'order' => $current_order
232
+
], esc_url_raw($_SERVER['REQUEST_URI']));
233
+
$date_url = add_query_arg([
234
+
'orderby' => 'date',
235
+
'order' => $current_order
236
+
], esc_url_raw($_SERVER['REQUEST_URI']));
237
+
?>
238
+
<table class="wp-list-table widefat fixed striped table-view-list posts">
239
+
<thead>
240
+
<tr>
241
+
<th class="manage-column column-cb check-column aiomatic-tdcol" scope="col"><input class="aiomatic-chk" type="checkbox" id="checkedAll"></th>
242
+
<th scope="col"><a href="<?php echo esc_html($title_url); ?>"><?php
243
+
echo esc_html__("Name", 'aiomatic-automatic-ai-content-writer');
244
+
?><span class="dashicons <?php if(!isset($_GET['order'])){echo 'cr_none';}else{echo $order === 'ASC' ? 'dashicons-arrow-down' : 'dashicons-arrow-up';} ?>"></span></a></th>
245
+
<th scope="col"><?php
246
+
echo esc_html__("Description", 'aiomatic-automatic-ai-content-writer');
247
+
?></th>
248
+
<th scope="col"><?php
249
+
echo esc_html__("Avatar", 'aiomatic-automatic-ai-content-writer');
250
+
?></th>
251
+
<th scope="col"><?php
252
+
echo esc_html__("Assistant Local ID", 'aiomatic-automatic-ai-content-writer');
253
+
?></th>
254
+
<th scope="col"><?php
255
+
echo esc_html__("Assistant OpenAI ID", 'aiomatic-automatic-ai-content-writer');
256
+
?></th>
257
+
<th scope="col"><a href="<?php echo esc_html($date_url); ?>"><?php
258
+
echo esc_html__("Date", 'aiomatic-automatic-ai-content-writer');
259
+
?><span class="dashicons <?php if(!isset($_GET['order'])){echo 'cr_none';}else{echo $order === 'ASC' ? 'dashicons-arrow-down' : 'dashicons-arrow-up';} ?>"></span></a></th>
260
+
<th scope="col"><?php
261
+
echo esc_html__("Manage", 'aiomatic-automatic-ai-content-writer');
262
+
?></th>
263
+
</tr>
264
+
</thead>
265
+
<tbody>
266
+
<?php
267
+
if($aiomatic_assistants->have_posts())
268
+
{
269
+
foreach ($aiomatic_assistants->posts as $aiomatic_assistant)
270
+
{
271
+
?>
272
+
<tr>
273
+
<td><input class="aiomatic-select-assistant" id="aiomatic-select-<?php echo esc_html($aiomatic_assistant->ID);?>" type="checkbox" name="ids[]" value="<?php echo esc_html($aiomatic_assistant->ID);?>"></td>
274
+
<td><?php echo esc_html($aiomatic_assistant->post_title);?></td>
275
+
<td><?php echo esc_html($aiomatic_assistant->post_excerpt);?></td>
276
+
<td><?php $avatar = get_the_post_thumbnail_url($aiomatic_assistant->ID, 'thumbnail'); if($avatar === false){echo 'N/A';}else{echo '<img class="openai-chat-avatar" src="' . esc_url($avatar) . '" alt="avatar"/>';}?></td>
277
+
<td><?php echo esc_html($aiomatic_assistant->ID);?></td>
278
+
<td><?php $ass_id = get_post_meta($aiomatic_assistant->ID, '_assistant_id', true); echo esc_html($ass_id);?></td>
279
+
<td><?php echo esc_html($aiomatic_assistant->post_date)?></td>
280
+
<td>
281
+
<div class="cr_center">
282
+
<?php
283
+
if(!empty($ass_id))
284
+
{
285
+
?>
286
+
<a class="button button-small" href="https://platform.openai.com/playground/assistants?assistant=<?php echo esc_html($ass_id);?>" target="_blank"><?php echo esc_html__("Test", 'aiomatic-automatic-ai-content-writer');?></a>
287
+
<?php
288
+
}
289
+
?>
290
+
<button class="button button-small aiomatic_sync_assistant" id="aiomatic_sync_assistant_<?php echo esc_html($aiomatic_assistant->ID);?>" sync-id="<?php echo esc_html($aiomatic_assistant->ID);?>"><?php echo esc_html__("Sync", 'aiomatic-automatic-ai-content-writer');?></button>
291
+
<button class="button button-small aiomatic_duplicate_assistant" id="aiomatic_duplicate_assistant_<?php echo esc_html($aiomatic_assistant->ID);?>" dup-id="<?php echo esc_html($aiomatic_assistant->ID);?>"><?php echo esc_html__("Duplicate", 'aiomatic-automatic-ai-content-writer');?></button>
292
+
<button class="button button-small aiomatic_edit_assistant" id="aiomatic_edit_assistant_<?php echo esc_html($aiomatic_assistant->ID);?>" edit-id="<?php echo esc_html($aiomatic_assistant->ID);?>"><?php echo esc_html__("Edit", 'aiomatic-automatic-ai-content-writer');?></button>
293
+
<button class="button button-small button-link-delete aiomatic_delete_assistant" id="aiomatic_delete_assistant_<?php echo esc_html($aiomatic_assistant->ID);?>" delete-id="<?php echo esc_html($aiomatic_assistant->ID);?>"><?php echo esc_html__("Delete", 'aiomatic-automatic-ai-content-writer');?></button>
294
+
<button class="button button-small aiomatic_convert_assistant" id="aiomatic_convert_assistant_<?php echo esc_html($aiomatic_assistant->ID);?>" conv-id="<?php echo esc_html($aiomatic_assistant->ID);?>"><?php echo esc_html__("Convert To Persona", 'aiomatic-automatic-ai-content-writer');?></button>
295
+
</div>
296
+
</td>
297
+
</tr>
298
+
<?php
299
+
}
300
+
}
301
+
else
302
+
{
303
+
echo '<tr><td colspan="8">' . esc_html__("No assistants added. You can add more using the 'Add New Assistant' button from above.", 'aiomatic-automatic-ai-content-writer') . '</td></tr>';
304
+
}
305
+
?>
306
+
</tbody>
307
+
</table>
308
+
<?php
309
+
if($aiomatic_assistants->have_posts() && $aiomatic_assistants->max_num_pages > 1)
310
+
{
311
+
?>
312
+
<div class="aiomatic-paginate">
313
+
<?php
314
+
echo esc_html__("Page: ", 'aiomatic-automatic-ai-content-writer') . paginate_links( array(
315
+
'base' => admin_url('admin.php?page=aiomatic_assistants_panel&wpage=%#%'),
316
+
'total' => $aiomatic_assistants->max_num_pages,
317
+
'current' => $aiomatic_assistant_page,
318
+
'format' => '?wpage=%#%',
319
+
'show_all' => false,
320
+
'prev_next' => true,
321
+
'add_args' => false,
322
+
));
323
+
?>
324
+
</div>
325
+
<?php
326
+
}
327
+
?>
328
+
<br/></hr/><br/>
329
+
</div>
330
+
</div>
331
+
332
+
<div id="mymodalfzr_backup" class="codemodalfzr">
333
+
<div class="codemodalfzr-content">
334
+
<div class="codemodalfzr-header">
335
+
<span id="aiomatic_close_backup" class="codeclosefzr">×</span>
336
+
<h2><span class="cr_color_white"><?php echo esc_html__("Backup/Restore Assistants", 'aiomatic-automatic-ai-content-writer');?></span></h2>
337
+
</div>
338
+
<div class="codemodalfzr-body">
339
+
<div class="table-responsive">
340
+
<br/>
341
+
<?php
342
+
$aiomaticMaxFileSize = wp_max_upload_size();
343
+
?>
344
+
<hr/>
345
+
<div class="aiomatic-loader-bubble">
346
+
<h3 class="margin5"><?php echo esc_html__("Restore Assistants From File", 'aiomatic-automatic-ai-content-writer');?>:
347
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
348
+
<div class="bws_hidden_help_text cr_min_260px">
349
+
<?php
350
+
echo esc_html__("Hit this button and you can restore assistants from file.", 'aiomatic-automatic-ai-content-writer');
351
+
?>
352
+
</div>
353
+
</div></h3>
354
+
<div class="aiomatic_assistant_upload_form">
355
+
<table class="form-table">
356
+
<tbody>
357
+
<tr>
358
+
<th scope="row"><?php
359
+
echo esc_html__("Backup File (*.json)", 'aiomatic-automatic-ai-content-writer');
360
+
?></th>
361
+
<td>
362
+
<input type="file" id="aiomatic_assistant_upload" accept=".json">
363
+
</td>
364
+
</tr>
365
+
<tr>
366
+
<th scope="row"><?php
367
+
echo esc_html__("Overwrite Existing", 'aiomatic-automatic-ai-content-writer');
368
+
?></th>
369
+
<td>
370
+
<input type="checkbox" id="aiomatic_overwrite" value="1">
371
+
</td>
372
+
</tr>
373
+
<tr>
374
+
<td colspan="2">
375
+
<div class="aiomatic_upload_success aiomatic_none margin5 colorgr"><?php
376
+
echo esc_html__("File uploaded successfully you can view it in the assistant listing tab.", 'aiomatic-automatic-ai-content-writer');
377
+
?></div>
378
+
<div class="aiomatic_progress aiomatic_none"><span></span><small><?php
379
+
echo esc_html__("Uploading", 'aiomatic-automatic-ai-content-writer');
380
+
?></small></div>
381
+
<div class="aiomatic-error-msg"></div>
382
+
</td>
383
+
</tr>
384
+
<tr>
385
+
<td colspan="2">
386
+
<button class="button button-primary coderevolution_block_input" id="aiomatic_assistant_button"><?php echo esc_html__("Import Assistants From File", 'aiomatic-automatic-ai-content-writer');?></button><br>
387
+
<p class="cr_center"><?php
388
+
echo esc_html__("Maximum upload file size", 'aiomatic-automatic-ai-content-writer');
389
+
?>: <?php echo esc_html(size_format($aiomaticMaxFileSize));?>
390
+
</p>
391
+
</td>
392
+
</tr>
393
+
</tbody>
394
+
</table>
395
+
</div>
396
+
</div>
397
+
<br/>
398
+
<hr/>
399
+
<div class="aiomatic-loader-bubble">
400
+
<div>
401
+
<h3>
402
+
<?php echo esc_html__('Backup Current Assistants To File:', 'aiomatic-automatic-ai-content-writer');?>
403
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
404
+
<div class="bws_hidden_help_text cr_min_260px">
405
+
<?php
406
+
echo esc_html__("Hit this button and you can backup the current assistants to file.", 'aiomatic-automatic-ai-content-writer');
407
+
?>
408
+
</div>
409
+
</div>
410
+
</h3>
411
+
<form method="post" onsubmit="return confirm('Are you sure you want to download assistants to file?');"><input name="aiomatic_nonce" type="hidden" value="<?php echo esc_html(wp_create_nonce('aiomatic_assistants'));?>"><input name="aiomatic_download_assistants_to_file" type="submit" class="button button-primary coderevolution_block_input" value="Backup Assistants To File"></form>
412
+
</div>
413
+
</div>
414
+
<br/>
415
+
<hr/>
416
+
<div class="aiomatic-loader-bubble">
417
+
<h3 class="margin5"><?php echo esc_html__("Import Default Assistants (This Can Take For A While)", 'aiomatic-automatic-ai-content-writer');?>:
418
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
419
+
<div class="bws_hidden_help_text cr_min_260px">
420
+
<?php
421
+
echo esc_html__("Hit this button and the plugin will create the default assistants which come bundled with the plugin.", 'aiomatic-automatic-ai-content-writer');
422
+
?>
423
+
</div>
424
+
</div></h3>
425
+
<table class="form-table">
426
+
<tbody>
427
+
<tr>
428
+
<td colspan="2">
429
+
<button class="button button-primary coderevolution_block_input" id="aiomatic_assistant_default_button"><?php echo esc_html__("Import Default Assistants", 'aiomatic-automatic-ai-content-writer');?></button><br>
430
+
</td>
431
+
</tr>
432
+
</tbody>
433
+
</table>
434
+
</div>
435
+
<hr/>
436
+
</div>
437
+
</div>
438
+
</div>
439
+
</div>
440
+
441
+
442
+
<div id="mymodalfzr" class="codemodalfzr">
443
+
<div class="codemodalfzr-content">
444
+
<div class="codemodalfzr-header">
445
+
<span id="aiomatic_close" class="codeclosefzr">×</span>
446
+
<h2><span class="cr_color_white"><?php echo esc_html__("Add New Assistant", 'aiomatic-automatic-ai-content-writer');?></span></h2>
447
+
</div>
448
+
<div class="codemodalfzr-body">
449
+
<div class="table-responsive">
450
+
<form action="#" method="post" id="aiomatic_assistants_form">
451
+
<br/>
452
+
<input type="hidden" name="action" value="aiomatic_assistants">
453
+
<input type="hidden" name="nonce" value="<?php echo esc_html(wp_create_nonce('aiomatic_assistants'));?>">
454
+
<h4><?php echo esc_html__("Assistant Name*", 'aiomatic-automatic-ai-content-writer');?>:<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
455
+
<div class="bws_hidden_help_text cr_min_260px">
456
+
<?php
457
+
echo esc_html__("Set the name of this assistant.", 'aiomatic-automatic-ai-content-writer');
458
+
?>
459
+
</div>
460
+
</div></h4>
461
+
<textarea rows="1" id="aiomatic-assistant-title" name="aiomatic-assistant-title" class="aiomatic-full-size" placeholder="Assistant name" required></textarea>
462
+
<br/>
463
+
<h4><?php echo esc_html__("Assistant Model*", 'aiomatic-automatic-ai-content-writer');?>:<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
464
+
<div class="bws_hidden_help_text cr_min_260px">
465
+
<?php
466
+
echo esc_html__("Set the AI model of this assistant.", 'aiomatic-automatic-ai-content-writer');
467
+
?>
468
+
</div>
469
+
</div></h4>
470
+
<select autocomplete="off" id="aiomatic-assistant-model" name="aiomatic-assistant-model" class="aiomatic-full-size">
471
+
<?php
472
+
if(aiomatic_check_if_azure($aiomatic_Main_Settings))
473
+
{
474
+
$assist_mods = aiomatic_get_assistant_models();
475
+
}
476
+
else
477
+
{
478
+
$assist_mods = array_merge(aiomatic_get_assistant_models(), get_option('aiomatic_custom_models', array()));
479
+
}
480
+
foreach($assist_mods as $modelx)
481
+
{
482
+
echo '<option value="' . esc_html($modelx) .'"';
483
+
echo '>' . esc_html($modelx);
484
+
if(aiomatic_is_vision_model($modelx, ''))
485
+
{
486
+
echo esc_html__(" (Vision)", 'aiomatic-automatic-ai-content-writer');
487
+
}
488
+
echo '</option>';
489
+
}
490
+
?>
491
+
</select>
492
+
<br/>
493
+
<h4><?php echo esc_html__("Model Temperature", 'aiomatic-automatic-ai-content-writer');?>:<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
494
+
<div class="bws_hidden_help_text cr_min_260px">
495
+
<?php
496
+
echo esc_html__("What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.", 'aiomatic-automatic-ai-content-writer');
497
+
?>
498
+
</div>
499
+
</div></h4>
500
+
<input type="number" min="0" step="0.01" max="2" id="aiomatic-assistant-temperature" name="aiomatic-assistant-temperature" value="" placeholder="Model temperature" class="cr_width_full">
501
+
<br/>
502
+
<h4><?php echo esc_html__("Model Top_p", 'aiomatic-automatic-ai-content-writer');?>:<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
503
+
<div class="bws_hidden_help_text cr_min_260px">
504
+
<?php
505
+
echo esc_html__("An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.", 'aiomatic-automatic-ai-content-writer');
506
+
?>
507
+
</div>
508
+
</div></h4>
509
+
<input type="number" min="0" max="1" step="0.01" id="aiomatic-assistant-topp" name="aiomatic-assistant-topp" value="" placeholder="Model top_p" class="cr_width_full">
510
+
<br/>
511
+
<h4><?php echo esc_html__("Assistant Description", 'aiomatic-automatic-ai-content-writer');?>:<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
512
+
<div class="bws_hidden_help_text cr_min_260px">
513
+
<?php
514
+
echo esc_html__("Set the description of this assistant.", 'aiomatic-automatic-ai-content-writer');
515
+
?>
516
+
</div>
517
+
</div></h4>
518
+
<textarea rows="1" id="aiomatic-assistant-description" name="aiomatic-assistant-description" class="aiomatic-full-size" placeholder="Assistant description"></textarea>
519
+
<br/>
520
+
<h4><?php echo esc_html__("Assistant Context Prompt", 'aiomatic-automatic-ai-content-writer');?>:
521
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
522
+
<div class="bws_hidden_help_text cr_min_260px">
523
+
<?php
524
+
echo esc_html__("Set the prompt which will be sent to the AI. Add a context to the AI chatbot, so it knows how to act and how to respond to customers. You can define here the language, tone of voice and role of the AI assistant. Any other settings will also be able to be defined here. This text will be preppended to each conversation, to teach the AI some additional info about you or its behavior. This text will not be displayed to users, it will be only sent to the chatbot. You can also use shortcodes in this field. List of supported shortcodes: %%post_title%%, %%post_content%%, %%post_content_plain_text%%, %%post_excerpt%%, %%post_cats%%, %%post_tags%%, %%featured_image%%, %%blog_title%%, %%author_name%%, %%current_date_time%%, %%post_link%%, %%random_sentence%%, %%random_sentence2%%, %%user_name%%, %%user_email%%, %%user_display_name%%, %%user_role%%, %%user_id%%, %%user_firstname%%, %%user_lastname%%, %%user_url%%, %%user_description%%. You can also use custom fields (post meta) that it's assigned to posts using custom shortcodes in this format: %%!custom_field_slug!%%. You can also use custom user meta fields (user meta) which is assigned to users using custom shortcodes in this format: %%~custom_field_slug~%%. Example: if you wish to add data that is imported from the custom field post_data, you should use this shortcode: %%!post_data!%%. The length of this command should not be greater than the max token count set in the settings for the seed command - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins).", 'aiomatic-automatic-ai-content-writer');
525
+
?>
526
+
</div>
527
+
</div></h4>
528
+
<textarea rows="4" id="aiomatic-assistant-prompt" name="aiomatic-assistant-prompt" class="aiomatic-full-size" placeholder="Assistant context prompt"></textarea>
529
+
<br/>
530
+
<h4><?php echo esc_html__("Assistant First Message", 'aiomatic-automatic-ai-content-writer');?>:
531
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
532
+
<div class="bws_hidden_help_text cr_min_260px">
533
+
<?php
534
+
echo esc_html__("Set the first message of this assistant.", 'aiomatic-automatic-ai-content-writer');
535
+
?>
536
+
</div>
537
+
</div></h4>
538
+
<textarea rows="4" id="aiomatic-assistant-first-message" name="aiomatic-assistant-first-message" class="aiomatic-full-size" placeholder="Assistant first message"></textarea>
539
+
<br/>
540
+
<h4><?php echo esc_html__("Code Interpreter", 'aiomatic-automatic-ai-content-writer');?>:
541
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
542
+
<div class="bws_hidden_help_text cr_min_260px">
543
+
<?php
544
+
echo esc_html__("Code Interpreter enables the assistant to write and run code. This tool can process files with diverse data and formatting, and generate files such as graphs. This feature supports a maximum of 20 files.", 'aiomatic-automatic-ai-content-writer');
545
+
?>
546
+
</div>
547
+
</div> <input id="aiomatic-assistant-code-interpreter" value="on" type="checkbox" name="aiomatic-assistant-code-interpreter"></h4>
548
+
<h4><?php echo esc_html__("File Search", 'aiomatic-automatic-ai-content-writer');?>:
549
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
550
+
<div class="bws_hidden_help_text cr_min_260px">
551
+
<?php
552
+
echo esc_html__("File Search enables the assistant with knowledge from files that you or your users upload. Once a file is uploaded, the assistant automatically decides when to retrieve content based on user requests. To enable this functionality, a newer model is needed, version 1106 or newer.", 'aiomatic-automatic-ai-content-writer');
553
+
?>
554
+
</div>
555
+
</div> <input id="aiomatic-assistant-file_search" value="on" type="checkbox" name="aiomatic-assistant-file_search"></h4>
556
+
<h4><?php echo esc_html__("Assistant Files", 'aiomatic-automatic-ai-content-writer');?>:
557
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
558
+
<div class="bws_hidden_help_text cr_min_260px">
559
+
<?php
560
+
echo esc_html__("Select the files which will be available for the assistant. You can add more files in the 'Manage Assistant Files' menu. To enable this functionality, code interpreter or file_search needs to be enabled for this assistant.", 'aiomatic-automatic-ai-content-writer');
561
+
?>
562
+
</div>
563
+
</div></h4>
564
+
<select autocomplete="off" id="aiomatic-assistant-files" multiple name="aiomatic-assistant-files[]" class="aiomatic-full-size resize_vertical" disabled>
565
+
566
+
</select>
567
+
<br/>
568
+
<h4><?php echo esc_html__("Assistant Functions", 'aiomatic-automatic-ai-content-writer');?>:
569
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
570
+
<div class="bws_hidden_help_text cr_min_260px">
571
+
<?php
572
+
echo esc_html__("Set the function or an array of functions, which the assistant will be able to call You need to respect the required function format, for this to work.", 'aiomatic-automatic-ai-content-writer');
573
+
?>
574
+
</div>
575
+
</div></h4>
576
+
<textarea rows="4" id="aiomatic-assistant-functions" name="aiomatic-assistant-functions" class="aiomatic-full-size" placeholder="{
577
+
"name": "get_weather",
578
+
"description": "Determine weather in my location",
579
+
"parameters": {
580
+
"type": "object",
581
+
"properties": {
582
+
"location": {
583
+
"type": "string",
584
+
"description": "The city and state e.g. San Francisco, CA"
585
+
},
586
+
"unit": {
587
+
"type": "string",
588
+
"enum": [
589
+
"c",
590
+
"f"
591
+
]
592
+
}
593
+
},
594
+
"required": [
595
+
"location"
596
+
]
597
+
}
598
+
}"></textarea>
599
+
<br/>
600
+
<input type='button' class="button-primary" value="<?php esc_attr_e( 'Disable Functions', 'aiomatic-automatic-ai-content-writer' ); ?>" id="aiomatic_god_mode_new_disable"/>
601
+
<br/>
602
+
<input type='checkbox' class="god_mode-checkbox" id="function_ai"/><label for="function_ai"><?php echo esc_html__( 'AI Generate Reasoning', 'aiomatic-automatic-ai-content-writer' ); ?></label>
603
+
<input type='checkbox' class="god_mode-checkbox" id="function_end"/><label for="function_end"><?php echo esc_html__( 'End Conversation', 'aiomatic-automatic-ai-content-writer' ); ?></label>
604
+
<input type='checkbox' class="god_mode-checkbox" id="function_dalle"/><label for="function_dalle"><?php echo esc_html__( 'Dall-E AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
605
+
<input type='checkbox' class="god_mode-checkbox" id="function_stable"/><label for="function_stable"><?php echo esc_html__( 'Stable Diffusion AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
606
+
<input type='checkbox' class="god_mode-checkbox" id="function_midjourney"/><label for="function_midjourney"><?php echo esc_html__( 'Midjourney AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
607
+
<input type='checkbox' class="god_mode-checkbox" id="function_replicate"/><label for="function_replicate"><?php echo esc_html__( 'Replicate AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
608
+
<input type='checkbox' class="god_mode-checkbox" id="function_ideogram"/><label for="function_ideogram"><?php echo esc_html__( 'Ideogram AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
609
+
<input type='checkbox' class="god_mode-checkbox" id="function_google_image"/><label for="function_google_image"><?php echo esc_html__( 'Google AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
610
+
<input type='checkbox' class="god_mode-checkbox" id="function_stable_video"/><label for="function_stable_video"><?php echo esc_html__( 'Stable Diffusion AI Videos', 'aiomatic-automatic-ai-content-writer' ); ?></label>
611
+
<input type='checkbox' class="god_mode-checkbox" id="function_lead_capture"/><label for="function_lead_capture"><?php echo esc_html__( 'Lead Capture', 'aiomatic-automatic-ai-content-writer' ); ?></label>
612
+
<input type='checkbox' class="god_mode-checkbox" id="function_amazon"/><label for="function_amazon"><?php echo esc_html__( 'Amazon Product Listing', 'aiomatic-automatic-ai-content-writer' ); ?></label>
613
+
<input type='checkbox' class="god_mode-checkbox" id="function_amazon_details"/><label for="function_amazon_details"><?php echo esc_html__( 'Amazon Product Details', 'aiomatic-automatic-ai-content-writer' ); ?></label>
614
+
<input type='checkbox' class="god_mode-checkbox" id="function_booking"/><label for="function_booking"><?php echo esc_html__( 'Booking Calendar Integration', 'aiomatic-automatic-ai-content-writer' ); ?></label>
615
+
<input type='checkbox' class="god_mode-checkbox" id="function_scraper"/><label for="function_scraper"><?php echo esc_html__( 'Website Scraper', 'aiomatic-automatic-ai-content-writer' ); ?></label>
616
+
<input type='checkbox' class="god_mode-checkbox" id="function_rss"/><label for="function_rss"><?php echo esc_html__( 'RSS Parser', 'aiomatic-automatic-ai-content-writer' ); ?></label>
617
+
<input type='checkbox' class="god_mode-checkbox" id="function_google"/><label for="function_google"><?php echo esc_html__( 'Google SERP Parser', 'aiomatic-automatic-ai-content-writer' ); ?></label>
618
+
<input type='checkbox' class="god_mode-checkbox" id="function_youtube"/><label for="function_youtube"><?php echo esc_html__( 'YouTube Video Search', 'aiomatic-automatic-ai-content-writer' ); ?></label>
619
+
<input type='checkbox' class="god_mode-checkbox" id="function_captions"/><label for="function_captions"><?php echo esc_html__( 'YouTube Video Captions Scraper', 'aiomatic-automatic-ai-content-writer' ); ?></label>
620
+
<input type='checkbox' class="god_mode-checkbox" id="function_royalty"/><label for="function_royalty"><?php echo esc_html__( 'Royalty Free Image Search', 'aiomatic-automatic-ai-content-writer' ); ?></label>
621
+
<input type='checkbox' class="god_mode-checkbox" id="function_email"/><label for="function_email"><?php echo esc_html__( 'Email Sending', 'aiomatic-automatic-ai-content-writer' ); ?></label>
622
+
<input type='checkbox' class="god_mode-checkbox" id="function_webhook"/><label for="function_webhook"><?php echo esc_html__( 'Webhook Calling', 'aiomatic-automatic-ai-content-writer' ); ?></label>
623
+
<input type='checkbox' class="god_mode-checkbox" id="function_omniblock"/><label for="function_omniblock"><?php echo esc_html__( 'OmniBlock Rule Trigger', 'aiomatic-automatic-ai-content-writer' ); ?></label>
624
+
<input type='checkbox' class="god_mode-checkbox" id="function_database"/><label for="function_database"><?php echo esc_html__( 'Database Query (WordPress Database Access)', 'aiomatic-automatic-ai-content-writer' ); ?></label>
625
+
<input type='checkbox' class="god_mode-checkbox" id="function_god_mode"/><label for="function_god_mode"><?php echo esc_html__( 'God Mode (WordPress Function Calling)', 'aiomatic-automatic-ai-content-writer' ); ?></label>
626
+
<input type='checkbox' class="god_mode-checkbox" id="function_toubiz"<?php if(!$toubiz_active){echo ' disabled title="Required plugin (Aimogen Extension Toubiz API) not activated"';}?>/><label for="function_toubiz"><?php echo esc_html__( 'Toubiz API Integration', 'aiomatic-automatic-ai-content-writer' ); ?></label>
627
+
<input type='checkbox' class="god_mode-checkbox" id="function_facebook"<?php if(!$fbomatic_active){echo ' disabled title="Required plugin (F-omatic) not activated"';}?>/><label for="function_facebook"><?php echo esc_html__( 'Facebook Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
628
+
<input type='checkbox' class="god_mode-checkbox" id="function_facebook_image"<?php if(!$fbomatic_active){echo ' disabled title="Required plugin (F-omatic) not activated"';}?>/><label for="function_facebook_image"><?php echo esc_html__( 'Facebook Image Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
629
+
<input type='checkbox' class="god_mode-checkbox" id="function_twitter"<?php if(!$twitomatic_active){echo ' disabled title="Required plugin (Twitomatic) not activated"';}?>/><label for="function_twitter"><?php echo esc_html__( 'Twitter Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
630
+
<input type='checkbox' class="god_mode-checkbox" id="function_threads"<?php if(!$threadsomatic_active){echo ' disabled title="Required plugin (Threadsomatic) not activated"';}?>/><label for="function_threads"><?php echo esc_html__( 'Threads Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
631
+
<input type='checkbox' class="god_mode-checkbox" id="function_instagram"<?php if(!$instamatic_active){echo ' disabled title="Required plugin (iMediamatic) not activated"';}?>/><label for="function_instagram"><?php echo esc_html__( 'Instagram Image Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
632
+
<input type='checkbox' class="god_mode-checkbox" id="function_pinterest"<?php if(!$pinterestomatic_active){echo ' disabled title="Required plugin (Pinterestomatic) not activated"';}?>/><label for="function_pinterest"><?php echo esc_html__( 'Pinterest Image Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
633
+
<input type='checkbox' class="god_mode-checkbox" id="function_business"<?php if(!$businessomatic_active){echo ' disabled title="Required plugin (Businessomatic) not activated"';}?>/><label for="function_business"><?php echo esc_html__( 'Google My Business Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
634
+
<input type='checkbox' class="god_mode-checkbox" id="function_youtube_community"<?php if(!$youtubomatic_active){echo ' disabled title="Required plugin (Youtubomatic) not activated"';}?>/><label for="function_youtube_community"><?php echo esc_html__( 'YouTube Community Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
635
+
<input type='checkbox' class="god_mode-checkbox" id="function_reddit"<?php if(!$redditomatic_active){echo ' disabled title="Required plugin (Redditomatic) not activated"';}?>/><label for="function_reddit"><?php echo esc_html__( 'Reddit Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
636
+
<input type='checkbox' class="god_mode-checkbox" id="function_linkedin"<?php if(!$linkedinomatic_active){echo ' disabled title="Required plugin (Linkedinomatic) not activated"';}?>/><label for="function_linkedin"><?php echo esc_html__( 'LinkedIn Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
637
+
<h4><?php echo esc_html__("Assistant Avatar", 'aiomatic-automatic-ai-content-writer');?>:
638
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
639
+
<div class="bws_hidden_help_text cr_min_260px">
640
+
<?php
641
+
echo esc_html__("Set the avatar of the chatbot assistant.", 'aiomatic-automatic-ai-content-writer');
642
+
?>
643
+
</div>
644
+
</div></h4>
645
+
<div class="coderevolution_gutenberg_input"><img id="aiomatic-preview-image-new"/></div>
646
+
<input type="hidden" name="aiomatic-assistant-avatar" id="aiomatic_image_id_new" value="" />
647
+
<input type='button' class="button-primary" value="<?php esc_attr_e( 'Select an avatar', 'aiomatic-automatic-ai-content-writer' ); ?>" id="aiomatic_media_manager_new"/>
648
+
<input type='button' class="button-primary" value="<?php esc_attr_e( 'Clear avatar', 'aiomatic-automatic-ai-content-writer' ); ?>" id="aiomatic_media_clear_new"/>
649
+
<br/><br/>
650
+
<hr/>
651
+
<button id="aiomatic-assistants-save-button" class="button button-primary"><?php echo esc_html__("Save", 'aiomatic-automatic-ai-content-writer');?></button>
652
+
<div class="aiomatic-assistants-success"></div>
653
+
<br/>
654
+
</form>
655
+
</div>
656
+
</div>
657
+
</div>
658
+
</div>
659
+
660
+
<div id="mymodalfzr-edit" class="codemodalfzr">
661
+
<div class="codemodalfzr-content">
662
+
<div class="codemodalfzr-header">
663
+
<span id="aiomatic_close-edit" class="codeclosefzr">×</span>
664
+
<h2><span class="cr_color_white"><?php echo esc_html__("Edit Assistant", 'aiomatic-automatic-ai-content-writer');?></span></h2>
665
+
</div>
666
+
<div class="codemodalfzr-body">
667
+
<div class="table-responsive">
668
+
<form action="#" method="post" id="aiomatic_assistants_form-edit">
669
+
<br/>
670
+
<input type="hidden" name="action" value="aiomatic_assistants_edit">
671
+
<input type="hidden" name="nonce" value="<?php echo esc_html(wp_create_nonce('aiomatic_assistants'));?>">
672
+
<input type="hidden" name="assistant_id" id="assistant_id" value="">
673
+
<h4><?php echo esc_html__("Assistant Name*", 'aiomatic-automatic-ai-content-writer');?>:<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
674
+
<div class="bws_hidden_help_text cr_min_260px">
675
+
<?php
676
+
echo esc_html__("Set the name of this assistant.", 'aiomatic-automatic-ai-content-writer');
677
+
?>
678
+
</div>
679
+
</div></h4>
680
+
<textarea rows="1" id="aiomatic-assistant-title-edit" name="aiomatic-assistant-title" class="aiomatic-full-size" placeholder="Assistant name" required></textarea>
681
+
<br/>
682
+
<h4><?php echo esc_html__("Assistant Model*", 'aiomatic-automatic-ai-content-writer');?>:<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
683
+
<div class="bws_hidden_help_text cr_min_260px">
684
+
<?php
685
+
echo esc_html__("Set the AI model of this assistant.", 'aiomatic-automatic-ai-content-writer');
686
+
?>
687
+
</div>
688
+
</div></h4>
689
+
<select autocomplete="off" id="aiomatic-assistant-model-edit" name="aiomatic-assistant-model" class="aiomatic-full-size">
690
+
<?php
691
+
if(aiomatic_check_if_azure($aiomatic_Main_Settings))
692
+
{
693
+
$assist_mods = aiomatic_get_assistant_models();
694
+
}
695
+
else
696
+
{
697
+
$assist_mods = array_merge(aiomatic_get_assistant_models(), get_option('aiomatic_custom_models', array()));
698
+
}
699
+
foreach($assist_mods as $modelx)
700
+
{
701
+
echo '<option value="' . esc_html($modelx) .'"';
702
+
echo '>' . esc_html($modelx);
703
+
if(aiomatic_is_vision_model($modelx, ''))
704
+
{
705
+
echo esc_html__(" (Vision)", 'aiomatic-automatic-ai-content-writer');
706
+
}
707
+
echo '</option>';
708
+
}
709
+
?>
710
+
</select>
711
+
<br/>
712
+
<h4><?php echo esc_html__("Model Temperature", 'aiomatic-automatic-ai-content-writer');?>:<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
713
+
<div class="bws_hidden_help_text cr_min_260px">
714
+
<?php
715
+
echo esc_html__("What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.", 'aiomatic-automatic-ai-content-writer');
716
+
?>
717
+
</div>
718
+
</div></h4>
719
+
<input type="number" min="0" step="0.01" max="2" id="aiomatic-assistant-temperature-edit" name="aiomatic-assistant-temperature" value="" placeholder="Model temperature" class="cr_width_full">
720
+
<br/>
721
+
<h4><?php echo esc_html__("Model Top_p", 'aiomatic-automatic-ai-content-writer');?>:<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
722
+
<div class="bws_hidden_help_text cr_min_260px">
723
+
<?php
724
+
echo esc_html__("An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.", 'aiomatic-automatic-ai-content-writer');
725
+
?>
726
+
</div>
727
+
</div></h4>
728
+
<input type="number" min="0" max="1" step="0.01" id="aiomatic-assistant-topp-edit" name="aiomatic-assistant-topp" value="" placeholder="Model top_p" class="cr_width_full">
729
+
<br/>
730
+
<h4><?php echo esc_html__("Assistant Description", 'aiomatic-automatic-ai-content-writer');?>:<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
731
+
<div class="bws_hidden_help_text cr_min_260px">
732
+
<?php
733
+
echo esc_html__("Set the description of this assistant.", 'aiomatic-automatic-ai-content-writer');
734
+
?>
735
+
</div>
736
+
</div></h4>
737
+
<textarea rows="1" id="aiomatic-assistant-description-edit" name="aiomatic-assistant-description" class="aiomatic-full-size" placeholder="Assistant description"></textarea>
738
+
<br/>
739
+
<h4><?php echo esc_html__("Assistant Context Prompt", 'aiomatic-automatic-ai-content-writer');?>:
740
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
741
+
<div class="bws_hidden_help_text cr_min_260px">
742
+
<?php
743
+
echo esc_html__("Set the prompt which will be sent to the AI. Add a context to the AI chatbot, so it knows how to act and how to respond to customers. You can define here the language, tone of voice and role of the AI assistant. Any other settings will also be able to be defined here. This text will be preppended to each conversation, to teach the AI some additional info about you or its behavior. This text will not be displayed to users, it will be only sent to the chatbot. You can also use shortcodes in this field. List of supported shortcodes: %%post_title%%, %%post_content%%, %%post_content_plain_text%%, %%post_excerpt%%, %%post_cats%%, %%post_tags%%, %%featured_image%%, %%blog_title%%, %%author_name%%, %%current_date_time%%, %%post_link%%, %%random_sentence%%, %%random_sentence2%%, %%user_name%%, %%user_email%%, %%user_display_name%%, %%user_role%%, %%user_id%%, %%user_firstname%%, %%user_lastname%%, %%user_url%%, %%user_description%%. You can also use custom fields (post meta) that it's assigned to posts using custom shortcodes in this format: %%!custom_field_slug!%%. You can also use custom user meta fields (user meta) which is assigned to users using custom shortcodes in this format: %%~custom_field_slug~%%. Example: if you wish to add data that is imported from the custom field post_data, you should use this shortcode: %%!post_data!%%. The length of this command should not be greater than the max token count set in the settings for the seed command - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins).", 'aiomatic-automatic-ai-content-writer');
744
+
?>
745
+
</div>
746
+
</div></h4>
747
+
<textarea rows="4" id="aiomatic-assistant-prompt-edit" name="aiomatic-assistant-prompt" class="aiomatic-full-size" placeholder="Assistant context prompt"></textarea>
748
+
<br/>
749
+
<h4><?php echo esc_html__("Assistant First Message", 'aiomatic-automatic-ai-content-writer');?>:
750
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
751
+
<div class="bws_hidden_help_text cr_min_260px">
752
+
<?php
753
+
echo esc_html__("Set the first message of this assistant.", 'aiomatic-automatic-ai-content-writer');
754
+
?>
755
+
</div>
756
+
</div></h4>
757
+
<textarea rows="4" id="aiomatic-assistant-first-message-edit" name="aiomatic-assistant-first-message" class="aiomatic-full-size" placeholder="Assistant first message"></textarea>
758
+
<br/>
759
+
<h4><?php echo esc_html__("Code Interpreter", 'aiomatic-automatic-ai-content-writer');?>:
760
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
761
+
<div class="bws_hidden_help_text cr_min_260px">
762
+
<?php
763
+
echo esc_html__("Code Interpreter enables the assistant to write and run code. This tool can process files with diverse data and formatting, and generate files such as graphs. This feature supports a maximum of 20 files.", 'aiomatic-automatic-ai-content-writer');
764
+
?>
765
+
</div>
766
+
</div> <input id="aiomatic-assistant-code-interpreter-edit" value="on" type="checkbox" name="aiomatic-assistant-code-interpreter"></h4>
767
+
<h4><?php echo esc_html__("File Search", 'aiomatic-automatic-ai-content-writer');?>:
768
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
769
+
<div class="bws_hidden_help_text cr_min_260px">
770
+
<?php
771
+
echo esc_html__("File Search enables the assistant with knowledge from files that you or your users upload. Once a file is uploaded, the assistant automatically decides when to retrieve content based on user requests. To enable this functionality, a newer model is needed, version 1106 or newer.", 'aiomatic-automatic-ai-content-writer');
772
+
?>
773
+
</div>
774
+
</div> <input id="aiomatic-assistant-file_search-edit" value="on" type="checkbox" name="aiomatic-assistant-file_search"> <span id="aiomatic-assistant-vector-store-edit"></span></h4>
775
+
<h4><?php echo esc_html__("Assistant Files", 'aiomatic-automatic-ai-content-writer');?>:
776
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
777
+
<div class="bws_hidden_help_text cr_min_260px">
778
+
<?php
779
+
echo esc_html__("Select the files which will be available for the assistant. You can add more files in the 'Manage Assistant Files' menu. To enable this functionality, code interpreter or file_search needs to be enabled for this assistant.", 'aiomatic-automatic-ai-content-writer');
780
+
?>
781
+
</div>
782
+
</div></h4>
783
+
<select autocomplete="off" id="aiomatic-assistant-files-edit" multiple name="aiomatic-assistant-files[]" class="aiomatic-full-size resize_vertical" disabled>
784
+
785
+
</select>
786
+
<br/>
787
+
<h4><?php echo esc_html__("Assistant Functions", 'aiomatic-automatic-ai-content-writer');?>:
788
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
789
+
<div class="bws_hidden_help_text cr_min_260px">
790
+
<?php
791
+
echo esc_html__("Set the function or an array of functions, which the assistant will be able to call You need to respect the required function format, for this to work.", 'aiomatic-automatic-ai-content-writer');
792
+
?>
793
+
</div>
794
+
</div></h4>
795
+
<textarea rows="4" id="aiomatic-assistant-functions-edit" name="aiomatic-assistant-functions" class="aiomatic-full-size" placeholder="{
796
+
"name": "get_weather",
797
+
"description": "Determine weather in my location",
798
+
"parameters": {
799
+
"type": "object",
800
+
"properties": {
801
+
"location": {
802
+
"type": "string",
803
+
"description": "The city and state e.g. San Francisco, CA"
804
+
},
805
+
"unit": {
806
+
"type": "string",
807
+
"enum": [
808
+
"c",
809
+
"f"
810
+
]
811
+
}
812
+
},
813
+
"required": [
814
+
"location"
815
+
]
816
+
}
817
+
}"></textarea>
818
+
<br/>
819
+
<input type='button' class="button-primary" value="<?php esc_attr_e( 'Disable Functions', 'aiomatic-automatic-ai-content-writer' ); ?>" id="aiomatic_god_mode_new_disable-edit"/>
820
+
<br/>
821
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_ai-edit"/><label for="function_ai-edit"><?php echo esc_html__( 'AI Generate Reasoning', 'aiomatic-automatic-ai-content-writer' ); ?></label>
822
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_end-edit"/><label for="function_end-edit"><?php echo esc_html__( 'End Conversation', 'aiomatic-automatic-ai-content-writer' ); ?></label>
823
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_dalle-edit"/><label for="function_dalle-edit"><?php echo esc_html__( 'Dall-E AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
824
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_stable-edit"/><label for="function_stable-edit"><?php echo esc_html__( 'Stable Diffusion AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
825
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_midjourney-edit"/><label for="function_midjourney-edit"><?php echo esc_html__( 'Midjourney AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
826
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_replicate-edit"/><label for="function_replicate-edit"><?php echo esc_html__( 'Replicate AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
827
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_ideogram-edit"/><label for="function_ideogram-edit"><?php echo esc_html__( 'Ideogram AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
828
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_google_image-edit"/><label for="function_google_image-edit"><?php echo esc_html__( 'Google AI Images', 'aiomatic-automatic-ai-content-writer' ); ?></label>
829
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_stable_video-edit"/><label for="function_stable_video-edit"><?php echo esc_html__( 'Stable Diffusion AI Videos', 'aiomatic-automatic-ai-content-writer' ); ?></label>
830
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_lead_capture-edit"/><label for="function_lead_capture-edit"><?php echo esc_html__( 'Lead Capture', 'aiomatic-automatic-ai-content-writer' ); ?></label>
831
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_amazon-edit"/><label for="function_amazon-edit"><?php echo esc_html__( 'Amazon Product Listing', 'aiomatic-automatic-ai-content-writer' ); ?></label>
832
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_amazon_details-edit"/><label for="function_amazon_details-edit"><?php echo esc_html__( 'Amazon Product Details', 'aiomatic-automatic-ai-content-writer' ); ?></label>
833
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_booking-edit"/><label for="function_booking-edit"><?php echo esc_html__( 'Booking Calendar Integration', 'aiomatic-automatic-ai-content-writer' ); ?></label>
834
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_scraper-edit"/><label for="function_scraper-edit"><?php echo esc_html__( 'Website Scraper', 'aiomatic-automatic-ai-content-writer' ); ?></label>
835
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_rss-edit"/><label for="function_rss-edit"><?php echo esc_html__( 'RSS Parser', 'aiomatic-automatic-ai-content-writer' ); ?></label>
836
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_google-edit"/><label for="function_google-edit"><?php echo esc_html__( 'Google SERP Parser', 'aiomatic-automatic-ai-content-writer' ); ?></label>
837
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_youtube-edit"/><label for="function_youtube-edit"><?php echo esc_html__( 'YouTube Video Search', 'aiomatic-automatic-ai-content-writer' ); ?></label>
838
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_captions-edit"/><label for="function_captions-edit"><?php echo esc_html__( 'YouTube Video Captions Scraper', 'aiomatic-automatic-ai-content-writer' ); ?></label>
839
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_royalty-edit"/><label for="function_royalty-edit"><?php echo esc_html__( 'Royalty Free Image Search', 'aiomatic-automatic-ai-content-writer' ); ?></label>
840
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_email-edit"/><label for="function_email-edit"><?php echo esc_html__( 'Email Sending', 'aiomatic-automatic-ai-content-writer' ); ?></label>
841
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_webhook-edit"/><label for="function_webhook-edit"><?php echo esc_html__( 'Webhook Calling', 'aiomatic-automatic-ai-content-writer' ); ?></label>
842
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_omniblock-edit"/><label for="function_omniblock-edit"><?php echo esc_html__( 'OmniBlock Rule Trigger', 'aiomatic-automatic-ai-content-writer' ); ?></label>
843
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_database-edit"/><label for="function_database-edit"><?php echo esc_html__( 'Database Query (WordPress Database Access)', 'aiomatic-automatic-ai-content-writer' ); ?></label>
844
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_god_mode-edit"/><label for="function_god_mode-edit"><?php echo esc_html__( 'God Mode (WordPress Function Calling)', 'aiomatic-automatic-ai-content-writer' ); ?></label>
845
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_toubiz-edit"<?php if(!$toubiz_active){echo ' disabled title="Required plugin (Aimogen Extension Toubiz API) not activated"';}?>/><label for="function_toubiz-edit"><?php echo esc_html__( 'Toubiz API Integration', 'aiomatic-automatic-ai-content-writer' ); ?></label>
846
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_facebook-edit"<?php if(!$fbomatic_active){echo ' disabled title="Required plugin (F-omatic) not activated"';}?>/><label for="function_facebook-edit"><?php echo esc_html__( 'Facebook Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
847
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_facebook_image-edit"<?php if(!$fbomatic_active){echo ' disabled title="Required plugin (F-omatic) not activated"';}?>/><label for="function_facebook_image-edit"><?php echo esc_html__( 'Facebook Image Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
848
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_twitter-edit"<?php if(!$twitomatic_active){echo ' disabled title="Required plugin (Twitomatic) not activated"';}?>/><label for="function_twitter-edit"><?php echo esc_html__( 'Twitter Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
849
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_threads-edit"<?php if(!$threadsomatic_active){echo ' disabled title="Required plugin (Threadsomatic) not activated"';}?>/><label for="function_threads-edit"><?php echo esc_html__( 'Threads Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
850
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_instagram-edit"<?php if(!$instamatic_active){echo ' disabled title="Required plugin (iMediamatic) not activated"';}?>/><label for="function_instagram-edit"><?php echo esc_html__( 'Instagram Image Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
851
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_pinterest-edit"<?php if(!$pinterestomatic_active){echo ' disabled title="Required plugin (Pinterestomatic) not activated"';}?>/><label for="function_pinterest-edit"><?php echo esc_html__( 'Pinterest Image Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
852
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_business-edit"<?php if(!$businessomatic_active){echo ' disabled title="Required plugin (Businessomatic) not activated"';}?>/><label for="function_business-edit"><?php echo esc_html__( 'Google My Business Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
853
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_youtube_community-edit"<?php if(!$youtubomatic_active){echo ' disabled title="Required plugin (Youtubomatic) not activated"';}?>/><label for="function_youtube_community-edit"><?php echo esc_html__( 'YouTube Community Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
854
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_reddit-edit"<?php if(!$redditomatic_active){echo ' disabled title="Required plugin (Redditomatic) not activated"';}?>/><label for="function_reddit-edit"><?php echo esc_html__( 'Reddit Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
855
+
<input type='checkbox' class="god_mode-edit-checkbox" id="function_linkedin-edit"<?php if(!$linkedinomatic_active){echo ' disabled title="Required plugin (Linkedinomatic) not activated"';}?>/><label for="function_linkedin-edit"><?php echo esc_html__( 'LinkedIn Posting', 'aiomatic-automatic-ai-content-writer' ); ?></label>
856
+
<h4><?php echo esc_html__("Assistant Avatar", 'aiomatic-automatic-ai-content-writer');?>:
857
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
858
+
<div class="bws_hidden_help_text cr_min_260px">
859
+
<?php
860
+
echo esc_html__("Set the avatar of the chatbot assistant.", 'aiomatic-automatic-ai-content-writer');
861
+
?>
862
+
</div>
863
+
</div></h4>
864
+
<div class="coderevolution_gutenberg_input"><img id="aiomatic-preview-image-new-edit"/></div>
865
+
<input type="hidden" name="aiomatic-assistant-avatar" id="aiomatic_image_id_new-edit" value="" />
866
+
<input type='button' class="button-primary" value="<?php esc_attr_e( 'Select an avatar', 'aiomatic-automatic-ai-content-writer' ); ?>" id="aiomatic_media_manager_new-edit"/>
867
+
<input type='button' class="button-primary" value="<?php esc_attr_e( 'Clear avatar', 'aiomatic-automatic-ai-content-writer' ); ?>" id="aiomatic_media_clear_new-edit"/>
868
+
<br/><br/>
869
+
<hr/>
870
+
<button id="aiomatic-assistants-save-button-edit" class="button button-primary"><?php echo esc_html__("Save", 'aiomatic-automatic-ai-content-writer');?></button>
871
+
<div class="aiomatic-assistants-success"></div>
872
+
<br/>
873
+
</form>
874
+
</div>
875
+
</div>
876
+
</div>
877
+
</div>
878
+
</div>
879
+
<?php
880
+
}
881
+
?>