Skip to content

Commit 8bf61cb

Browse files
committed
Merge branch 'master' into v0.18-llm-planning
2 parents c7ff0e4 + 2146f6e commit 8bf61cb

File tree

17 files changed

+134
-8
lines changed

17 files changed

+134
-8
lines changed

src/Infrastructure/BotSharp.Abstraction/BotSharp.Abstraction.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,4 @@
3131
<PackageReference Include="System.Text.Json" Version="7.0.3" />
3232
</ItemGroup>
3333

34-
<ItemGroup>
35-
<Folder Include="Messaging\Models\" />
36-
</ItemGroup>
37-
3834
</Project>

src/Infrastructure/BotSharp.Abstraction/Conversations/IConversationStateService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace BotSharp.Abstraction.Conversations;
55
/// </summary>
66
public interface IConversationStateService
77
{
8+
string GetConversationId();
89
ConversationState Load(string conversationId);
910
string GetState(string name, string defaultValue = "");
1011
bool ContainsState(string name);

src/Infrastructure/BotSharp.Abstraction/Conversations/Models/RoleDialogModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public class RoleDialogModel : ITrackableMessage
3232
/// </summary>
3333
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
3434
public object Data { get; set; }
35+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
36+
public object? RichContent { get; set; }
3537

3638
/// <summary>
3739
/// Stop conversation completion
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
namespace BotSharp.Abstraction.Messaging.Models.RichContent
3+
{
4+
public class QuickReplyElement
5+
{
6+
[JsonPropertyName("content_type")]
7+
public string ContentType { get; set; } = string.Empty;
8+
public string Title { get; set; } = string.Empty;
9+
public string? Payload { get; set; }
10+
[JsonPropertyName("image_url")]
11+
public string? ImageUrl { get; set; }
12+
[JsonPropertyName("postback_url")]
13+
public string? PostBackUrl { get; set; }
14+
}
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
namespace BotSharp.Abstraction.Messaging.Models.RichContent
3+
{
4+
public class QuickReplyMessage : TextMessage
5+
{
6+
[JsonPropertyName("quick_replies")]
7+
public List<QuickReplyElement> QuickReplies { get; set; } = new List<QuickReplyElement>();
8+
}
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
namespace BotSharp.Abstraction.Messaging.Models.RichContent
3+
{
4+
public class Recipient
5+
{
6+
public string Id { get; set; } = string.Empty;
7+
}
8+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace BotSharp.Abstraction.Messaging.Models.RichContent
2+
{
3+
public class RichContent<T>
4+
{
5+
public Recipient Recipient { get; set; } = new Recipient();
6+
/// <summary>
7+
/// RESPONSE
8+
/// </summary>
9+
[JsonPropertyName("messaging_type")]
10+
public string MessagingType => "RESPONSE";
11+
public T Message { get; set; }
12+
}
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
namespace BotSharp.Abstraction.Messaging.Models.RichContent
3+
{
4+
public class SenderActionMessage
5+
{
6+
/*
7+
* Requests to display sender action should only include the sender_action parameter and the recipient object.
8+
* All other Send API properties, such as text and templates, should be sent in a separate request.
9+
*/
10+
public Recipient Recipient { get; set; } = new Recipient();
11+
12+
[JsonPropertyName("sender_action")]
13+
public string SenderAction { get; set; } = string.Empty;
14+
}
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
namespace BotSharp.Abstraction.Messaging.Models.RichContent.Template
3+
{
4+
public class AttachmentTemplate<T>
5+
{
6+
public string Type => "template";
7+
public T Payload { get; set; }
8+
}
9+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
namespace BotSharp.Abstraction.Messaging.Models.RichContent.Template
3+
{
4+
public class ButtonTemplate : TextMessage
5+
{
6+
[JsonPropertyName("template_type")]
7+
public string TemplateType => "button";
8+
public List<ButtonElement> Buttons { get; set; } = new List<ButtonElement>();
9+
}
10+
11+
public class ButtonElement
12+
{
13+
public string Type { get; set; } = string.Empty;
14+
public string? Url { get; set; }
15+
public string Title { get; set; } = string.Empty;
16+
}
17+
}

0 commit comments

Comments
 (0)