Skip to content

Commit e78754e

Browse files
committed
feat: Removed customData from response, added response json to response object
1 parent b0fd19a commit e78754e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1159
-2658
lines changed

Examples/ExampleAssistantV1.cs

Lines changed: 88 additions & 88 deletions
Large diffs are not rendered by default.

Examples/ExampleAssistantV2.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,37 +214,37 @@ private IEnumerator Examples()
214214
Log.Debug("ExampleAssistantV2.Examples()", "Assistant examples complete.");
215215
}
216216

217-
private void OnDeleteSession(DetailedResponse<object> response, IBMError error, System.Collections.Generic.Dictionary<string, object> customData)
217+
private void OnDeleteSession(DetailedResponse<object> response, IBMError error)
218218
{
219219
Log.Debug("ExampleAssistantV2.OnDeleteSession()", "Session deleted.");
220220
deleteSessionTested = true;
221221
}
222222

223-
private void OnMessage0(DetailedResponse<MessageResponse> response, IBMError error, System.Collections.Generic.Dictionary<string, object> customData)
223+
private void OnMessage0(DetailedResponse<MessageResponse> response, IBMError error)
224224
{
225225
Log.Debug("ExampleAssistantV2.OnMessage0()", "response: {0}", response.Result.Output.Generic[0].Text);
226226
messageTested0 = true;
227227
}
228228

229-
private void OnMessage1(DetailedResponse<MessageResponse> response, IBMError error, System.Collections.Generic.Dictionary<string, object> customData)
229+
private void OnMessage1(DetailedResponse<MessageResponse> response, IBMError error)
230230
{
231231
Log.Debug("ExampleAssistantV2.OnMessage1()", "response: {0}", response.Result.Output.Generic[0].Text);
232232

233233
messageTested1 = true;
234234
}
235235

236-
private void OnMessage2(DetailedResponse<MessageResponse> response, IBMError error, System.Collections.Generic.Dictionary<string, object> customData)
236+
private void OnMessage2(DetailedResponse<MessageResponse> response, IBMError error)
237237
{
238238
Log.Debug("ExampleAssistantV2.OnMessage2()", "response: {0}", response.Result.Output.Generic[0].Text);
239239
messageTested2 = true;
240240
}
241241

242-
private void OnMessage3(DetailedResponse<MessageResponse> response, IBMError error, System.Collections.Generic.Dictionary<string, object> customData)
242+
private void OnMessage3(DetailedResponse<MessageResponse> response, IBMError error)
243243
{
244244
Log.Debug("ExampleAssistantV2.OnMessage3()", "response: {0}", response.Result.Output.Generic[0].Text);
245245
messageTested3 = true;
246246
}
247-
private void OnMessage4(DetailedResponse<MessageResponse> response, IBMError error, System.Collections.Generic.Dictionary<string, object> customData)
247+
private void OnMessage4(DetailedResponse<MessageResponse> response, IBMError error)
248248
{
249249
//object tempSkill = null;
250250
//(response.Result.Context.Skills as Dictionary<string, object>).TryGetValue("main skill", out tempSkill);
@@ -267,7 +267,7 @@ private void OnMessage4(DetailedResponse<MessageResponse> response, IBMError err
267267
messageTested4 = true;
268268
}
269269

270-
private void OnCreateSession(DetailedResponse<SessionResponse> response, IBMError error, System.Collections.Generic.Dictionary<string, object> customData)
270+
private void OnCreateSession(DetailedResponse<SessionResponse> response, IBMError error)
271271
{
272272
Log.Debug("ExampleAssistantV2.OnCreateSession()", "Session: {0}", response.Result.SessionId);
273273
sessionId = response.Result.SessionId;

Examples/ExamplePersonalityInsightsV3.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ private IEnumerator Examples()
8383
}
8484

8585

86-
private void OnProfile(DetailedResponse<Profile> response, IBMError error, Dictionary<string, object> customData)
86+
private void OnProfile(DetailedResponse<Profile> response, IBMError error)
8787
{
88-
Log.Debug("ExamplePersonaltyInsightsV3.OnProfile()", "Response: {0}", customData["json"].ToString());
88+
Log.Debug("ExamplePersonaltyInsightsV3.OnProfile()", "Response: {0}", response.Response);
8989
profileTested = true;
9090
}
9191

92-
private void OnProfileAsCsv(DetailedResponse<MemoryStream> response, IBMError error, Dictionary<string, object> customData)
92+
private void OnProfileAsCsv(DetailedResponse<MemoryStream> response, IBMError error)
9393
{
94-
//Log.Debug("ExamplePersonaltyInsightsV3.OnProfile()", "Response: {0}", customData["json"].ToString());
94+
//Log.Debug("ExamplePersonaltyInsightsV3.OnProfile()", "Response: {0}", response.Response);
9595
profileAsCsvTested = true;
9696
}
9797
}

Examples/ExampleToneAnalyzerV3.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,29 +118,29 @@ private IEnumerator Examples()
118118
Log.Debug("ExampleToneAnalyzerV3.Examples()", "Examples complete!");
119119
}
120120

121-
private void OnTone(DetailedResponse<ToneAnalysis> response, IBMError error, Dictionary<string, object> customData)
121+
private void OnTone(DetailedResponse<ToneAnalysis> response, IBMError error)
122122
{
123123
if (error != null)
124124
{
125125
Log.Debug("ExampleToneAnalyzerV3.OnTone()", "Error: {0}: {1}", error.StatusCode, error.ErrorMessage);
126126
}
127127
else
128128
{
129-
Log.Debug("ExampleToneAnalyzerV3.OnTone()", "{0}", customData["json"].ToString());
129+
Log.Debug("ExampleToneAnalyzerV3.OnTone()", "{0}", response.Response);
130130
}
131131

132132
toneTested = true;
133133
}
134134

135-
private void OnToneChat(DetailedResponse<UtteranceAnalyses> response, IBMError error, Dictionary<string, object> customData)
135+
private void OnToneChat(DetailedResponse<UtteranceAnalyses> response, IBMError error)
136136
{
137137
if (error != null)
138138
{
139139
Log.Debug("ExampleToneAnalyzerV3.OnToneChat()", "Error: {0}: {1}", error.StatusCode, error.ErrorMessage);
140140
}
141141
else
142142
{
143-
Log.Debug("ExampleToneAnalyzerV3.OnToneChat()", "{0}", customData["json"].ToString());
143+
Log.Debug("ExampleToneAnalyzerV3.OnToneChat()", "{0}", response.Response);
144144
}
145145

146146
toneChatTested = true;

0 commit comments

Comments
 (0)