Skip to content

Commit e43b3e6

Browse files
author
Yanan Wang
committed
Add RichContent field and PostBackUrl for QuickReplies
1 parent eb4e0b0 commit e43b3e6

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/Infrastructure/BotSharp.Abstraction/Messaging/Models/RichContent/QuickReplyElement.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ public class QuickReplyElement
99
public string? Payload { get; set; }
1010
[JsonPropertyName("image_url")]
1111
public string? ImageUrl { get; set; }
12+
public string? PostBackUrl { get; set; }
1213
}
1314
}

src/Infrastructure/BotSharp.OpenAPI/Controllers/ConversationController.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class ConversationController : ControllerBase, IApiAdapter
1212
private readonly IServiceProvider _services;
1313
private readonly IUserIdentity _user;
1414

15-
public ConversationController(IServiceProvider services,
15+
public ConversationController(IServiceProvider services,
1616
IUserIdentity user)
1717
{
1818
_services = services;
@@ -40,8 +40,8 @@ public async Task DeleteConversation([FromRoute] string agentId, [FromRoute] str
4040
}
4141

4242
[HttpPost("/conversation/{agentId}/{conversationId}")]
43-
public async Task<MessageResponseModel> SendMessage([FromRoute] string agentId,
44-
[FromRoute] string conversationId,
43+
public async Task<MessageResponseModel> SendMessage([FromRoute] string agentId,
44+
[FromRoute] string conversationId,
4545
[FromBody] NewMessageModel input)
4646
{
4747
var conv = _services.GetRequiredService<IConversationService>();
@@ -73,6 +73,7 @@ await conv.SendMessage(agentId, inputMsg,
7373
response.Data = inputMsg.Data;
7474
response.Function = inputMsg.FunctionName;
7575
response.Instruction = inputMsg.Instruction;
76+
response.RichContent = inputMsg.RichContent;
7677

7778
return response;
7879
}

src/Infrastructure/BotSharp.OpenAPI/ViewModels/Conversations/MessageResponseModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using BotSharp.Abstraction.Functions.Models;
22
using BotSharp.Abstraction.Models;
3-
using BotSharp.Abstraction.Routing.Models;
43

54
namespace BotSharp.OpenAPI.ViewModels.Conversations;
65

@@ -11,4 +10,5 @@ public class MessageResponseModel : ITrackableMessage
1110
public string Function { get; set; }
1211
public object Data { get; set; }
1312
public FunctionCallFromLlm Instruction { get; set; }
13+
public object? RichContent { get; set; }
1414
}

0 commit comments

Comments
 (0)