Skip to content

Commit a9c3e57

Browse files
committed
Fixes #88 fixes #87 revisions to Conversation service status, update credentials and endpoints for conversation and toneanalyzer
1 parent 7797a88 commit a9c3e57

File tree

3 files changed

+54
-6
lines changed

3 files changed

+54
-6
lines changed

Examples/ServiceExamples/Scripts/ExampleConversation.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
public class ExampleConversation : MonoBehaviour
2323
{
2424
private Conversation m_Conversation = new Conversation();
25-
private string m_WorkspaceID = "car_demo_1";
25+
private string m_WorkspaceID = "25dfa8a0-0263-471b-8980-317e68c30488";
2626
private string m_Input = "Can you unlock the door?";
2727

2828
void Start () {
@@ -32,9 +32,17 @@ void Start () {
3232

3333
void OnMessage (DataModels.MessageResponse resp)
3434
{
35-
foreach(DataModels.MessageIntent mi in resp.intents)
36-
Debug.Log("intent: " + mi.intent + ", confidence: " + mi.confidence);
37-
38-
Debug.Log("response: " + resp.output.text);
35+
if(resp != null)
36+
{
37+
foreach(DataModels.MessageIntent mi in resp.intents)
38+
Debug.Log("intent: " + mi.intent + ", confidence: " + mi.confidence);
39+
40+
if(resp.output != null && !string.IsNullOrEmpty(resp.output.text))
41+
Debug.Log("response: " + resp.output.text);
42+
}
43+
else
44+
{
45+
Debug.Log("Failed to invoke Message();");
46+
}
3947
}
4048
}

Examples/ServiceExamples/ServiceExamples.unity

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,45 @@ Transform:
249249
m_Children: []
250250
m_Father: {fileID: 0}
251251
m_RootOrder: 6
252+
--- !u!1 &748186939
253+
GameObject:
254+
m_ObjectHideFlags: 0
255+
m_PrefabParentObject: {fileID: 0}
256+
m_PrefabInternal: {fileID: 0}
257+
serializedVersion: 4
258+
m_Component:
259+
- 4: {fileID: 748186941}
260+
- 114: {fileID: 748186940}
261+
m_Layer: 0
262+
m_Name: ExampleAlchemyLanguage
263+
m_TagString: Untagged
264+
m_Icon: {fileID: 0}
265+
m_NavMeshLayer: 0
266+
m_StaticEditorFlags: 0
267+
m_IsActive: 1
268+
--- !u!114 &748186940
269+
MonoBehaviour:
270+
m_ObjectHideFlags: 0
271+
m_PrefabParentObject: {fileID: 0}
272+
m_PrefabInternal: {fileID: 0}
273+
m_GameObject: {fileID: 748186939}
274+
m_Enabled: 1
275+
m_EditorHideFlags: 0
276+
m_Script: {fileID: 11500000, guid: 9d5294a7b05214c5690d02420b87a821, type: 3}
277+
m_Name:
278+
m_EditorClassIdentifier:
279+
--- !u!4 &748186941
280+
Transform:
281+
m_ObjectHideFlags: 0
282+
m_PrefabParentObject: {fileID: 0}
283+
m_PrefabInternal: {fileID: 0}
284+
m_GameObject: {fileID: 748186939}
285+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
286+
m_LocalPosition: {x: 299.5, y: 291.5, z: 0}
287+
m_LocalScale: {x: 1, y: 1, z: 1}
288+
m_Children: []
289+
m_Father: {fileID: 0}
290+
m_RootOrder: 11
252291
--- !u!1 &859102722
253292
GameObject:
254293
m_ObjectHideFlags: 0
@@ -538,7 +577,7 @@ GameObject:
538577
m_Icon: {fileID: 0}
539578
m_NavMeshLayer: 0
540579
m_StaticEditorFlags: 0
541-
m_IsActive: 1
580+
m_IsActive: 0
542581
--- !u!114 &2004886372
543582
MonoBehaviour:
544583
m_ObjectHideFlags: 0

Scripts/Services/Conversation/Conversation.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public bool Message(string workspaceId, string input, OnMessage callback)
141141
MessageReq req = new MessageReq();
142142
req.Callback = callback;
143143
req.Headers["Content-Type"] = "application/json";
144+
req.Headers["Accept"] = "application/json";
144145
req.Parameters["version"] = DataModels.CONVERSATION_VERSION;
145146
req.Function = "/" + workspaceId + "/message";
146147
req.Send = Encoding.UTF8.GetBytes(reqString);

0 commit comments

Comments
 (0)