Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable to update context data at server side ExtractIntent #85

Merged
merged 1 commit into from
Nov 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ChatdollKit/Scripts/Dialog/HttpDialogRouter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public override async Task ExtractIntentAsync(Request request, Context context,
request.Words = httpIntentResponse.Request.Words ?? request.Words;
request.Entities = httpIntentResponse.Request.Entities ?? request.Entities;
request.IsAdhoc = httpIntentResponse.Request.IsAdhoc;

// Update context data
context.Data = httpIntentResponse.Context.Data;
}

public override IDialogProcessor Route(Request request, Context context, CancellationToken token)
Expand All @@ -45,7 +48,7 @@ public override IDialogProcessor Route(Request request, Context context, Cancell
}

// Request message
public class HttpIntentRequest
private class HttpIntentRequest
{
public Request Request { get; set; }
public Context Context { get; set; }
Expand All @@ -58,7 +61,7 @@ public HttpIntentRequest(Request request, Context context)
}

// Response message
public class HttpIntentResponse
private class HttpIntentResponse
{
public Request Request { get; set; }
public Context Context { get; set; }
Expand All @@ -67,7 +70,7 @@ public class HttpIntentResponse
}

// Error info in response
public class HttpIntentError
private class HttpIntentError
{
public string Code { get; set; }
public string Message { get; set; }
Expand Down