diff --git a/docs/static/screenshots/web-live-chat.png b/docs/static/screenshots/web-live-chat.png index feffd6e3..13189534 100644 Binary files a/docs/static/screenshots/web-live-chat.png and b/docs/static/screenshots/web-live-chat.png differ diff --git a/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/ChatHubConversationHook.cs b/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/ChatHubConversationHook.cs index 590e65f2..1b9a0089 100644 --- a/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/ChatHubConversationHook.cs +++ b/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/ChatHubConversationHook.cs @@ -2,7 +2,6 @@ using BotSharp.Abstraction.Messaging; using BotSharp.Abstraction.Messaging.JsonConverters; using BotSharp.Abstraction.Messaging.Models.RichContent; using Microsoft.AspNetCore.SignalR; -using System.Text.Json.Serialization.Metadata; namespace BotSharp.Plugin.ChatHub.Hooks; @@ -102,7 +101,7 @@ public class ChatHubConversationHook : ConversationHookBase { var conv = _services.GetRequiredService(); - await _chatHub.Clients.User(_user.Id).SendAsync("OnMessageReceivedFromAssistant", new ChatResponseModel() + var json = JsonSerializer.Serialize(new ChatResponseModel() { ConversationId = conv.ConversationId, MessageId = message.MessageId, @@ -114,7 +113,8 @@ public class ChatHubConversationHook : ConversationHookBase LastName = "Assistant", Role = AgentRole.Assistant } - }); + }, _serializerOptions); + await _chatHub.Clients.User(_user.Id).SendAsync("OnMessageReceivedFromAssistant", json); await base.OnResponseGenerated(message); } diff --git a/src/WebStarter/appsettings.json b/src/WebStarter/appsettings.json index 0e9bbd5e..718ca4bc 100644 --- a/src/WebStarter/appsettings.json +++ b/src/WebStarter/appsettings.json @@ -52,7 +52,7 @@ "MaxRecursiveDepth": 3, "LlmConfig": { "Provider": "azure-openai", - "Model": "one" + "Model": "gpt-35-turbo" } }, diff --git a/src/WebStarter/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/agent.json b/src/WebStarter/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/agent.json index a5e40a9f..af5d7e1a 100644 --- a/src/WebStarter/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/agent.json +++ b/src/WebStarter/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/agent.json @@ -4,9 +4,5 @@ "createdDateTime": "2023-08-18T14:39:32.2349685Z", "updatedDateTime": "2023-08-18T14:39:32.2349686Z", "id": "01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a", - "isPublic": true, - "llmConfig": { - "provider": "azure-openai", - "model": "one" - } + "isPublic": true } \ No newline at end of file diff --git a/src/web-live-chat/src/lib/helpers/typedefs.js b/src/web-live-chat/src/lib/helpers/typedefs.js index e4246b3e..1997ab14 100644 --- a/src/web-live-chat/src/lib/helpers/typedefs.js +++ b/src/web-live-chat/src/lib/helpers/typedefs.js @@ -66,8 +66,7 @@ IRichContent.prototype.rich_type; IRichContent.prototype.text; /** - * @typedef {IRichContent} TextMessage - * @implements {IRichContent} + * @typedef {Object} TextMessage * @property {string} text * @property {string} rich_type */ @@ -81,7 +80,7 @@ IRichContent.prototype.text; */ /** - * @typedef {IRichContent} QuickReplyMessage + * @typedef {Object} QuickReplyMessage * @property {string} text * @property {string} rich_type * @property {QuickReplyElement[]} quick_replies diff --git a/src/web-live-chat/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte b/src/web-live-chat/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte index 4ce81b2c..b84ada86 100644 --- a/src/web-live-chat/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte +++ b/src/web-live-chat/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte @@ -176,7 +176,11 @@ {#if message.rich_content.message.rich_type == 'text'} {:else if message.rich_content.message.rich_type == 'quick_reply'} - + {/if} {/if} diff --git a/src/web-live-chat/src/routes/chat/[agentId]/[conversationId]/rc-quick-reply.svelte b/src/web-live-chat/src/routes/chat/[agentId]/[conversationId]/rc-quick-reply.svelte index 45697302..d6bd4feb 100644 --- a/src/web-live-chat/src/routes/chat/[agentId]/[conversationId]/rc-quick-reply.svelte +++ b/src/web-live-chat/src/routes/chat/[agentId]/[conversationId]/rc-quick-reply.svelte @@ -1,12 +1,32 @@ {message.text}
{#each message.quick_replies as reply} - + {/each}
\ No newline at end of file