Skip to content

Commit d57da2d

Browse files
authored
Merge pull request #1049 from iceljc/refine/refine-project-dep
Refine/refine project dep
2 parents d7e42b0 + 363c9be commit d57da2d

File tree

56 files changed

+300
-257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+300
-257
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using BotSharp.Abstraction.Functions.Models;
2+
using BotSharp.Abstraction.Instructs.Models;
3+
using BotSharp.Abstraction.Messaging;
4+
using BotSharp.Abstraction.Messaging.Models.RichContent;
5+
using BotSharp.Abstraction.Users.Dtos;
6+
7+
namespace BotSharp.Abstraction.Conversations.Dtos;
8+
9+
public class ChatResponseDto : InstructResult
10+
{
11+
[JsonPropertyName("conversation_id")]
12+
public string ConversationId { get; set; } = string.Empty;
13+
14+
public UserDto Sender { get; set; } = new UserDto();
15+
16+
public string? Function { get; set; }
17+
18+
/// <summary>
19+
/// Planner instruction
20+
/// </summary>
21+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
22+
public FunctionCallFromLlm? Instruction { get; set; }
23+
24+
/// <summary>
25+
/// Rich message for UI rendering
26+
/// </summary>
27+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
28+
[JsonPropertyName("rich_content")]
29+
public RichContent<IRichMessage>? RichContent { get; set; }
30+
31+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
32+
[JsonPropertyName("payload")]
33+
public string? Payload { get; set; }
34+
35+
[JsonPropertyName("has_message_files")]
36+
public bool HasMessageFiles { get; set; }
37+
38+
[JsonPropertyName("created_at")]
39+
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
40+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using BotSharp.Abstraction.Conversations.Enums;
2+
using BotSharp.Abstraction.Users.Dtos;
3+
4+
namespace BotSharp.Abstraction.Conversations.Dtos;
5+
6+
public class ConversationDto
7+
{
8+
public string Id { get; set; }
9+
10+
[JsonPropertyName("agent_id")]
11+
public string AgentId { get; set; }
12+
13+
[JsonPropertyName("agent_name")]
14+
public string AgentName { get; set; }
15+
16+
[JsonPropertyName("title")]
17+
public string Title { get; set; } = string.Empty;
18+
19+
[JsonPropertyName("title_alias")]
20+
public string TitleAlias { get; set; } = string.Empty;
21+
22+
public UserDto User { get; set; } = new UserDto();
23+
24+
public string Channel { get; set; } = ConversationChannel.OpenAPI;
25+
26+
/// <summary>
27+
/// Agent task id
28+
/// </summary>
29+
[JsonPropertyName("task_id")]
30+
public string? TaskId { get; set; }
31+
32+
public string Status { get; set; }
33+
public Dictionary<string, string> States { get; set; } = [];
34+
35+
public List<string> Tags { get; set; } = new();
36+
37+
[JsonPropertyName("updated_time")]
38+
public DateTime UpdatedTime { get; set; } = DateTime.UtcNow;
39+
40+
[JsonPropertyName("created_time")]
41+
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
42+
43+
public static ConversationDto FromSession(Conversation sess)
44+
{
45+
return new ConversationDto
46+
{
47+
Id = sess.Id,
48+
User = new UserDto
49+
{
50+
Id = sess.UserId
51+
},
52+
AgentId = sess.AgentId,
53+
Title = sess.Title,
54+
TitleAlias = sess.TitleAlias,
55+
Channel = sess.Channel,
56+
Status = sess.Status,
57+
TaskId = sess.TaskId,
58+
Tags = sess.Tags ?? [],
59+
States = sess.States ?? [],
60+
CreatedTime = sess.CreatedTime,
61+
UpdatedTime = sess.UpdatedTime
62+
};
63+
}
64+
}

src/Infrastructure/BotSharp.Core.Crontab/Abstraction/ICrontabHook.cs renamed to src/Infrastructure/BotSharp.Abstraction/Crontab/ICrontabHook.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace BotSharp.Core.Crontab.Abstraction;
1+
namespace BotSharp.Abstraction.Crontab;
22

33
public interface ICrontabHook
44
{

src/Infrastructure/BotSharp.Core.Crontab/Abstraction/ICrontabService.cs renamed to src/Infrastructure/BotSharp.Abstraction/Crontab/ICrontabService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace BotSharp.Core.Crontab.Abstraction;
1+
namespace BotSharp.Abstraction.Crontab;
22

33
public interface ICrontabService
44
{

src/Infrastructure/BotSharp.Core.Crontab/Abstraction/ICrontabSource.cs renamed to src/Infrastructure/BotSharp.Abstraction/Crontab/ICrontabSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace BotSharp.Core.Crontab.Abstraction;
1+
namespace BotSharp.Abstraction.Crontab;
22

33
/// <summary>
44
/// Provide a cron source for the crontab service.

src/Infrastructure/BotSharp.Core.Realtime/Models/Options/ChatSessionOptions.cs renamed to src/Infrastructure/BotSharp.Abstraction/Realtime/Models/Session/ChatSessionOptions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace BotSharp.Core.Realtime.Models.Options;
1+
using System.Text.Json;
2+
3+
namespace BotSharp.Abstraction.Realtime.Models.Session;
24

35
public class ChatSessionOptions
46
{

src/Infrastructure/BotSharp.Core.Realtime/Models/Chat/ChatSessionUpdate.cs renamed to src/Infrastructure/BotSharp.Abstraction/Realtime/Models/Session/ChatSessionUpdate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace BotSharp.Core.Realtime.Models.Chat;
1+
namespace BotSharp.Abstraction.Realtime.Models.Session;
22

33
public class ChatSessionUpdate
44
{
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
namespace BotSharp.Abstraction.Rules;
2+
3+
public interface IRuleAction
4+
{
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
namespace BotSharp.Abstraction.Rules;
2+
3+
public interface IRuleConfig
4+
{
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
namespace BotSharp.Abstraction.Rules;
2+
3+
public interface IRuleCriteria
4+
{
5+
}

0 commit comments

Comments
 (0)