Support AgentId for twilio stream

This commit is contained in:
Haiping Chen 2025-02-27 12:52:14 +08:00
parent 32c1876f04
commit 419b4717d6
6 changed files with 14 additions and 7 deletions

View file

@ -85,7 +85,7 @@ public class TwilioStreamController : TwilioController
{
var conv = new Conversation
{
AgentId = _settings.AgentId,
AgentId = request.AgentId ?? _settings.AgentId,
Channel = ConversationChannel.Phone,
ChannelId = request.CallSid,
Title = $"Incoming phone call from {request.From}",

View file

@ -4,6 +4,9 @@ namespace BotSharp.Plugin.Twilio.Models;
public class ConversationalVoiceRequest : VoiceRequest
{
[FromQuery(Name = "agent-id")]
public string AgentId { get; set; }
[FromRoute]
public string ConversationId { get; set; }

View file

@ -1,7 +1,7 @@
{
"id": "8970b1e5-d260-4e2c-90b1-f1415a257c18",
"name": "Pizza Bot",
"description": "AI assistant that can help customer place pizza order.",
"description": "AI assistant that can help customer place pizza order, make payment or inquiry order status.",
"type": "routing",
"inheritAgentId": "01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a",
"createdDateTime": "2023-08-18T10:39:32.2349685Z",
@ -10,10 +10,11 @@
"disabled": false,
"isPublic": true,
"profiles": [ "pizza" ],
"labels": [ "experiment" ],
"routingRules": [
{
"type": "reasoner",
"field": "NaiveReasoner"
"field": "Naive Reasoner"
}
]
}

View file

@ -6,5 +6,6 @@
"id": "b284db86-e9c2-4c25-a59e-4649797dd130",
"disabled": false,
"isPublic": true,
"profiles": [ "pizza" ]
"profiles": [ "pizza" ],
"labels": [ "experiment" ]
}

View file

@ -1,10 +1,11 @@
{
"name": "Ordering",
"description": "Provide types of pizza available, unit price and total cost. Place the order and returned the order number.",
"description": "Provide types of pizza available, unit price, total cost and place the order.",
"createdDateTime": "2023-07-26T02:29:25.123224Z",
"updatedDateTime": "2023-07-26T02:29:25.123274Z",
"id": "c2b57a74-ae4e-4c81-b3ad-9ac5bff982bd",
"disabled": false,
"isPublic": true,
"profiles": [ "pizza" ]
"profiles": [ "pizza" ],
"labels": [ "experiment" ]
}

View file

@ -1,12 +1,13 @@
{
"name": "Payment",
"description": "Make payment when user wants to pay for the order",
"description": "Make payment when user confirmed the price and going to pay for the order",
"createdDateTime": "2023-07-26T02:29:25.123224Z",
"updatedDateTime": "2023-07-26T02:29:25.123274Z",
"id": "fe8c60aa-b114-4ef3-93cb-a8efeac80f75",
"disabled": false,
"isPublic": true,
"profiles": [ "pizza" ],
"labels": [ "experiment" ],
"routingRules": [
{
"field": "order_number",