Skip to content

Commit 8bcdc79

Browse files
authored
Merge pull request #109 from watson-developer-cloud/develop
Unity SDK v0.6.0
2 parents 57016a1 + 79eedde commit 8bcdc79

File tree

74 files changed

+21799
-1440
lines changed

Some content is hidden

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

74 files changed

+21799
-1440
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ LICENSE.meta
5050
CHANGELOG.md.meta
5151
README.md.meta
5252
Travis.meta
53+
exclude-filter.txt
54+
exclude-filter.txt.meta
5355
/Travis/UnityTestProject/Assets/StreamingAssets/Config.json
5456
/Travis/UnityTestProject/Assets/StreamingAssets/Config.json.meta
5557
/Travis/UnityTestProject/Assets/StreamingAssets/Config.json.enc.meta
@@ -62,4 +64,4 @@ Travis.meta
6264
/Travis/installUnity.sh.meta
6365
/Travis/README.md.meta
6466
/Travis/runTests.sh.meta
65-
/Travis/TravisBuild.cs.meta
67+
/Travis/TravisBuild.cs.meta

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
Change Log
22
==========
3+
## Version 0.6.0
4+
5+
_2016-07-15_
6+
7+
* New: Added `Document Conversion` abstraction
8+
* New: Added `AlchemyData News` abstraction
9+
* New: Added `Retrieve and Rank` abstraction
10+
* New: Added `Conversation` abstraction
11+
* Fix: Added `LanguageTranslation` and `LanguageTranslator`
12+
313
## Version 0.5.0
414

515
_2016-06-24_

Config.json.enc

1.25 KB
Binary file not shown.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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 System.Collections.Generic;
21+
using IBM.Watson.DeveloperCloud.Services.AlchemyAPI.v1;
22+
using IBM.Watson.DeveloperCloud.Logging;
23+
using System;
24+
25+
public class ExampleAlchemyDataNews : MonoBehaviour {
26+
private AlchemyAPI m_AlchemyAPI = new AlchemyAPI();
27+
28+
void Start () {
29+
LogSystem.InstallDefaultReactors();
30+
31+
string[] returnFields = {Fields.ENRICHED_URL_ENTITIES, Fields.ENRICHED_URL_KEYWORDS};
32+
Dictionary<string, string> queryFields = new Dictionary<string, string>();
33+
queryFields.Add(Fields.ENRICHED_URL_RELATIONS_RELATION_SUBJECT_TEXT, "Obama");
34+
queryFields.Add(Fields.ENRICHED_URL_CLEANEDTITLE, "Washington");
35+
36+
if (!m_AlchemyAPI.GetNews(OnGetNews, returnFields, queryFields))
37+
Log.Debug("ExampleAlchemyData", "Failed to get news!");
38+
}
39+
40+
private void OnGetNews(NewsResponse newsData, string data)
41+
{
42+
if(newsData != null)
43+
Log.Debug("ExampleAlchemyData", "status: {0}", newsData.status);
44+
}
45+
}

Examples/ServiceExamples/Scripts/ExampleAlchemyDataNews.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/ServiceExamples/Scripts/ExampleAlchemyLanguage.cs

100644100755
Lines changed: 229 additions & 227 deletions
Large diffs are not rendered by default.

Examples/ServiceExamples/Scripts/ExampleConversation.cs

100644100755
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,28 @@
1818
using UnityEngine;
1919
using System.Collections;
2020
using IBM.Watson.DeveloperCloud.Services.Conversation.v1;
21+
using IBM.Watson.DeveloperCloud.Utilities;
22+
using IBM.Watson.DeveloperCloud.Logging;
2123

2224
public class ExampleConversation : MonoBehaviour
2325
{
2426
private Conversation m_Conversation = new Conversation();
25-
private string m_WorkspaceID = "25dfa8a0-0263-471b-8980-317e68c30488";
27+
private string m_WorkspaceID;
2628
private string m_Input = "Can you unlock the door?";
2729

2830
void Start () {
29-
Debug.Log("User: " + m_Input);
30-
m_Conversation.Message(m_WorkspaceID, m_Input, OnMessage);
31+
LogSystem.InstallDefaultReactors();
32+
m_WorkspaceID = Config.Instance.GetVariableValue("ConversationV1_WorkspaceID");
33+
Debug.Log("User: " + m_Input);
34+
35+
m_Conversation.Message(m_WorkspaceID, m_Input, OnMessage);
3136
}
3237

33-
void OnMessage (DataModels.MessageResponse resp)
38+
void OnMessage (MessageResponse resp)
3439
{
3540
if(resp != null)
3641
{
37-
foreach(DataModels.MessageIntent mi in resp.intents)
42+
foreach(MessageIntent mi in resp.intents)
3843
Debug.Log("intent: " + mi.intent + ", confidence: " + mi.confidence);
3944

4045
if(resp.output != null && !string.IsNullOrEmpty(resp.output.text))
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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.ConversationExperimental.v1;
21+
using IBM.Watson.DeveloperCloud.Logging;
22+
using IBM.Watson.DeveloperCloud.Utilities;
23+
24+
public class ExampleConversationExperimental : MonoBehaviour
25+
{
26+
private ConversationExperimental m_Conversation = new ConversationExperimental();
27+
private string m_WorkspaceID;
28+
private string m_Input = "Can you unlock the door?";
29+
30+
void Start () {
31+
LogSystem.InstallDefaultReactors();
32+
m_WorkspaceID = Config.Instance.GetVariableValue("ConversationExperimentalV1_ID");
33+
Debug.Log("User: " + m_Input);
34+
35+
m_Conversation.Message(m_WorkspaceID, m_Input, OnMessage);
36+
}
37+
38+
void OnMessage (MessageResponse resp)
39+
{
40+
if(resp != null)
41+
{
42+
foreach(MessageIntent mi in resp.intents)
43+
Debug.Log("intent: " + mi.intent + ", confidence: " + mi.confidence);
44+
45+
if(resp.output != null && !string.IsNullOrEmpty(resp.output.text))
46+
Debug.Log("response: " + resp.output.text);
47+
}
48+
else
49+
{
50+
Debug.Log("Failed to invoke Message();");
51+
}
52+
}
53+
}

Examples/ServiceExamples/Scripts/ExampleConversationExperimental.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/ServiceExamples/Scripts/ExampleDIalog.cs

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using UnityEngine;
1919
using IBM.Watson.DeveloperCloud.Services.Dialog.v1;
2020

21-
public class ExampleDIalog : MonoBehaviour
21+
public class ExampleDialog : MonoBehaviour
2222
{
2323
private Dialog m_Dialog = new Dialog();
2424
private string m_DialogID = "a4015960-39c2-4d6b-9571-38c74aecfffd";

0 commit comments

Comments
 (0)