- Allow the chat-widget to connect to multiple servers (e.g. development and production)

- Created a full session overview
This commit is contained in:
Josako
2024-08-28 10:11:31 +02:00
parent 6062b7646c
commit bc350af247
14 changed files with 229 additions and 909 deletions

View File

@@ -3,7 +3,7 @@
Plugin Name: EveAI Chat Widget
Plugin URI: https://askeveai.com/
Description: Integrates the EveAI chat interface into your WordPress site.
Version: 1.4.1
Version: 1.5.0
Author: Josako, Pieter Laroy
Author URI: https://askeveai.com/about/
*/
@@ -28,7 +28,8 @@ function eveai_chat_shortcode($atts) {
'api_key' => '',
'domain' => '',
'language' => 'en',
'supported_languages' => 'en,fr,de,es'
'supported_languages' => 'en,fr,de,es',
'server_url' => 'https://evie.askeveai.com'
);
// Merge provided attributes with defaults
@@ -40,6 +41,7 @@ function eveai_chat_shortcode($atts) {
$domain = esc_url_raw($atts['domain']);
$language = sanitize_text_field($atts['language']);
$supported_languages = sanitize_text_field($atts['supported_languages']);
$server_url = esc_url_raw($atts['server_url']);
// Generate a unique ID for this instance of the chat widget
$chat_id = 'chat-container-' . uniqid();
@@ -52,7 +54,8 @@ function eveai_chat_shortcode($atts) {
'$api_key',
'$domain',
'$language',
'$supported_languages'
'$supported_languages',
'$server_url'
);
eveAI.initializeChat('$chat_id');
});