Giter Site home page Giter Site logo

dialogflow-dotnet-client's People

Contributors

pmiri avatar xvir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dialogflow-dotnet-client's Issues

Dialogflow Fails to Parse "WebhookResponse"

It seems that when returning a WebhookResponse from a .NET Core API to Google DialogFlow for fulfilment that the response is mangled and incorrectly parsed in some way. Below is the simple controller I have servicing the fulfilment request:

// POST api/dialogflow
[HttpPost]
public IActionResult FulfillDialogFlowRequest([FromBody] WebhookRequest request)
{
    var response = new WebhookResponse
    {
        FulfillmentText = "Hello from " + request.QueryResult.Intent.DisplayName
    };
    return Ok(response);
}

This should return the a blank WebhookResponse with the fulfilment text: Hello from <intent name> apon receiving any WebhookRequest. However, DialogFlow receives the following fulfilment response:

image

Whereby, every character is seperated by a space. This does not occur when run locally with the sample webhook request and even copying the text removes the spaces displayed here.

The error message for this suggests a parsing error:

Webhook call failed. Error: Failed to parse webhook JSON response: Expect message object but got: \"笀∀昀甀氀昀椀氀氀洀攀渀琀吀攀砀琀∀㨀∀䠀攀氀氀漀 昀爀漀洀 吀攀猀琀嘀愀氀甀攀猀∀Ⰰ∀昀甀氀昀椀氀氀洀攀渀琀䴀攀猀猀愀最攀猀∀㨀嬀崀Ⰰ∀猀漀甀爀挀攀∀㨀∀∀Ⰰ∀瀀愀礀氀漀愀搀∀㨀渀甀氀氀Ⰰ∀漀甀琀瀀甀琀䌀漀渀琀攀砀琀猀∀㨀嬀崀Ⰰ∀昀漀氀氀漀眀甀瀀䔀瘀攀渀琀䤀渀瀀甀琀∀㨀渀甀氀氀紀\".

I've tried other methods to get this to work including returning the WebhookResponse object as a string or using Newtonsoft JSON to format the object as a JSON. I couldn't find a issue like this on here and couldn't find any samples that demonstrated this use case.

For added context, the API is being hosted on Azure and other controllers function properly when deployed, also below is my .csproj file to show versions of the various Nuget Packages etc.:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <Folder Include="wwwroot\"/>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App"/>
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All"/>
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.4"/>
    <PackageReference Include="Newtonsoft.Json" Version="12.0.1"/>
    <PackageReference Include="Google.Cloud.Dialogflow.V2" Version="1.0.0-beta02"/>
  </ItemGroup>
</Project>

If any other information is required or other snippets from my code please don't hesitate to ask and I will reply as soon as I can!

Security Policy violation Binary Artifacts

This issue was automatically created by Allstar.

Security Policy Violation
Project is out of compliance with Binary Artifacts policy: binaries present in source code

Rule Description
Binary Artifacts are an increased security risk in your repository. Binary artifacts cannot be reviewed, allowing the introduction of possibly obsolete or maliciously subverted executables. For more information see the Security Scorecards Documentation for Binary Artifacts.

Remediation Steps
To remediate, remove the generated executable artifacts from the repository.

Artifacts Found

  • packages/third_party/lib/nunit.framework.dll

Additional Information
This policy is drawn from Security Scorecards, which is a tool that scores a project's adherence to security best practices. You may wish to run a Scorecards scan directly on this repository for more details.


Allstar has been installed on all Google managed GitHub orgs. Policies are gradually being rolled out and enforced by the GOSST and OSPO teams. Learn more at http://go/allstar

This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

Webhook request and response

Hi,

I'd like to ask why there's no model for the webhook request response. I mean the class that map the json with fields "speech", "displayText", "contextsOut" and so on.

Thanks!

.NET Portable Version

I was wondering if there is ever going to be a .NET Portable version as I want to make a DLL containing all my apiai code, then have a class name Actions that contains all actions related to my chatbot,

So in theory a user could import this DLL and make a class inheriting the Actions class and override a specific action so their code runs when apiai returns an action

ApiAiSDK.SupportedLanguage.FromLanguageTag(Language) doens't works

SupportedLanguage supLang = ApiAiSDK.SupportedLanguage.FromLanguageTag(Language);

supLang is always equal to "en" even if Language is "French".

i'm using version 1.6.5 of ApiAiSDK

below "SupportedLanguage" class (from metadata):
/********/
namespace ApiAiSDK
{
public class SupportedLanguage
{
public static readonly SupportedLanguage English;
public static readonly SupportedLanguage Russian;
public static readonly SupportedLanguage German;
public static readonly SupportedLanguage Portuguese;
public static readonly SupportedLanguage PortugueseBrazil;
public static readonly SupportedLanguage Spanish;
public static readonly SupportedLanguage French;
public static readonly SupportedLanguage Italian;
public static readonly SupportedLanguage Dutch;
public static readonly SupportedLanguage Japanese;
public static readonly SupportedLanguage ChineseChina;
public static readonly SupportedLanguage ChineseHongKong;
public static readonly SupportedLanguage ChineseTaiwan;
public readonly string code;

    public static SupportedLanguage FromLanguageTag(string languageTag);
}

}
/********/

How can I fix it?

Many thanks in advance.

Best regards
Andrea

SessionId in query response

Hello,
My name is Bruno Brandes and I love learning about api.ai.
I developed Alice.
Alice is a insurance travel BOT using api.ai, Microsoft Bot Framework and Messaging Hub2.

My Agent in api.ai is configured to use webhook but when receives a call in my endpoint, I cant relate the request with my session because query response dosent contain sessionId passed query request 😦

My alternative for this problem was create a intents and context in api.ai for receiving text with "create session @sys.any:sessionId" and force my application call the api.ai in first user contact then finaly receiving query response with parameter sessionId.

I wonder...
Contains another way to do this?

Cannot create response text variants using the REST API

Hello my friends,

I'm trying to create text variants using the /intents API resource mentioned here: https://dialogflow.com/docs/reference/agent/intents

However, it seems that there is not a way to do such thing. if I send the JSON as:

"responses": [
{
"messages": [
{
"speech": "Okay response variant 01",
"type": 0
},
{
"speech": "Okay response variant 02",
"type": 0
}
],

it creates 2 full response text messages instead of a text variant, do you know what I could be missing on the JSON to create the responses as text variant?

Do you have any idea?

Thanks in advance.

master is broken

@xVir The unit test are currently broken and the Travis Build Server is apparently not running.

ApiAiSDK.AIServiceException : Invalid request content type, expecting "multipart/form-data" or "application/json; charset=utf-8.
  ----> ApiAiSDK.AIServiceException : Invalid request content type, expecting "multipart/form-data" or "application/json; charset=utf-8.
   at ApiAiSDK.AIDataService.VoiceRequest(Stream voiceStream, RequestExtras requestExtras) in C:\Users\movgp\Documents\ApiAi\ApiAiSDK\AIDataService.cs:line 166
   at ApiAiSDK.ApiAi.VoiceRequest(Stream voiceStream, RequestExtras requestExtras) in C:\Users\movgp\Documents\ApiAi\ApiAiSDK\ApiAi.cs:line 75
   at ApiAiSDK.Tests.ApiAiTest.VoiceRequestTest() in C:\Users\movgp\Documents\ApiAi\ApiAiSDK.Tests\ApiAiTest.cs:line 71
--AIServiceException
   at ApiAiSDK.AIDataService.CheckForErrors(AIResponse aiResponse) in C:\Users\movgp\Documents\ApiAi\ApiAiSDK\AIDataService.cs:line 194
   at ApiAiSDK.AIDataService.VoiceRequest(Stream voiceStream, RequestExtras requestExtras) in C:\Users\movgp\Documents\ApiAi\ApiAiSDK\AIDataService.cs:line 159

.NET Core support

I think it should be easy to support .net core since from nuget, the only dependency for this library seems to be Json.Net, which also available in .net core.

Can you please make that happen?

Date recieved different in REST API and SDK

Hi

Dates received from api.ai REST API is different from date received from API.AI DotNet SDK

I have a bot and am passing dates as below

Passed 2 dates as below format
01/12/2017 - result from DotNet SDK is 12-01-2017 while from Console JSOn it is 01-12-2017
15/12/2017 - result from DotNet SDK is 15-12-2017 while from Console JSOn it is 15-12-2017

Visual Studio 2015 Project

Screenshots attached for the watch in dotnet sdk and console JSON for same inputs

api.ai issue.docx

Regards

Send a event request

Hi.

How i can send a Event Request to api.ai?
To, for example, display a welcome message to the user?

Tks!

AIResponse context parsing problem

In a case when developer creates composite entity, we get the next structure of answer's context :
"contexts": [
{
"name": "spec_statistics_out_context",
"parameters": {
"option.original": "best devices",
"option": {
"count_stat": {
"what": "TopDevices",
"what.original": "devices"
},
"count_stat.original": "best devices"
}
},
"lifespan": 1
}
],
The problem is in "parameters field". In SDK in Context class field 'parameter' has type Dictionary<string, string>. But as you can see in example, we can retrieve pair <string, object> as well.
here we get an error from Newtonsoft.JSON lib and can't get response on user request.

Edit1: the error only occured, when Intent with such composit entity also has other contexts (out\in)

Remember Session

I created a chatbot with de API.ai console.
I also created a dotnet project where I implemented api.ai with the SDK.

The bot answers the questions, but it doesn't remember the session.

When the client asks something and the bot response with a question for more information. The client gives the information, but then de bot doesn't know where it is about. But in the console it does work.

Example:
Client: I want to cook diner.
Bot: What ingredients do you want to use?
Client: Beef and brocolli.
Bot: I don't know what you mean.

Can anybody help my? How can I create something like a session?

"ApiAi" nugget not install in xamarin forms.

Hey,
I am trying to install "ApiAiSdk" nugget in my xamarin forms project for .Net Standard 2.0,Android and ios. but i am unable to install it.

Please give me suggestion.

Thanks.
Ankush

Cannot deserialize list items

Hi!

There's a problem when the class AIDataService try to perform a deserialization to an AIResponse, because AIResponse contains a Result, and the Result has a "parameters" field typed of Dictionary<string,object>. So, when the parameter is list, it dictionary should be: Dictionary<string, List>, in order to deserializate the json correctly.

fullfillment/ Webhook

Can you give an example of a fulfilment using the SDK including ability to add headers.

Question: Is this SDK up to date with the current API?

It seems that this SDK is not being changed to be up to date with the current Dialogflow API. For example, how can I trigger a Dialogflow event with this SDK?

Does anyone know if there is a Swagger doc for the current Dialogflow API?

Update an intent either with batch or single operation loses the end of conversation flag

Hi guys,

It seems that after using either the BatchUpdateIntentsAsync or UpdateIntentAsync calls from the client api results in the intent losing the state of whether this intent is the end of the conversation.
Note: The used intent name has not been changed at all.

Is there anyway to read the state of this flag or force an update of this flag?

Thanks

Get SessionId from Dialogflow to sabe on DB in Firebase

Hello
I´m trying to get and save the sessionId from Dialogflow, but all sources and tutorials didn´t get me to a working prototype.
Does anybody ever needed to get the sessionId? Or does anybody have some resources to help me out on this one?
Thanks

QuestionMetadata.SessionId is marked as Internal

According to the /query documentation, sessionId is required and enables us to link messages together into a single session - is there a reason why the SessionId property is marked as internal?

Shouldn't a consumer be able to set this to some conversation specific id to link queries and contexts together?

Remote Name could not be resolved api.api.ai

Hi we are frequently facing the following issue

Remote Name not resolved for api.api.ai
. We are using Microsoft Bot Framework with API.AI . Please find the code below where we are getting the issue

1

throwing bad request Error when passing audio to API

Hi,
i am calling VoiceRequestTest and passing one of audio provided in sample but ti gives me error.
i am developing window form application.

error as below
{
"id": "e5cca5a5-53ba-4c1c-af16-2866096938b5",
"timestamp": "2018-08-08T00:46:08.31Z",
"lang": "en",
"status": {
"code": 400,
"errorType": "bad_request",
"errorDetails": "Invalid request content type, expecting "multipart/form-data" or "application/json; charset\u003dutf-8."
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.