Skip to content

Commit

Permalink
Merge pull request #292 from watson-developer-cloud/rc-2.9.0
Browse files Browse the repository at this point in the history
v2.9.0
  • Loading branch information
mediumTaj authored Sep 22, 2018
2 parents 65cbc48 + 25b3e8f commit ce1c0a6
Show file tree
Hide file tree
Showing 109 changed files with 2,682 additions and 323 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[bumpversion]
commit = True
current_version = 2.8.0
current_version = 2.9.0

[bumpversion:file:Doxyfile]

Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Watson Developer Cloud .NET Standard SDK"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 2.8.0
PROJECT_NUMBER = 2.9.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
33 changes: 32 additions & 1 deletion IBM.WatsonDeveloperCloud.sln
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.La
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.LanguageTranslator.v3.UnitTests", "test\IBM.WatsonDeveloperCloud.LanguageTranslator.v3.UnitTests\IBM.WatsonDeveloperCloud.LanguageTranslator.v3.UnitTests.csproj", "{F1D7E642-0F19-497F-89E6-8D0FD747C595}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.WatsonDeveloperCloud.VisRec.v3.Example", "examples\IBM.WatsonDeveloperCloud.VisRec.v3.Example\IBM.WatsonDeveloperCloud.VisRec.v3.Example.csproj", "{019DEDBF-2929-4AB3-AA58-A6C9D42604FC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.VisRec.v3.Example", "examples\IBM.WatsonDeveloperCloud.VisRec.v3.Example\IBM.WatsonDeveloperCloud.VisRec.v3.Example.csproj", "{019DEDBF-2929-4AB3-AA58-A6C9D42604FC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AssistantV2", "AssistantV2", "{90E09BF8-A647-43B8-B721-05CAECFADD72}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.Assistant.v2", "src\IBM.WatsonDeveloperCloud.Assistant.v2\IBM.WatsonDeveloperCloud.Assistant.v2.csproj", "{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.Assistant.v2.UnitTests", "test\IBM.WatsonDeveloperCloud.Assistant.v2.UnitTests\IBM.WatsonDeveloperCloud.Assistant.v2.UnitTests.csproj", "{5FBF32E9-0352-4D8B-BED2-D6EE04363A47}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.Assistant.v2.IntTests", "test\IBM.WatsonDeveloperCloud.Assistant.v2.IntTests\IBM.WatsonDeveloperCloud.Assistant.v2.IntTests.csproj", "{200FC8C7-ED91-4F66-8674-D678588FC450}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.WatsonDeveloperCloud.Assistant.v2.Example", "examples\IBM.WatsonDeveloperCloud.Assistant.v2.Example\IBM.WatsonDeveloperCloud.Assistant.v2.Example.csproj", "{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -299,6 +309,22 @@ Global
{019DEDBF-2929-4AB3-AA58-A6C9D42604FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{019DEDBF-2929-4AB3-AA58-A6C9D42604FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{019DEDBF-2929-4AB3-AA58-A6C9D42604FC}.Release|Any CPU.Build.0 = Release|Any CPU
{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200}.Debug|Any CPU.Build.0 = Debug|Any CPU
{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200}.Release|Any CPU.ActiveCfg = Release|Any CPU
{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200}.Release|Any CPU.Build.0 = Release|Any CPU
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47}.Release|Any CPU.Build.0 = Release|Any CPU
{200FC8C7-ED91-4F66-8674-D678588FC450}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{200FC8C7-ED91-4F66-8674-D678588FC450}.Debug|Any CPU.Build.0 = Debug|Any CPU
{200FC8C7-ED91-4F66-8674-D678588FC450}.Release|Any CPU.ActiveCfg = Release|Any CPU
{200FC8C7-ED91-4F66-8674-D678588FC450}.Release|Any CPU.Build.0 = Release|Any CPU
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -361,6 +387,11 @@ Global
{5DAAA089-EDCA-448F-835E-1EB1CAEB0226} = {65D78D49-E54F-4952-A1D4-7C8D0EDAA1B3}
{F1D7E642-0F19-497F-89E6-8D0FD747C595} = {65D78D49-E54F-4952-A1D4-7C8D0EDAA1B3}
{019DEDBF-2929-4AB3-AA58-A6C9D42604FC} = {A1BC3262-1837-40D9-A530-DCFE679927C2}
{90E09BF8-A647-43B8-B721-05CAECFADD72} = {28E61676-E9FF-4DA9-99CC-5E0D16F02380}
{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
{200FC8C7-ED91-4F66-8674-D678588FC450} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B9D9D17B-1C17-402F-B701-DC671528690A}
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Ensure you have the following prerequisites:
## Installing the Watson .NET Standard SDK
You can get the latest SDK packages through NuGet. Installation instructions can be found in the ReadMe of each package.

* [Assistant](/src/IBM.WatsonDeveloperCloud.Assistant.v1)
* [Assistant V1](/src/IBM.WatsonDeveloperCloud.Assistant.v1)
* [Assistant V2](/src/IBM.WatsonDeveloperCloud.Assistant.v2)
* [Conversation](/src/IBM.WatsonDeveloperCloud.Conversation.v1)
* [Discovery](/src/IBM.WatsonDeveloperCloud.Discovery.v1)
* [Language Translator V2](/src/IBM.WatsonDeveloperCloud.LanguageTranslator.v2) (deprecated)
Expand Down Expand Up @@ -143,6 +144,17 @@ void Example()
}
```

## Self signed certificates
You can disable SSL verification on calls to Watson (only do this if you really mean to!).
```cs
void Example()
{
AssistantService assistant = new AssistantService("<username>", "<password>", "<version-date>");
assistant.SendAsInsecure(true);
var results = assistant.Message("<workspace-id>", "<message-request>");
}
```

## Documentation
Click [here][dotnet-standard-sdk-documentation] for documentation by release and branch.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@


using IBM.WatsonDeveloperCloud.Assistant.v2.Model;
using Newtonsoft.Json;
using System;
/**
* Copyright 2018 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
namespace IBM.WatsonDeveloperCloud.Assistant.v2.Example
{
internal class AssistantServiceExample
{
private AssistantService _assistant;
private string _assistantId;
private string[] _questionArray = { "", "good", "i want a pizza", "large", "three" };
private int _questionIndex = 0;
private string _sessionId;

public AssistantServiceExample(string url, string username, string password, string assistantId)
{
_assistant = new AssistantService(username, password, "2018-09-20");
_assistant.SetEndpoint(url);

_assistantId = assistantId;

var session = _assistant.CreateSession(_assistantId);
_sessionId = session.SessionId;

CallAssistant(_questionIndex);
}

public void CallAssistant(int questionIndex)
{
MessageRequest messageRequest = new MessageRequest()
{
Input = new MessageInput()
{
Text = _questionArray[questionIndex]
}
};

Console.WriteLine(_questionArray[questionIndex]);
var result = _assistant.Message(_assistantId, _sessionId, messageRequest);
Console.WriteLine(result.Output.Generic[0].Text);
_questionIndex++;

if (questionIndex < _questionArray.Length - 1)
{
CallAssistant(_questionIndex);
}
else
{
_assistant.DeleteSession(_assistantId, _sessionId);
Console.WriteLine("Session deleted!");
}
}
}
}
79 changes: 79 additions & 0 deletions examples/IBM.WatsonDeveloperCloud.Assistant.v2.Example/Example.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* Copyright 2018 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using IBM.WatsonDeveloperCloud.Util;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.IO;

namespace IBM.WatsonDeveloperCloud.Assistant.v2.Example
{
class Example
{
static void Main(string[] args)
{
string credentials = string.Empty;

#region Get Credentials
string _endpoint = string.Empty;
string _username = string.Empty;
string _password = string.Empty;
string _assistantId = string.Empty;

if (string.IsNullOrEmpty(credentials))
{
var parentDirectory = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.Parent.Parent.FullName;
string credentialsFilepath = parentDirectory + Path.DirectorySeparatorChar + "sdk-credentials" + Path.DirectorySeparatorChar + "credentials.json";
if (File.Exists(credentialsFilepath))
{
try
{
credentials = File.ReadAllText(credentialsFilepath);
credentials = Utility.AddTopLevelObjectToJson(credentials, "VCAP_SERVICES");
}
catch (Exception e)
{
throw new Exception(string.Format("Failed to load credentials: {0}", e.Message));
}

VcapCredentials vcapCredentials = JsonConvert.DeserializeObject<VcapCredentials>(credentials);
var vcapServices = JObject.Parse(credentials);

Credential credential = vcapCredentials.GetCredentialByname("assistantV2-sdk-staging")[0].Credentials;
_endpoint = credential.Url;
_username = credential.Username;
_password = credential.Password;
_assistantId = credential.AssistantId;
}
else
{
Console.WriteLine("Credentials file does not exist. Please define credentials.");
_username = "";
_password = "";
_endpoint = "";
_assistantId = "";
}
}
#endregion

AssistantServiceExample _AssistantServiceExample = new AssistantServiceExample(_endpoint, _username, _password, _assistantId);

Console.ReadKey();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>2.8.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.Conversation.v1.Example</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>IBM.WatsonDeveloperCloud.Conversation.v1.Example</PackageId>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.8.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\IBM.WatsonDeveloperCloud.Assistant.v2\IBM.WatsonDeveloperCloud.Assistant.v2.csproj" />
<ProjectReference Include="..\..\src\IBM.WatsonDeveloperCloud\IBM.WatsonDeveloperCloud.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.8.0</VersionPrefix>
<VersionPrefix>2.9.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.Conversation.v1.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.8.0</Version>
<Version>2.9.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.8.0</VersionPrefix>
<VersionPrefix>2.9.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.Discovery.v1.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.8.0</Version>
<Version>2.9.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.8.0</VersionPrefix>
<VersionPrefix>2.9.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.LanguageTranslator.v2.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.8.0</Version>
<Version>2.9.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.8.0</VersionPrefix>
<VersionPrefix>2.9.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.LanguageTranslator.v3.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.8.0</Version>
<Version>2.9.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.8.0</VersionPrefix>
<VersionPrefix>2.9.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.NaturalLanguageUnderstanding.v1.Ex</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.8.0</Version>
<Version>2.9.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.8.0</VersionPrefix>
<VersionPrefix>2.9.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.PersonalityInsights.v3.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.8.0</Version>
<Version>2.9.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
Loading

0 comments on commit ce1c0a6

Please sign in to comment.