Google.Cloud.Dialogflow.V2 WebHook response card
See original GitHub issueHello,
I’m using the Nuget package (.NET): Google.Cloud.Dialogflow.V2 (1.0.0-beta01) This code is a simple example of what I’m trying to do:
[System.Web.Mvc.HttpPost]
public WebhookResponse Webhook(WebhookRequest request)
{
var message = new Intent.Types.Message
{
Card = new Intent.Types.Message.Types.Card
{
Title = "Oh Yeah !",
ImageUri = "https://www.google.be/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
}
};
return new WebhookResponse
{
FulfillmentMessages = new Google.Protobuf.Collections.RepeatedField<Intent.Types.Message>
{
message
},
FulfillmentText = request.QueryResult.FulfillmentText,
Source = ""
};
}
But this code is not working as FulfillmentMessages is read-only. Only get is available from WebhookResponse:
//
// Summary:
// Optional. The collection of rich messages to present to the user. This value
// is passed directly to `QueryResult.fulfillment_messages`.
[DebuggerNonUserCode]
public RepeatedField<Intent.Types.Message> FulfillmentMessages { get; }
So my question is: How can I send something else that just text from my WebHook ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10
Top Results From Across the Web
Webhook service | Dialogflow ES
Once your webhook receives a webhook request, it needs to send a webhook response. The body of this response is a JSON object...
Read more >Webhooks | Dialogflow CX
With standard webhooks, you use Dialogflow-defined request and response messages. The request message provides many details about the session. For example, ...
Read more >Dialogflow webhook format
This section describes the format of the JSON payload when Actions on Google invokes your fulfillment through Dialogflow v2.
Read more >Sending back Text & Card in WebhookResponse ...
I am trying to use the API to send back a webhook response message ... NET Core 2.2; Package name and version: Google.Cloud.Dialogflow.V2...
Read more >How to send FulfillmentMessages as part of Dialogflow v2 ...
Error : Failed to parse webhook JSON response: Cannot find field: Message in message google.cloud.dialogflow.v2.Intent.Message.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, I see. Sorry for misreading the question before. It’s a read-only property, but you just add values to it. All you need to do is get rid of the “new …” part and you can use the collection initializer:
Note that
RepeatedField<T>
has an overload acceptingIEnumerable<T>
as well, so it’s easy to populate with a LINQ query.@jskeet thank you so much for your fast respond !!!