diff --git a/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserRole.cs b/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserRole.cs
index 9146fe96..02c095bc 100644
--- a/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserRole.cs
+++ b/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserRole.cs
@@ -16,4 +16,9 @@ public class UserRole
/// Client
///
public const string Client = "client";
+
+ ///
+ /// AI Assistant
+ ///
+ public const string Assistant = "assistant";
}
diff --git a/src/Infrastructure/BotSharp.Core/Repository/FileRepository.cs b/src/Infrastructure/BotSharp.Core/Repository/FileRepository.cs
index 2e516177..e7d7347a 100644
--- a/src/Infrastructure/BotSharp.Core/Repository/FileRepository.cs
+++ b/src/Infrastructure/BotSharp.Core/Repository/FileRepository.cs
@@ -799,10 +799,11 @@ public class FileRepository : IBotSharpRepository
if (record == null) continue;
var matched = true;
- if (!string.IsNullOrEmpty(filter.AgentId)) matched = matched && record.AgentId == filter.AgentId;
- if (!string.IsNullOrEmpty(filter.Status)) matched = matched && record.Status == filter.Status;
- if (!string.IsNullOrEmpty(filter.Channel)) matched = matched && record.Channel == filter.Channel;
- if (!string.IsNullOrEmpty(filter.UserId)) matched = matched && record.UserId == filter.UserId;
+ if(filter.Id != null) matched = matched && record.Id == filter.Id;
+ if (filter.AgentId != null) matched = matched && record.AgentId == filter.AgentId;
+ if (filter.Status != null) matched = matched && record.Status == filter.Status;
+ if (filter.Channel != null) matched = matched && record.Channel == filter.Channel;
+ if (filter.UserId != null) matched = matched && record.UserId == filter.UserId;
if (!matched) continue;
records.Add(record);
diff --git a/src/Infrastructure/BotSharp.Logger/Hooks/VerboseLogHook.cs b/src/Infrastructure/BotSharp.Logger/Hooks/VerboseLogHook.cs
index 119e1bba..cf6985e9 100644
--- a/src/Infrastructure/BotSharp.Logger/Hooks/VerboseLogHook.cs
+++ b/src/Infrastructure/BotSharp.Logger/Hooks/VerboseLogHook.cs
@@ -24,7 +24,7 @@ public class VerboseLogHook : IContentGeneratingHook
if (!_convSettings.ShowVerboseLog) return;
var dialog = conversations.Last();
- var log = $"[msg_id: {dialog.MessageId}] {dialog.Role}: {dialog.Content}";
+ var log = $"{dialog.Role}: {dialog.Content} [msg_id: {dialog.MessageId}] ==>";
_logger.LogInformation(log);
await Task.CompletedTask;
@@ -38,8 +38,8 @@ public class VerboseLogHook : IContentGeneratingHook
var agent = await agentService.LoadAgent(message.CurrentAgentId);
var log = message.Role == AgentRole.Function ?
- $"[[msg_id: {message.MessageId}] [{agent?.Name}]: {message.FunctionName}({message.FunctionArgs})" :
- $"[[msg_id: {message.MessageId}] [{agent?.Name}]: {message.Content}";
+ $"[{agent?.Name}]: {message.FunctionName}({message.FunctionArgs})" :
+ $"[{agent?.Name}]: {message.Content}" + $" <== [msg_id: {message.MessageId}]";
_logger.LogInformation(tokenStats.Prompt);
_logger.LogInformation(log);
diff --git a/src/Infrastructure/BotSharp.OpenAPI/Controllers/ConversationController.cs b/src/Infrastructure/BotSharp.OpenAPI/Controllers/ConversationController.cs
index e29298b2..505f794f 100644
--- a/src/Infrastructure/BotSharp.OpenAPI/Controllers/ConversationController.cs
+++ b/src/Infrastructure/BotSharp.OpenAPI/Controllers/ConversationController.cs
@@ -93,6 +93,9 @@ public class ConversationController : ControllerBase
var userService = _services.GetRequiredService();
var result = ConversationViewModel.FromSession(conversations.Items.First());
+ var state = _services.GetRequiredService();
+ result.States = state.Load(conversationId);
+
var user = await userService.GetUser(result.User.Id);
result.User = UserViewModel.FromUser(user);
diff --git a/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Conversations/ConversationViewModel.cs b/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Conversations/ConversationViewModel.cs
index eaa9a11f..556991ab 100644
--- a/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Conversations/ConversationViewModel.cs
+++ b/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Conversations/ConversationViewModel.cs
@@ -1,6 +1,3 @@
-using BotSharp.Abstraction.Conversations.Enums;
-using BotSharp.Abstraction.Conversations.Models;
-using BotSharp.OpenAPI.ViewModels.Users;
using System.Text.Json.Serialization;
namespace BotSharp.OpenAPI.ViewModels.Conversations;
@@ -23,6 +20,7 @@ public class ConversationViewModel
public string Channel { get; set; } = ConversationChannel.OpenAPI;
public string Status { get; set; }
+ public ConversationState States { get; set; }
[JsonPropertyName("updated_time")]
public DateTime UpdatedTime { get; set; } = DateTime.UtcNow;