Skip to content

Commit

Permalink
Merge pull request #85 from uezo/develop
Browse files Browse the repository at this point in the history
Enable to update context data at server side ExtractIntent
  • Loading branch information
uezo authored Nov 7, 2020
2 parents 9fdeb13 + 3f0223e commit 1c76502
Showing 1 changed file with 6 additions and 3 deletions.
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

0 comments on commit 1c76502

Please sign in to comment.