From bee69af65aadd3e13728bdf45efdf61180530401 Mon Sep 17 00:00:00 2001 From: Ajiemar Santiago Date: Thu, 23 Jun 2016 13:49:45 -0500 Subject: [PATCH 1/7] added alchemy language and visual recognition to config editor --- Scripts/Editor/ConfigEditor.cs | 27 +++++++++++++++++++++------ Scripts/Utilities/Config.cs | 17 +++++++++++++++-- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/Scripts/Editor/ConfigEditor.cs b/Scripts/Editor/ConfigEditor.cs index d6528ede6..4c2115b0a 100644 --- a/Scripts/Editor/ConfigEditor.cs +++ b/Scripts/Editor/ConfigEditor.cs @@ -65,7 +65,11 @@ private class ServiceSetup new ServiceSetup() { ServiceName = "Personality Insights", ServiceAPI = "personality-insights/api", URL ="https://console.ng.bluemix.net/catalog/services/personality-insights/", ServiceID="PersonalityInsightsV2" }, new ServiceSetup() { ServiceName = "Conversation", ServiceAPI = "conversation-experimental/api", - URL ="https://console.ng.bluemix.net/catalog/services/conversation/", ServiceID="ConversationV1" } + URL ="https://console.ng.bluemix.net/catalog/services/conversation/", ServiceID="ConversationV1" }, + new ServiceSetup() { ServiceName = "Alchemy Language", ServiceAPI = "gateway-a.watsonplatform.net/calls", + URL ="https://console.ng.bluemix.net/catalog/services/alchemyapi/", ServiceID="AlchemyLanguageV1" }, + new ServiceSetup() { ServiceName = "Visual Recognition", ServiceAPI = "visual-recognition/api", + URL ="https://console.ng.bluemix.net/catalog/services/visual-recognition/", ServiceID="VisualRecognitionV3" } }; private const string TITLE = "Watson Unity SDK"; @@ -193,6 +197,20 @@ private static void EditConfig() private Vector2 m_ScrollPos = Vector2.zero; private string m_PastedCredentials = "\n\n\n\n\n\n\n"; + private bool GetIsValid(ServiceSetup setup) + { + bool isValid = false; + Config cfg = Config.Instance; + Config.CredentialInfo info = cfg.FindCredentials( setup.ServiceID ); + if(info != null) + { + if((!string.IsNullOrEmpty(info.m_URL) && !string.IsNullOrEmpty(info.m_Password)) || !string.IsNullOrEmpty(info.m_Apikey)) + isValid = true; + } + + return isValid; + } + private void OnGUI() { Config cfg = Config.Instance; @@ -205,17 +223,14 @@ private void OnGUI() //GUILayout.Label( "Use this dialog to generate your configuration file for the Watson Unity SDK." ); //GUILayout.Label( "If you have never registered for Watson BlueMix services, click on the button below to begin registration." ); - if ( GUILayout.Button( "Register for Watson Services" ) ) + if(GUILayout.Button("Register for Watson Services")) Application.OpenURL( BLUEMIX_REGISTRATION ); foreach( var setup in SERVICE_SETUP ) { Config.CredentialInfo info = cfg.FindCredentials( setup.ServiceID ); - bool bValid = info != null - && !string.IsNullOrEmpty( info.m_URL ) - && !string.IsNullOrEmpty( info.m_User ) - && !string.IsNullOrEmpty( info.m_Password ); + bool bValid = GetIsValid(setup); GUILayout.BeginHorizontal(); diff --git a/Scripts/Utilities/Config.cs b/Scripts/Utilities/Config.cs index 16b6e559e..b470eb4f6 100644 --- a/Scripts/Utilities/Config.cs +++ b/Scripts/Utilities/Config.cs @@ -69,6 +69,14 @@ public class CredentialInfo /// The password for these credentials. /// public string m_Password; + /// + /// The API key for this service. + /// + public string m_Apikey; + /// + /// A note for the applied service. + /// + public string m_Note; /// /// Generate JSON credentials. @@ -76,7 +84,7 @@ public class CredentialInfo /// Returns a string of the JSON. public string MakeJSON() { - return "{\n\t\"credentials\": {\n\t\t\"url\": \"" + m_URL + "\",\n\t\t\"username\": \"" + m_User + "\",\n\t\t\"password\": \"" + m_Password + "\"\n\t}\n}"; + return "{\n\t\"credentials\": {\n\t\t\"url\": \"" + m_URL + "\",\n\t\t\"username\": \"" + m_User + "\",\n\t\t\"password\": \"" + m_Password + "\",\n\t\t\"apikey\": \"" + m_Apikey + "\",\n\t\t\"note\": \"" + m_Note + "\"\n\t}\n}"; } /// @@ -93,6 +101,11 @@ public bool ParseJSON(string json) m_URL = (string)iCredentials["url"]; m_User = (string)iCredentials["username"]; m_Password = (string)iCredentials["password"]; + m_Note = (string)iCredentials["note"]; + if(!string.IsNullOrEmpty((string)iCredentials["apikey"])) + m_Apikey = (string)iCredentials["apikey"]; + if(!string.IsNullOrEmpty((string)iCredentials["api_key"])) + m_Apikey = (string)iCredentials["api_key"]; return true; } @@ -110,7 +123,7 @@ public bool ParseJSON(string json) /// true if this instance has credentials; otherwise, false. public bool HasCredentials() { - return !string.IsNullOrEmpty(m_User) && !string.IsNullOrEmpty(m_Password); + return (!string.IsNullOrEmpty(m_User) && !string.IsNullOrEmpty(m_Password)) || !string.IsNullOrEmpty(m_Apikey); } } From 605b1e7b1490371cf4a8e105f75d54c4a28a4421 Mon Sep 17 00:00:00 2001 From: Ajiemar Santiago Date: Thu, 23 Jun 2016 13:55:56 -0500 Subject: [PATCH 2/7] showing either u/p or apikey --- Scripts/Editor/ConfigEditor.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Scripts/Editor/ConfigEditor.cs b/Scripts/Editor/ConfigEditor.cs index 4c2115b0a..510256901 100644 --- a/Scripts/Editor/ConfigEditor.cs +++ b/Scripts/Editor/ConfigEditor.cs @@ -348,8 +348,13 @@ private void OnGUI() GUILayout.EndHorizontal(); info.m_URL = EditorGUILayout.TextField("URL", info.m_URL); - info.m_User = EditorGUILayout.TextField("User", info.m_User); - info.m_Password = EditorGUILayout.TextField("Password", info.m_Password); + if(info.m_URL.StartsWith("https://gateway-a")) + info.m_Apikey = EditorGUILayout.TextField("API Key", info.m_Apikey); + else + { + info.m_User = EditorGUILayout.TextField("User", info.m_User); + info.m_Password = EditorGUILayout.TextField("Password", info.m_Password); + } if (GUILayout.Button("Delete")) cfg.Credentials.RemoveAt(i--); From 772b3797c8099879a59682c326e8caaca2e70aa4 Mon Sep 17 00:00:00 2001 From: Ajiemar Santiago Date: Thu, 23 Jun 2016 14:57:24 -0500 Subject: [PATCH 3/7] VisualRecognition example and service status revisions for apikey --- .../Scripts/ExampleVisualRecognition.cs | 14 +++++++------- Scripts/Editor/ConfigEditor.cs | 1 + Scripts/Utilities/Config.cs | 11 ++++++++++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs b/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs index 895a07a1a..5598a36ee 100644 --- a/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs +++ b/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs @@ -24,7 +24,7 @@ public class ExampleVisualRecognition : MonoBehaviour { private VisualRecognition m_VisualRecognition = new VisualRecognition(); private string m_classifierName = "Apples_OptionalParams"; - private string m_classifierID = "Apples_OptionalParams_1213405640"; + private string m_classifierID = "ApplesClassifierNameWithSpaces_73100404"; private string m_classifierToDelete = "unitytestclassifier2b_37849361"; private string m_imageURL = "https://upload.wikimedia.org/wikipedia/commons/e/e9/Official_portrait_of_Barack_Obama.jpg"; private string m_imageTextURL = "http://i.stack.imgur.com/ZS6nH.png"; @@ -49,9 +49,9 @@ void Start () Log.Debug("ExampleVisualRecognition", "Deleting classifier failed!"); // Train classifier - string m_positiveExamplesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/taj_positive_examples.zip"; - string m_negativeExamplesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/negative_examples.zip"; - if(!m_VisualRecognition.TrainClassifier("unity-test-classifier5", "taj", m_positiveExamplesPath, m_negativeExamplesPath, OnTrainClassifier)) + string m_positiveExamplesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/giraffe_positive_examples.zip"; + string m_negativeExamplesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/negative_examples.zip"; + if(!m_VisualRecognition.TrainClassifier("unity-test-classifier5", "giraffe", m_positiveExamplesPath, m_negativeExamplesPath, OnTrainClassifier)) Log.Debug("ExampleVisualRecognition", "Train classifier failed!"); // Classify get @@ -59,7 +59,7 @@ void Start () Log.Debug("ExampleVisualRecognition", "Classify image failed!"); // Classify post image - string m_imagesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/obama.jpg"; + string m_imagesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/obama.jpg"; string[] m_owners = {"IBM", "me"}; string[] m_classifierIDs = {"default"}; if(!m_VisualRecognition.Classify(OnClassify, m_imagesPath, m_owners, m_classifierIDs, 0.5f)) @@ -71,7 +71,7 @@ void Start () Log.Debug("ExampleVisualRecogntiion", "Detect faces failed!"); // Detect faces post image - string m_faceExamplePath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/obama.jpg"; + string m_faceExamplePath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/obama.jpg"; if(!m_VisualRecognition.DetectFaces(OnDetectFaces, m_faceExamplePath)) Log.Debug("ExampleVisualRecognition", "Detect faces failed!"); @@ -82,7 +82,7 @@ void Start () Log.Debug("ExampleVisualRecognition", "Recognize text failed!"); // Recognize text post image - string m_textExamplePath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/from_platos_apology.png"; + string m_textExamplePath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/from_platos_apology.png"; if(!m_VisualRecognition.RecognizeText(OnRecognizeText, m_textExamplePath)) Log.Debug("ExampleVisualRecognition", "Recognize text failed!"); } diff --git a/Scripts/Editor/ConfigEditor.cs b/Scripts/Editor/ConfigEditor.cs index 510256901..26c6a637a 100644 --- a/Scripts/Editor/ConfigEditor.cs +++ b/Scripts/Editor/ConfigEditor.cs @@ -348,6 +348,7 @@ private void OnGUI() GUILayout.EndHorizontal(); info.m_URL = EditorGUILayout.TextField("URL", info.m_URL); + if(info.m_URL.StartsWith("https://gateway-a")) info.m_Apikey = EditorGUILayout.TextField("API Key", info.m_Apikey); else diff --git a/Scripts/Utilities/Config.cs b/Scripts/Utilities/Config.cs index b470eb4f6..29d116d35 100644 --- a/Scripts/Utilities/Config.cs +++ b/Scripts/Utilities/Config.cs @@ -123,7 +123,16 @@ public bool ParseJSON(string json) /// true if this instance has credentials; otherwise, false. public bool HasCredentials() { - return (!string.IsNullOrEmpty(m_User) && !string.IsNullOrEmpty(m_Password)) || !string.IsNullOrEmpty(m_Apikey); + return (!string.IsNullOrEmpty(m_User) && !string.IsNullOrEmpty(m_Password)); + } + + /// + /// Determines whether this instance has API key. + /// + /// true if this instance has API key; otherwise, false. + public bool HasAPIKey() + { + return !string.IsNullOrEmpty(m_Apikey); } } From db040b7f90c2b0ef24906cf45bcd7c7627859ed6 Mon Sep 17 00:00:00 2001 From: Ajiemar Santiago Date: Thu, 23 Jun 2016 15:17:33 -0500 Subject: [PATCH 4/7] GetAPIKey implementation instead of variable --- .../Scripts/ExampleVisualRecognition.cs | 2 +- .../Services/AlchemyAPI/AlchemyLanguage.cs | 2 +- .../VisualRecognition/VisualRecognition.cs | 24 +++++++++---------- Scripts/Utilities/Config.cs | 8 +++++++ 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs b/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs index 5598a36ee..e6a0f7345 100644 --- a/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs +++ b/Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs @@ -36,7 +36,7 @@ void Start () // Get all classifiers if(!m_VisualRecognition.GetClassifiers(OnGetClassifiers)) Log.Debug("ExampleVisualRecognition", "Getting classifiers failed!"); - +// // Find classifier by name m_VisualRecognition.FindClassifier(m_classifierName, OnFindClassifier); diff --git a/Scripts/Services/AlchemyAPI/AlchemyLanguage.cs b/Scripts/Services/AlchemyAPI/AlchemyLanguage.cs index bbe8cc09b..3d9280e99 100644 --- a/Scripts/Services/AlchemyAPI/AlchemyLanguage.cs +++ b/Scripts/Services/AlchemyAPI/AlchemyLanguage.cs @@ -45,7 +45,7 @@ public class AlchemyLanguage : IWatsonService #region SetCredentials private void SetCredentials() { - mp_ApiKey = Config.Instance.GetVariableValue("ALCHEMY_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if (string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("ALCHEMY_API_KEY needs to be defined in config.json"); diff --git a/Scripts/Services/VisualRecognition/VisualRecognition.cs b/Scripts/Services/VisualRecognition/VisualRecognition.cs index 986492171..e1168d428 100644 --- a/Scripts/Services/VisualRecognition/VisualRecognition.cs +++ b/Scripts/Services/VisualRecognition/VisualRecognition.cs @@ -109,7 +109,7 @@ public class VisualRecognition : IWatsonService public bool Classify(string url, OnClassify callback, string[] owners = default(string[]), string[] classifierIDs = default(string[]), float threshold = default(float), string acceptLanguage = "en") { if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("FindClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); if(string.IsNullOrEmpty(url)) @@ -151,7 +151,7 @@ public class VisualRecognition : IWatsonService public bool Classify(OnClassify callback, string imagePath, string[] owners = default(string[]), string[] classifierIDs = default(string[]), float threshold = default(float), string acceptLanguage = "en") { if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("FindClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); if(callback == null) @@ -259,7 +259,7 @@ public bool DetectFaces(string url, OnDetectFaces callback) if(callback == null) throw new ArgumentNullException("callback"); if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("FindClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); @@ -288,7 +288,7 @@ public bool DetectFaces(OnDetectFaces callback, string imagePath) if(string.IsNullOrEmpty(imagePath)) throw new ArgumentNullException("Define an image path to classify!"); if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("FindClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); @@ -392,7 +392,7 @@ public bool RecognizeText(string url, OnRecognizeText callback) if(callback == null) throw new ArgumentNullException("callback"); if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("FindClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); @@ -421,7 +421,7 @@ public bool RecognizeText(OnRecognizeText callback, string imagePath) if(string.IsNullOrEmpty(imagePath)) throw new ArgumentNullException("Define an image path to classify!"); if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("FindClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); @@ -545,7 +545,7 @@ public FindClassifierReq(VisualRecognition service, string classifierName, OnFin if(string.IsNullOrEmpty(classifierName)) throw new WatsonException("classifierName required"); if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("FindClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); @@ -598,7 +598,7 @@ public bool GetClassifiers(OnGetClassifiers callback) if(callback == null) throw new ArgumentNullException("callback"); if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("GetClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); @@ -662,7 +662,7 @@ public bool GetClassifier(string classifierId, OnGetClassifier callback) if (callback == null) throw new ArgumentNullException("callback"); if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("GetClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); @@ -728,7 +728,7 @@ private void OnGetClassifierResp(RESTConnector.Request req, RESTConnector.Respon public bool TrainClassifier(string classifierName, string className, string positiveExamplesPath, string negativeExamplesPath, OnTrainClassifier callback) { if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("GetClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); if(string.IsNullOrEmpty(classifierName)) @@ -764,7 +764,7 @@ public bool TrainClassifier(string classifierName, string className, string posi private bool UploadClassifier(string classifierName, string className, byte[] positiveExamplesData, byte[] negativeExamplesData, OnTrainClassifier callback) { if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("GetClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); if(string.IsNullOrEmpty(classifierName)) @@ -842,7 +842,7 @@ public bool DeleteClassifier(string classifierId, OnDeleteClassifier callback) if(callback == null) throw new ArgumentNullException("callback"); if(string.IsNullOrEmpty(mp_ApiKey)) - mp_ApiKey = Config.Instance.GetVariableValue("VISUAL_RECOGNITION_API_KEY"); + mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); if(string.IsNullOrEmpty(mp_ApiKey)) throw new WatsonException("GetClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); diff --git a/Scripts/Utilities/Config.cs b/Scripts/Utilities/Config.cs index 29d116d35..20d166fdc 100644 --- a/Scripts/Utilities/Config.cs +++ b/Scripts/Utilities/Config.cs @@ -317,6 +317,14 @@ public Variable GetVariable(string key) return null; } + public string GetAPIKey(string serviceID) + { + foreach (var info in m_Credentials) + if (info.m_ServiceID == serviceID) + return info.m_Apikey; + return null; + } + /// /// Gets the variable value. /// From f5a91a0d820fb6109506a8362750a12e109e10fc Mon Sep 17 00:00:00 2001 From: Ajiemar Santiago Date: Thu, 23 Jun 2016 15:37:42 -0500 Subject: [PATCH 5/7] check for empty url in configEditor advanced mode --- Scripts/Editor/ConfigEditor.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Scripts/Editor/ConfigEditor.cs b/Scripts/Editor/ConfigEditor.cs index 26c6a637a..8d2b28152 100644 --- a/Scripts/Editor/ConfigEditor.cs +++ b/Scripts/Editor/ConfigEditor.cs @@ -349,12 +349,15 @@ private void OnGUI() info.m_URL = EditorGUILayout.TextField("URL", info.m_URL); - if(info.m_URL.StartsWith("https://gateway-a")) - info.m_Apikey = EditorGUILayout.TextField("API Key", info.m_Apikey); - else + if(!string.IsNullOrEmpty(info.m_URL)) { - info.m_User = EditorGUILayout.TextField("User", info.m_User); - info.m_Password = EditorGUILayout.TextField("Password", info.m_Password); + if(info.m_URL.StartsWith("https://gateway-a")) + info.m_Apikey = EditorGUILayout.TextField("API Key", info.m_Apikey); + else + { + info.m_User = EditorGUILayout.TextField("User", info.m_User); + info.m_Password = EditorGUILayout.TextField("Password", info.m_Password); + } } if (GUILayout.Button("Delete")) From e11e7af70d0fe0a006f72ee46c4561c89b652f6f Mon Sep 17 00:00:00 2001 From: Ajiemar Santiago Date: Thu, 23 Jun 2016 15:43:43 -0500 Subject: [PATCH 6/7] Fixes #85, Fixes #70 added Alchemy Language and Visual Recognition to the config editor, updated readme to remove variable instructions, updated changelog --- CHANGELOG.md | 22 ++++++++++++---------- README.md | 8 ++------ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05049f02f..aefaa2bd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,21 +4,23 @@ Change Log _2016-06-24_ - * New: Added Alchemy Language v1 abstraction - * New: Added Personality Insights v2 abstraction - * Fix: Added Tone Analyzer to the Configuration Editor - * Fix: Added Tradeoff Analytics to the Configuration Editor - * Fix: Added Conversation to the Configuration Editor - * Fix: Added Personality Insights to the Configuration Editor + * New: Added `Alchemy Language` abstraction + * New: Added `Personality Insights` abstraction + * Fix: Added `Tone Analyzer` to the Configuration Editor + * Fix: Added `Tradeoff Analytics` to the Configuration Editor + * Fix: Added `Conversation` to the Configuration Editor + * Fix: Added `Personality Insights` to the Configuration Editor + * Fix: Added `Alchemy Language` to the Configuration Editor + * Fix: Added `Visual Recognition` to the Configuration Editor ## Version 0.4.0 _2016-06-09_ - * New: Added Tone Analyzer v3 abstraction - * New: Added Tradeoff Analytics abstraction - * New: Added Conversation abstraction - * New: Added Visual Recognition v3 abstraction + * New: Added `Tone Analyzer v3` abstraction + * New: Added `Tradeoff Analytics` abstraction + * New: Added `Conversation` abstraction + * New: Added `Visual Recognition v3` abstraction * Fix: Creating test project dynamically for Travis CL integration * Fix: Refactored Language Translation to Language Translator * Fix: Widget examples sprite references were disconnected diff --git a/README.md b/README.md index 7ae670905..c924e946d 100644 --- a/README.md +++ b/README.md @@ -354,9 +354,7 @@ void OnMessage (DataModels.MessageResponse resp) ### Visual Recognition -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. Instead of credentials, the Visual Recognition key `VISUAL_RECOGNITION_API_KEY` must be set as a variable in the Advanced Mode of the Config Editor (**Watson -> Configuration Editor**). The ServiceID `VisualRecognitionV3` and endpoint URL `https://gateway-a.watsonplatform.net/visual-recognition/api` must also be added manually. - -![visual-recognition0](http://g.recordit.co/Qke2gKfaKJ.gif) +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. #### Managing Classifiers You can train and delete classifiers by directly accessing low level Visual Recognition methods. @@ -780,9 +778,7 @@ private void LogTraitTree(DataModels.TraitTreeNode traitTreeNode) ### Alchemy Language -Use the [Alchemy Language][alchemy_language] service to extract semantic meta-data from content such as information on people, places, companies, topics, facts, relationships, authors and languages. Instead of credentials, the Alchemy API Key `ALCHEMY_API_KEY` must be set as a variable in the Advanced Mode of the Config Editor (**Watson -> Configuration Editor**). The ServiceID `AlchemyLanguageV1` and endpoint URL `https://gateway-a.watsonplatform.net` must also be added manually. - -![alchemy-language0](http://g.recordit.co/xkGArdMVbC.gif) +Use the [Alchemy Language][alchemy_language] service to extract semantic meta-data from content such as information on people, places, companies, topics, facts, relationships, authors and languages. #### Getting Authors You can extract Authors from a URL or HTML source. From 344e74e50a4222372fc248f4f860f679cdc9a8af Mon Sep 17 00:00:00 2001 From: Ajiemar Santiago Date: Thu, 23 Jun 2016 15:46:12 -0500 Subject: [PATCH 7/7] updated credentials --- Config.json.enc | Bin 3248 -> 3760 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Config.json.enc b/Config.json.enc index 1b7d61ddfd176eef2db1d634ffe3679171765324..31ef85f7778d9d2edd7be4d36386307d5228c859 100644 GIT binary patch literal 3760 zcmV;h4o~sb0NOmv_~>_(1*Mj^4#Ia+c#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