Skip to content

Commit 3f7cd7d

Browse files
committed
replaced conversation from merge, encrypt config
1 parent 329349a commit 3f7cd7d

File tree

5 files changed

+519
-0
lines changed

5 files changed

+519
-0
lines changed

Config.json.enc

0 Bytes
Binary file not shown.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Copyright 2015 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
using UnityEngine;
19+
using System.Collections;
20+
using IBM.Watson.DeveloperCloud.Services.Conversation.v1;
21+
22+
public class ExampleConversation : MonoBehaviour
23+
{
24+
private Conversation m_Conversation = new Conversation();
25+
private string m_WorkspaceID = "car_demo_1";
26+
private string m_Input = "Can you unlock the door?";
27+
28+
void Start () {
29+
Debug.Log("User: " + m_Input);
30+
m_Conversation.Message(m_WorkspaceID, m_Input, OnMessage);
31+
}
32+
33+
void OnMessage (DataModels.MessageResponse resp)
34+
{
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);
39+
}
40+
}

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Use this SDK to build Watson-powered applications in Unity. It comes with a set
1616
* [Natural Language Classifier](#natural-language-classifier)
1717
* [Tone Analyzer](#tone-analyzer)
1818
* [Tradeoff Analytics](#tradeoff-analytics)
19+
* [Conversation](#conversation)
1920
* [Visual Recognition](#visual-recognition)
2021
* [Developing a basic application in one minute](#developing-a-basic-application-in-one-minute)
2122
* [Documentation](#documentation)
@@ -327,6 +328,29 @@ void Start () {
327328
}
328329
```
329330

331+
### Conversation
332+
<!-- conversation description here: Change link below -->
333+
334+
```cs
335+
private Conversation m_Conversation = new Conversation();
336+
private string m_WorkspaceID = "car_demo_1";
337+
private string m_Input = "Can you unlock the door?";
338+
339+
void Start () {
340+
Debug.Log("User: " + m_Input);
341+
m_Conversation.Message(m_WorkspaceID, m_Input, OnMessage);
342+
}
343+
344+
void OnMessage (DataModels.MessageResponse resp)
345+
{
346+
foreach(DataModels.MessageIntent mi in resp.intents)
347+
Debug.Log("intent: " + mi.intent + ", confidence: " + mi.confidence);
348+
349+
Debug.Log("response: " + resp.output.text);
350+
}
351+
```
352+
353+
330354
### Visual Recognition
331355
Use the [Visual Recognition][visual_recognition] service to classify an image against a default or custom trained classifier. In addition, the service can detect faces and text in an image.
332356

0 commit comments

Comments
 (0)