A .Net client for Wit.ai HTTP API
C#
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Wit.ai.net.Tests
Wit.ai.net
.gitattributes
.gitignore
LICENSE.txt
README.md
Wit.ai.net.sln

README.md

Wit.ai.net

A .Net client for Wit.ai HTTP API

Features

  • Supports .NET 4.5+
  • Easy installation using NuGet

Code Samples

Simple Message example

WitClient client = new WitClient("YOUR_WIT_TOKEN");
Message message = client.GetMessage("hello");

Conversation example

public void example()
{
    var client = new WitConversation<DemoContext>(witToken, conversationId, null,
        doMerge, doSay, doAction, doStop);
    Task<bool> t = client.SendMessageAsync("hello");
    t.Wait();

    Assert.IsTrue(t.Result && didMerge && didStop);
}

public DemoContext doMerge(string conversationId, DemoContext context, Dictionary<string, List<Entity>> entities, double confidence)
{
    didMerge = true;
    return context;
}

public void doSay(string conversationId, DemoContext context, string msg, double confidence)
{
    Console.WriteLine(msg);
}

public DemoContext doAction(string conversationId, DemoContext context, string action, Dictionary<string, List<Entity>> entities, double confidence)
{
    return context;
}

public DemoContext doStop(string conversationId, DemoContext context)
{
    didStop = true;
    return context;
}

public class DemoContext
{
    public string someField { get; set; }
}