Skip to content

Commit 38656e1

Browse files
committed
fix: llm 개선
1 parent 74e90b1 commit 38656e1

File tree

19 files changed

+1033
-1565
lines changed

19 files changed

+1033
-1565
lines changed

ProjectVG.Application/Models/Character/CharacterDto.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ public class CharacterDto
1111
public bool IsActive { get; set; } = true;
1212
public string Personality { get; set; } = string.Empty;
1313
public string SpeechStyle { get; set; } = string.Empty;
14+
public string Summary { get; set; } = string.Empty;
15+
public string UserAlias { get; set; } = string.Empty;
1416
public string VoiceId { get; set; } = string.Empty;
1517

16-
public CharacterDto()
17-
{
18-
}
1918

2019
public CharacterDto(Domain.Entities.Characters.Character character)
2120
{
@@ -26,6 +25,8 @@ public CharacterDto(Domain.Entities.Characters.Character character)
2625
IsActive = character.IsActive;
2726
Personality = character.Personality;
2827
SpeechStyle = character.SpeechStyle;
28+
UserAlias = character.UserAlias;
29+
Summary = character.Summary;
2930
VoiceId = character.VoiceId;
3031
}
3132
}

ProjectVG.Application/Models/Chat/ChatMessageSegment.cs

Lines changed: 0 additions & 56 deletions
This file was deleted.

ProjectVG.Application/Models/Chat/ChatProcessContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ChatProcessContext
1919

2020
public string Response { get; private set; } = string.Empty;
2121
public double Cost { get; private set; }
22-
public List<ChatMessageSegment> Segments { get; private set; } = new List<ChatMessageSegment>();
22+
public List<ChatSegment> Segments { get; private set; } = new List<ChatSegment>();
2323

2424
public ChatProcessContext(ChatRequestCommand command)
2525
{
@@ -48,7 +48,7 @@ public ChatProcessContext(
4848
MemoryContext = memoryContext;
4949
}
5050

51-
public void SetResponse(string response, List<ChatMessageSegment> segments, double cost)
51+
public void SetResponse(string response, List<ChatSegment> segments, double cost)
5252
{
5353
Response = response;
5454
Segments = segments;
@@ -125,7 +125,7 @@ public string ToDebugString()
125125
for (int i = 0; i < Segments.Count; i++)
126126
{
127127
var segment = Segments[i];
128-
sb.AppendLine($" [{i}] Type: {segment.Type}, Content: \"{segment.Text}\"");
128+
sb.AppendLine($" [{i}] Type: {segment.Type}, Content: \"{segment.Content}\"");
129129
}
130130
}
131131
else
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
namespace ProjectVG.Application.Models.Chat
2+
{
3+
public enum SegmentType
4+
{
5+
Text = 0,
6+
Action = 1
7+
}
8+
9+
public record ChatSegment
10+
{
11+
public SegmentType Type { get; init; } = SegmentType.Text;
12+
13+
public string Content { get; init; } = string.Empty;
14+
15+
public int Order { get; init; }
16+
17+
public string? Emotion { get; init; }
18+
19+
public byte[]? AudioData { get; init; }
20+
public string? AudioContentType { get; init; }
21+
public float? AudioLength { get; init; }
22+
23+
24+
25+
public bool HasContent => !string.IsNullOrEmpty(Content);
26+
public bool HasAudio => AudioData != null && AudioData.Length > 0;
27+
public bool IsEmpty => !HasContent;
28+
public bool IsTextSegment => Type == SegmentType.Text && HasContent;
29+
public bool IsActionSegment => Type == SegmentType.Action && HasContent;
30+
public bool HasEmotion => !string.IsNullOrEmpty(Emotion);
31+
32+
33+
34+
public static ChatSegment CreateText(string content, string? emotion = null, int order = 0)
35+
{
36+
return new ChatSegment
37+
{
38+
Type = SegmentType.Text,
39+
Content = content,
40+
Emotion = emotion,
41+
Order = order
42+
};
43+
}
44+
45+
public static ChatSegment CreateAction(string action, int order = 0)
46+
{
47+
return new ChatSegment
48+
{
49+
Type = SegmentType.Action,
50+
Content = action,
51+
Order = order
52+
};
53+
}
54+
55+
// Method to add audio data (returns new record instance)
56+
public ChatSegment WithAudioData(byte[] audioData, string audioContentType, float audioLength)
57+
{
58+
return this with
59+
{
60+
AudioData = audioData,
61+
AudioContentType = audioContentType,
62+
AudioLength = audioLength
63+
};
64+
}
65+
}
66+
}

ProjectVG.Application/Models/Chat/UserInputAction.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

ProjectVG.Application/Models/User/UserDto.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ public class UserDto
1616

1717
public UserDto()
1818
{
19+
Id = Guid.NewGuid();
20+
UID = string.Empty;
21+
Username = string.Empty;
22+
Email = string.Empty;
23+
ProviderId = string.Empty;
24+
Provider = string.Empty;
25+
Status = AccountStatus.Active;
26+
CreatedAt = DateTime.UtcNow;
27+
UpdatedAt = DateTime.UtcNow;
1928
}
2029

2130
public UserDto(Domain.Entities.Users.User user)

0 commit comments

Comments
 (0)