Skip to content

Commit d9089c6

Browse files
authored
Merge pull request #134 from watson-developer-cloud/rc-1.2.0
RC 1.2.0
2 parents 2eb7afa + 432b1ba commit d9089c6

File tree

57 files changed

+369
-269
lines changed

Some content is hidden

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

57 files changed

+369
-269
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
Change Log
22
==========
3+
## Version 1.2.0
4+
_2017-07-18_
5+
* Fix: Update input and context in MessageRequest and MessageResponse for `Conversation` to be dynamic.
6+
* Fix: Changes in error handling to check if return error is a string or json object.
7+
* New: Conversation example showing messaging with conversation context.
8+
39
## Version 1.1.0
410
_2017-06-30_
511
* Fix: Include support for Xamarin Android, Xamarin iOS and .NET Core App (4.6>).

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Watson Developer Cloud .NET Standard SDK"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 1.1.0
41+
PROJECT_NUMBER = 1.2.0
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

appveyor.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.1.{build}
1+
version: 1.2.{build}
22
branches:
33
except:
44
- gh-pages
@@ -13,12 +13,16 @@ environment:
1313
CRED_SECRET:
1414
secure: eEcA/09B7XzeTSb3GlaeqcWfQ/TemXxAq9/0AFM5+z8=
1515
VCAP_SERVICES: C:\projects\dotnet-standard-sdk\config
16+
init:
17+
- ps: '[System.IO.File]::AppendAllText("C:\Windows\System32\drivers\etc\hosts", "`n93.184.221.200 api.nuget.org")'
1618
install:
1719
- cmd: >-
1820
rm -rf packages
1921
2022
mkdir packages
2123
24+
nuget restore
25+
2226
nuget install -Verbosity quiet -OutputDirectory packages -Version 4.6.519 OpenCover
2327
2428
nuget install -Verbosity quiet -OutputDirectory packages -Version 2.4.5.0 ReportGenerator
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**
2+
* Copyright 2017 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 IBM.WatsonDeveloperCloud.Conversation.v1.Model;
19+
using Newtonsoft.Json;
20+
using System;
21+
22+
namespace IBM.WatsonDeveloperCloud.Conversation.v1.Example
23+
{
24+
public class ConversationContextExample
25+
{
26+
private ConversationService _conversation;
27+
private string _workspaceID;
28+
private string[] _questionArray = { "hello", "can you turn up the AC", "can you turn on the wipers", "can you turn off the wipers", "can you turn down the ac", "can you unlock the door" };
29+
private int _questionIndex = 0;
30+
private dynamic _questionContext = null;
31+
32+
public ConversationContextExample(string username, string password, string workspaceId)
33+
{
34+
_conversation = new ConversationService(username, password, ConversationService.CONVERSATION_VERSION_DATE_2017_05_26);
35+
_workspaceID = workspaceId;
36+
37+
CallConversation(_questionIndex);
38+
}
39+
40+
public void CallConversation(int questionIndex)
41+
{
42+
MessageRequest messageRequest = new MessageRequest()
43+
{
44+
Input = new InputData()
45+
{
46+
Text = _questionArray[questionIndex]
47+
}
48+
};
49+
50+
if(_questionContext != null)
51+
{
52+
messageRequest.Context = _questionContext;
53+
}
54+
55+
var result = _conversation.Message(_workspaceID, messageRequest);
56+
Console.WriteLine(string.Format("result: {0}", JsonConvert.SerializeObject(result, Formatting.Indented)));
57+
_questionIndex++;
58+
_questionContext = result.Context;
59+
60+
if (questionIndex < _questionArray.Length - 1)
61+
CallConversation(_questionIndex);
62+
}
63+
}
64+
}
65+

examples/IBM.WatsonDeveloperCloud.Conversation.v1.Example/Example.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public static void Main(string[] args)
3232
var _password = vcapServices["conversation"][0]["credentials"]["password"];
3333
var _workspaceID = vcapServices["conversation"][0]["credentials"]["workspaceId"];
3434

35-
ConversationServiceExample _conversationExample = new ConversationServiceExample(_username.ToString(), _password.ToString(), _workspaceID.ToString());
35+
//ConversationServiceExample _conversationExample = new ConversationServiceExample(_username.ToString(), _password.ToString(), _workspaceID.ToString());
36+
ConversationContextExample _converationContextExample = new ConversationContextExample(_username.ToString(), _password.ToString(), _workspaceID.ToString());
3637
Console.ReadKey();
3738
}
3839
}

examples/IBM.WatsonDeveloperCloud.Conversation.v1.Example/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"version": "1.1.0",
2+
"version": "1.2.0",
33
"buildOptions": {
44
"emitEntryPoint": true
55
},
66

77
"dependencies": {
8-
"IBM.WatsonDeveloperCloud": "1.1.0",
9-
"IBM.WatsonDeveloperCloud.Conversation.v1": "1.1.0",
8+
"IBM.WatsonDeveloperCloud": "1.2.0",
9+
"IBM.WatsonDeveloperCloud.Conversation.v1": "1.2.0",
1010
"Microsoft.NETCore.App": {
1111
"type": "platform",
1212
"version": "1.0.1"

examples/IBM.WatsonDeveloperCloud.Discovery.v1.Example/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.1.0",
2+
"version": "1.2.0",
33
"buildOptions": {
44
"emitEntryPoint": true,
55
"copyToOutput": {
@@ -8,8 +8,8 @@
88
},
99

1010
"dependencies": {
11-
"IBM.WatsonDeveloperCloud": "1.1.0",
12-
"IBM.WatsonDeveloperCloud.Discovery.v1": "1.1.0",
11+
"IBM.WatsonDeveloperCloud": "1.2.0",
12+
"IBM.WatsonDeveloperCloud.Discovery.v1": "1.2.0",
1313
"Microsoft.NETCore.App": {
1414
"type": "platform",
1515
"version": "1.0.1"

examples/IBM.WatsonDeveloperCloud.LanguageTranslator.v2.Example/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"version": "1.1.0",
2+
"version": "1.2.0",
33
"dependencies": {
4-
"IBM.WatsonDeveloperCloud": "1.1.0",
5-
"IBM.WatsonDeveloperCloud.LanguageTranslator.v2": "1.1.0",
4+
"IBM.WatsonDeveloperCloud": "1.2.0",
5+
"IBM.WatsonDeveloperCloud.LanguageTranslator.v2": "1.2.0",
66
"Microsoft.NETCore.App": {
77
"type": "platform",
88
"version": "1.0.1"

examples/IBM.WatsonDeveloperCloud.NaturalLanguageUnderstanding.v1.Ex/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"version": "1.1.0",
2+
"version": "1.2.0",
33
"buildOptions": {
44
"emitEntryPoint": true
55
},
66

77
"dependencies": {
8-
"IBM.WatsonDeveloperCloud": "1.1.0",
9-
"IBM.WatsonDeveloperCloud.NaturalLanguageUnderstanding.v1": "1.1.0",
8+
"IBM.WatsonDeveloperCloud": "1.2.0",
9+
"IBM.WatsonDeveloperCloud.NaturalLanguageUnderstanding.v1": "1.2.0",
1010
"Microsoft.NETCore.App": {
1111
"type": "platform",
1212
"version": "1.0.1"

examples/IBM.WatsonDeveloperCloud.PersonalityInsights.v3.Example/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"version": "1.1.0",
2+
"version": "1.2.0",
33
"dependencies": {
4-
"IBM.WatsonDeveloperCloud": "1.1.0",
5-
"IBM.WatsonDeveloperCloud.PersonalityInsights.v3": "1.1.0",
4+
"IBM.WatsonDeveloperCloud": "1.2.0",
5+
"IBM.WatsonDeveloperCloud.PersonalityInsights.v3": "1.2.0",
66
"Microsoft.NETCore.App": {
77
"type": "platform",
88
"version": "1.0.1"

0 commit comments

Comments
 (0)