Add Conversation + Turn entities and migration
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace backend.Conversations;
|
||||
|
||||
public enum EndReason
|
||||
{
|
||||
Unknown = 0,
|
||||
Tool = 1,
|
||||
Idle = 2,
|
||||
Error = 3,
|
||||
}
|
||||
|
||||
public class Conversation
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid DeviceId { get; set; }
|
||||
public DateTimeOffset StartedAt { get; set; }
|
||||
public DateTimeOffset? EndedAt { get; set; }
|
||||
public EndReason EndReason { get; set; } = EndReason.Unknown;
|
||||
public List<Turn> Turns { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace backend.Conversations;
|
||||
|
||||
public enum TurnRole
|
||||
{
|
||||
User = 0,
|
||||
Assistant = 1,
|
||||
Tool = 2,
|
||||
}
|
||||
|
||||
public class Turn
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid ConversationId { get; set; }
|
||||
public int Index { get; set; }
|
||||
public TurnRole Role { get; set; }
|
||||
public string? Text { get; set; }
|
||||
public string? ToolName { get; set; }
|
||||
public string? ToolArgsJson { get; set; }
|
||||
public string? ToolResultJson { get; set; }
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user