froesmatheus / wit.net

C# library for Wit.ai https://wit.ai
MIT License
8 stars 6 forks source link

Entity resolver #2

Closed gianvi closed 7 years ago

gianvi commented 7 years ago

Hi, do you have an example to use your client as entity resolver?

I tryied in this way in my c# bot app:

    public async Task StartAsync(IDialogContext context)
    {

        WitAi.Wit wit = new WitAi.Wit(accessToken: "MZZDDALMPKUDQX7TEGSUSHJPUU5I5W4F");
        var r3 = wit.Message("il 22 giugno alle 13");

        foreach (var e in r3.Entities)
        {
            var k = e.Key;
            var v = e.Value;

            await context.PostAsync("WITAI ENTITY KEY: " + k);

            foreach (var val in v)
            {
                await context.PostAsync("WITAI ENTITY TYPE: " + val.Type);
            }
        }
    }
froesmatheus commented 7 years ago

Hi, which version of the library are you using? @gianvi

gianvi commented 7 years ago

@froesmatheus I'm using wit.ai.net 0.1.1.0 (from nuget)

gianvi commented 7 years ago

Mmmh, it's strange: actually the Client is working but when I retrieve a Datetime Entity with TO: ... and FROM ... it seems doesnt valorize tha values You can see this kind of entity on https://duckling.wit.ai (IT language) with the query: "prenota sala per il 22 giugno nel pomeriggio"

froesmatheus commented 7 years ago

@gianvi You're using a different library. I think you're using this one: https://www.nuget.org/packages/Wit.ai.net/

froesmatheus commented 7 years ago

No I mean, you said you're using the wit.ai.net 0.1.1.0 but this is not my library. Mine is Wit.NET, I think you should open this issue on https://github.com/valencianok/Wit.ai.net haha

gianvi commented 7 years ago

Super Lol!! Really sorry...now I will try yours XD

gianvi commented 7 years ago

Ok, it works! Your code it's a bit more difficult to understand for me, but I will start to study it ;) The problem is that you have a kind of dynamic list with all the sub-entities. I leave the code above, maybe you can use it as example for Message api :) (or feel free to remove the conv) Btw really appreciate it!

froesmatheus commented 7 years ago

Oh, thanks :) I'll try to make the code simpler too. If you have any questions or feedback please feel free to open other issues