diff --git a/.travis.yml b/.travis.yml index 8c59f5574..5d2e6ce46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: -- "8.3" +- "8" os: - osx osx_image: xcode61 diff --git a/Scripts/Services/Assistant/V1/AssistantService.cs b/Scripts/Services/Assistant/V1/AssistantService.cs index e3cddd9da..9fde4fda6 100644 --- a/Scripts/Services/Assistant/V1/AssistantService.cs +++ b/Scripts/Services/Assistant/V1/AssistantService.cs @@ -313,8 +313,9 @@ private void OnListWorkspacesResponse(RESTConnector.Request req, RESTConnector.R /// (optional) /// An array of objects defining input examples that have been marked as /// irrelevant input. (optional) + /// (optional) /// Workspace - public bool CreateWorkspace(Callback callback, string name = null, string description = null, string language = null, Dictionary metadata = null, bool? learningOptOut = null, WorkspaceSystemSettings systemSettings = null, List intents = null, List entities = null, List dialogNodes = null, List counterexamples = null) + public bool CreateWorkspace(Callback callback, string name = null, string description = null, string language = null, Dictionary metadata = null, bool? learningOptOut = null, WorkspaceSystemSettings systemSettings = null, List intents = null, List entities = null, List dialogNodes = null, List counterexamples = null, List webhooks = null) { if (callback == null) throw new ArgumentNullException("`callback` is required for `CreateWorkspace`"); @@ -363,6 +364,8 @@ public bool CreateWorkspace(Callback callback, string name = null, st bodyObject["dialog_nodes"] = JToken.FromObject(dialogNodes); if (counterexamples != null && counterexamples.Count > 0) bodyObject["counterexamples"] = JToken.FromObject(counterexamples); + if (webhooks != null && webhooks.Count > 0) + bodyObject["webhooks"] = JToken.FromObject(webhooks); req.Send = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bodyObject)); req.OnResponse = OnCreateWorkspaceResponse; @@ -514,6 +517,7 @@ private void OnGetWorkspaceResponse(RESTConnector.Request req, RESTConnector.Res /// (optional) /// An array of objects defining input examples that have been marked as /// irrelevant input. (optional) + /// (optional) /// Whether the new data is to be appended to the existing data in the workspace. If /// **append**=`false`, elements included in the new data completely replace the corresponding existing /// elements, including all subelements. For example, if the new data includes **entities** and @@ -522,7 +526,7 @@ private void OnGetWorkspaceResponse(RESTConnector.Request req, RESTConnector.Res /// If **append**=`true`, existing elements are preserved, and the new elements are added. If any elements in /// the new data collide with existing elements, the update request fails. (optional, default to false) /// Workspace - public bool UpdateWorkspace(Callback callback, string workspaceId, string name = null, string description = null, string language = null, Dictionary metadata = null, bool? learningOptOut = null, WorkspaceSystemSettings systemSettings = null, List intents = null, List entities = null, List dialogNodes = null, List counterexamples = null, bool? append = null) + public bool UpdateWorkspace(Callback callback, string workspaceId, string name = null, string description = null, string language = null, Dictionary metadata = null, bool? learningOptOut = null, WorkspaceSystemSettings systemSettings = null, List intents = null, List entities = null, List dialogNodes = null, List counterexamples = null, List webhooks = null, bool? append = null) { if (callback == null) throw new ArgumentNullException("`callback` is required for `UpdateWorkspace`"); @@ -577,6 +581,8 @@ public bool UpdateWorkspace(Callback callback, string workspaceId, st bodyObject["dialog_nodes"] = JToken.FromObject(dialogNodes); if (counterexamples != null && counterexamples.Count > 0) bodyObject["counterexamples"] = JToken.FromObject(counterexamples); + if (webhooks != null && webhooks.Count > 0) + bodyObject["webhooks"] = JToken.FromObject(webhooks); req.Send = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bodyObject)); req.OnResponse = OnUpdateWorkspaceResponse; @@ -3595,8 +3601,10 @@ private void OnListDialogNodesResponse(RESTConnector.Request req, RESTConnector. /// (optional) /// A label that can be displayed externally to describe the purpose of the node to /// users. (optional) + /// Whether the dialog node should be excluded from disambiguation + /// suggestions. (optional, default to false) /// DialogNode - public bool CreateDialogNode(Callback callback, string workspaceId, string dialogNode, string description = null, string conditions = null, string parent = null, string previousSibling = null, DialogNodeOutput output = null, Dictionary context = null, Dictionary metadata = null, DialogNodeNextStep nextStep = null, string title = null, string type = null, string eventName = null, string variable = null, List actions = null, string digressIn = null, string digressOut = null, string digressOutSlots = null, string userLabel = null) + public bool CreateDialogNode(Callback callback, string workspaceId, string dialogNode, string description = null, string conditions = null, string parent = null, string previousSibling = null, DialogNodeOutput output = null, Dictionary context = null, Dictionary metadata = null, DialogNodeNextStep nextStep = null, string title = null, string type = null, string eventName = null, string variable = null, List actions = null, string digressIn = null, string digressOut = null, string digressOutSlots = null, string userLabel = null, bool? disambiguationOptOut = null) { if (callback == null) throw new ArgumentNullException("`callback` is required for `CreateDialogNode`"); @@ -3665,6 +3673,8 @@ public bool CreateDialogNode(Callback callback, string workspaceId, bodyObject["digress_out_slots"] = digressOutSlots; if (!string.IsNullOrEmpty(userLabel)) bodyObject["user_label"] = userLabel; + if (disambiguationOptOut != null) + bodyObject["disambiguation_opt_out"] = JToken.FromObject(disambiguationOptOut); req.Send = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bodyObject)); req.OnResponse = OnCreateDialogNodeResponse; @@ -3825,8 +3835,10 @@ private void OnGetDialogNodeResponse(RESTConnector.Request req, RESTConnector.Re /// (optional) /// A label that can be displayed externally to describe the purpose of the node to /// users. (optional) + /// Whether the dialog node should be excluded from disambiguation + /// suggestions. (optional, default to false) /// DialogNode - public bool UpdateDialogNode(Callback callback, string workspaceId, string dialogNode, string newDialogNode = null, string newDescription = null, string newConditions = null, string newParent = null, string newPreviousSibling = null, DialogNodeOutput newOutput = null, Dictionary newContext = null, Dictionary newMetadata = null, DialogNodeNextStep newNextStep = null, string newTitle = null, string newType = null, string newEventName = null, string newVariable = null, List newActions = null, string newDigressIn = null, string newDigressOut = null, string newDigressOutSlots = null, string newUserLabel = null) + public bool UpdateDialogNode(Callback callback, string workspaceId, string dialogNode, string newDialogNode = null, string newDescription = null, string newConditions = null, string newParent = null, string newPreviousSibling = null, DialogNodeOutput newOutput = null, Dictionary newContext = null, Dictionary newMetadata = null, DialogNodeNextStep newNextStep = null, string newTitle = null, string newType = null, string newEventName = null, string newVariable = null, List newActions = null, string newDigressIn = null, string newDigressOut = null, string newDigressOutSlots = null, string newUserLabel = null, bool? newDisambiguationOptOut = null) { if (callback == null) throw new ArgumentNullException("`callback` is required for `UpdateDialogNode`"); @@ -3895,6 +3907,8 @@ public bool UpdateDialogNode(Callback callback, string workspaceId, bodyObject["digress_out_slots"] = newDigressOutSlots; if (!string.IsNullOrEmpty(newUserLabel)) bodyObject["user_label"] = newUserLabel; + if (newDisambiguationOptOut != null) + bodyObject["disambiguation_opt_out"] = JToken.FromObject(newDisambiguationOptOut); req.Send = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bodyObject)); req.OnResponse = OnUpdateDialogNodeResponse; @@ -4107,8 +4121,9 @@ private void OnListLogsResponse(RESTConnector.Request req, RESTConnector.Respons /// /// The callback function that is invoked when the operation completes. /// A cacheable parameter that limits the results to those matching the specified filter. - /// You must specify a filter query that includes a value for `language`, as well as a value for `workspace_id` - /// or `request.context.metadata.deployment`. For more information, see the + /// You must specify a filter query that includes a value for `language`, as well as a value for + /// `request.context.system.assistant_id`, `workspace_id`, or `request.context.metadata.deployment`. For more + /// information, see the /// [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-filter-reference#filter-reference). /// How to sort the returned log events. You can sort by **request_timestamp**. To reverse /// the sort order, prefix the parameter value with a minus sign (`-`). (optional) diff --git a/Scripts/Services/Assistant/V1/Model/DialogNode.cs b/Scripts/Services/Assistant/V1/Model/DialogNode.cs index 807b98809..7525d1259 100644 --- a/Scripts/Services/Assistant/V1/Model/DialogNode.cs +++ b/Scripts/Services/Assistant/V1/Model/DialogNode.cs @@ -263,6 +263,11 @@ public class DigressOutSlotsValue [JsonProperty("user_label", NullValueHandling = NullValueHandling.Ignore)] public string UserLabel { get; set; } /// + /// Whether the dialog node should be excluded from disambiguation suggestions. + /// + [JsonProperty("disambiguation_opt_out", NullValueHandling = NullValueHandling.Ignore)] + public bool? DisambiguationOptOut { get; set; } + /// /// For internal use only. /// [JsonProperty("disabled", NullValueHandling = NullValueHandling.Ignore)] diff --git a/Scripts/Services/Assistant/V1/Model/DialogNodeAction.cs b/Scripts/Services/Assistant/V1/Model/DialogNodeAction.cs index 825b10250..dea517e3d 100644 --- a/Scripts/Services/Assistant/V1/Model/DialogNodeAction.cs +++ b/Scripts/Services/Assistant/V1/Model/DialogNodeAction.cs @@ -46,6 +46,10 @@ public class TypeValue /// Constant WEB_ACTION for web_action /// public const string WEB_ACTION = "web_action"; + /// + /// Constant WEBHOOK for webhook + /// + public const string WEBHOOK = "webhook"; } diff --git a/Scripts/Services/Assistant/V1/Model/DialogSuggestion.cs b/Scripts/Services/Assistant/V1/Model/DialogSuggestion.cs index 273fcc50e..2f24eb8fc 100644 --- a/Scripts/Services/Assistant/V1/Model/DialogSuggestion.cs +++ b/Scripts/Services/Assistant/V1/Model/DialogSuggestion.cs @@ -25,8 +25,8 @@ namespace IBM.Watson.Assistant.V1.Model public class DialogSuggestion { /// - /// The user-facing label for the disambiguation option. This label is taken from the **user_label** property of - /// the corresponding dialog node. + /// The user-facing label for the disambiguation option. This label is taken from the **title** or + /// **user_label** property of the corresponding dialog node, depending on the disambiguation options. /// [JsonProperty("label", NullValueHandling = NullValueHandling.Ignore)] public string Label { get; set; } diff --git a/Scripts/Services/Assistant/V1/Model/RuntimeResponseGeneric.cs b/Scripts/Services/Assistant/V1/Model/RuntimeResponseGeneric.cs index c3f570fbe..0bb094ebd 100644 --- a/Scripts/Services/Assistant/V1/Model/RuntimeResponseGeneric.cs +++ b/Scripts/Services/Assistant/V1/Model/RuntimeResponseGeneric.cs @@ -149,7 +149,7 @@ public class PreferenceValue /// An array of objects describing the possible matching dialog nodes from which the user can choose. /// /// **Note:** The **suggestions** property is part of the disambiguation feature, which is only available for - /// Premium users. + /// Plus and Premium users. /// [JsonProperty("suggestions", NullValueHandling = NullValueHandling.Ignore)] public List Suggestions { get; set; } diff --git a/Scripts/Services/Assistant/V1/Model/Webhook.cs b/Scripts/Services/Assistant/V1/Model/Webhook.cs new file mode 100644 index 000000000..19ad704b1 --- /dev/null +++ b/Scripts/Services/Assistant/V1/Model/Webhook.cs @@ -0,0 +1,46 @@ +/** +* Copyright 2018, 2019 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 System.Collections.Generic; +using Newtonsoft.Json; + +namespace IBM.Watson.Assistant.V1.Model +{ + /// + /// A webhook that can be used by dialog nodes to make programmatic calls to an external function. + /// + /// **Note:** Currently, only a single webhook named `main_webhook` is supported. + /// + public class Webhook + { + /// + /// The URL for the external service or application to which you want to send HTTP POST requests. + /// + [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] + public string Url { get; set; } + /// + /// The name of the webhook. Currently, `main_webhook` is the only supported value. + /// + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + /// + /// An optional array of HTTP headers to pass with the HTTP request. + /// + [JsonProperty("headers", NullValueHandling = NullValueHandling.Ignore)] + public List Headers { get; set; } + } +} diff --git a/Scripts/Services/Assistant/V1/Model/Webhook.cs.meta b/Scripts/Services/Assistant/V1/Model/Webhook.cs.meta new file mode 100644 index 000000000..8aed64391 --- /dev/null +++ b/Scripts/Services/Assistant/V1/Model/Webhook.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a6e296c6f12cb409e8dbf7a5048c0d21 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Services/Assistant/V1/Model/WebhookHeader.cs b/Scripts/Services/Assistant/V1/Model/WebhookHeader.cs new file mode 100644 index 000000000..8e1a3a295 --- /dev/null +++ b/Scripts/Services/Assistant/V1/Model/WebhookHeader.cs @@ -0,0 +1,38 @@ +/** +* Copyright 2018, 2019 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 Newtonsoft.Json; + +namespace IBM.Watson.Assistant.V1.Model +{ + /// + /// A key/value pair defining an HTTP header and a value. + /// + public class WebhookHeader + { + /// + /// The name of an HTTP header (for example, `Authorization`). + /// + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + /// + /// The value of an HTTP header. + /// + [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] + public string Value { get; set; } + } +} diff --git a/Scripts/Services/Assistant/V1/Model/WebhookHeader.cs.meta b/Scripts/Services/Assistant/V1/Model/WebhookHeader.cs.meta new file mode 100644 index 000000000..e396b823a --- /dev/null +++ b/Scripts/Services/Assistant/V1/Model/WebhookHeader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d52c71e1aa0f43509e6e6d4eab84168 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Services/Assistant/V1/Model/Workspace.cs b/Scripts/Services/Assistant/V1/Model/Workspace.cs index 6560865ca..4b24df8b1 100644 --- a/Scripts/Services/Assistant/V1/Model/Workspace.cs +++ b/Scripts/Services/Assistant/V1/Model/Workspace.cs @@ -126,5 +126,10 @@ public class StatusValue /// [JsonProperty("counterexamples", NullValueHandling = NullValueHandling.Ignore)] public List Counterexamples { get; set; } + /// + /// Gets or Sets Webhooks + /// + [JsonProperty("webhooks", NullValueHandling = NullValueHandling.Ignore)] + public List Webhooks { get; set; } } } diff --git a/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettings.cs b/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettings.cs index d36d9ea8b..e5a8c0108 100644 --- a/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettings.cs +++ b/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettings.cs @@ -33,7 +33,7 @@ public class WorkspaceSystemSettings /// /// Workspace settings related to the disambiguation feature. /// - /// **Note:** This feature is available only to Premium users. + /// **Note:** This feature is available only to Plus and Premium users. /// [JsonProperty("disambiguation", NullValueHandling = NullValueHandling.Ignore)] public WorkspaceSystemSettingsDisambiguation Disambiguation { get; set; } @@ -42,5 +42,10 @@ public class WorkspaceSystemSettings /// [JsonProperty("human_agent_assist", NullValueHandling = NullValueHandling.Ignore)] public Dictionary HumanAgentAssist { get; set; } + /// + /// Workspace settings related to detection of irrelevant input. + /// + [JsonProperty("off_topic", NullValueHandling = NullValueHandling.Ignore)] + public WorkspaceSystemSettingsOffTopic OffTopic { get; set; } } } diff --git a/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsDisambiguation.cs b/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsDisambiguation.cs index 349afad80..ade0e159a 100644 --- a/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsDisambiguation.cs +++ b/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsDisambiguation.cs @@ -22,7 +22,7 @@ namespace IBM.Watson.Assistant.V1.Model /// /// Workspace settings related to the disambiguation feature. /// - /// **Note:** This feature is available only to Premium users. + /// **Note:** This feature is available only to Plus and Premium users. /// public class WorkspaceSystemSettingsDisambiguation { @@ -66,5 +66,21 @@ public class SensitivityValue /// [JsonProperty("enabled", NullValueHandling = NullValueHandling.Ignore)] public bool? Enabled { get; set; } + /// + /// Whether the order in which disambiguation suggestions are presented should be randomized (but still + /// influenced by relative confidence). + /// + [JsonProperty("randomize", NullValueHandling = NullValueHandling.Ignore)] + public bool? Randomize { get; set; } + /// + /// The maximum number of disambigation suggestions that can be included in a `suggestion` response. + /// + [JsonProperty("max_suggestions", NullValueHandling = NullValueHandling.Ignore)] + public long? MaxSuggestions { get; set; } + /// + /// For internal use only. + /// + [JsonProperty("suggestion_text_policy", NullValueHandling = NullValueHandling.Ignore)] + public string SuggestionTextPolicy { get; set; } } } diff --git a/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsOffTopic.cs b/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsOffTopic.cs new file mode 100644 index 000000000..7662657ed --- /dev/null +++ b/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsOffTopic.cs @@ -0,0 +1,33 @@ +/** +* Copyright 2018, 2019 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 Newtonsoft.Json; + +namespace IBM.Watson.Assistant.V1.Model +{ + /// + /// Workspace settings related to detection of irrelevant input. + /// + public class WorkspaceSystemSettingsOffTopic + { + /// + /// Whether enhanced irrelevance detection is enabled for the workspace. + /// + [JsonProperty("enabled", NullValueHandling = NullValueHandling.Ignore)] + public bool? Enabled { get; set; } + } +} diff --git a/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsOffTopic.cs.meta b/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsOffTopic.cs.meta new file mode 100644 index 000000000..1e8393a2f --- /dev/null +++ b/Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsOffTopic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1eb5170b2b17b47018a1f43ebd7795ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Services/Assistant/V2/AssistantService.cs b/Scripts/Services/Assistant/V2/AssistantService.cs index a5bc7fcf7..cc8fdfc25 100644 --- a/Scripts/Services/Assistant/V2/AssistantService.cs +++ b/Scripts/Services/Assistant/V2/AssistantService.cs @@ -92,7 +92,9 @@ public AssistantService(string versionDate, Authenticator authenticator) : base( /// Create a session. /// /// Create a new session. A session is used to send user input to a skill and receive responses. It also - /// maintains the state of the conversation. + /// maintains the state of the conversation. A session persists until it is deleted, or until it times out + /// because of inactivity. (For more information, see the + /// [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-settings). /// /// The callback function that is invoked when the operation completes. /// Unique identifier of the assistant. To find the assistant ID in the Watson @@ -165,7 +167,9 @@ private void OnCreateSessionResponse(RESTConnector.Request req, RESTConnector.Re /// /// Delete session. /// - /// Deletes a session explicitly before it times out. + /// Deletes a session explicitly before it times out. (For more information about the session inactivity + /// timeout, see the + /// [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-settings)). /// /// The callback function that is invoked when the operation completes. /// Unique identifier of the assistant. To find the assistant ID in the Watson diff --git a/Scripts/Services/Assistant/V2/Model/DialogSuggestion.cs b/Scripts/Services/Assistant/V2/Model/DialogSuggestion.cs index bf5cb1d90..918bd79ab 100644 --- a/Scripts/Services/Assistant/V2/Model/DialogSuggestion.cs +++ b/Scripts/Services/Assistant/V2/Model/DialogSuggestion.cs @@ -26,8 +26,8 @@ namespace IBM.Watson.Assistant.V2.Model public class DialogSuggestion { /// - /// The user-facing label for the disambiguation option. This label is taken from the **user_label** property of - /// the corresponding dialog node. + /// The user-facing label for the disambiguation option. This label is taken from the **title** or + /// **user_label** property of the corresponding dialog node, depending on the disambiguation options. /// [JsonProperty("label", NullValueHandling = NullValueHandling.Ignore)] public string Label { get; set; } diff --git a/Scripts/Services/Discovery/V1/DiscoveryService.cs b/Scripts/Services/Discovery/V1/DiscoveryService.cs index f8189832c..a4b7a8ad3 100644 --- a/Scripts/Services/Discovery/V1/DiscoveryService.cs +++ b/Scripts/Services/Discovery/V1/DiscoveryService.cs @@ -1192,12 +1192,12 @@ private void OnGetCollectionResponse(RESTConnector.Request req, RESTConnector.Re /// The callback function that is invoked when the operation completes. /// The ID of the environment. /// The ID of the collection. - /// The name of the collection. (optional, default to ) + /// The name of the collection. /// A description of the collection. (optional, default to ) /// The ID of the configuration in which the collection is to be updated. /// (optional, default to ) /// Collection - public bool UpdateCollection(Callback callback, string environmentId, string collectionId, string name = null, string description = null, string configurationId = null) + public bool UpdateCollection(Callback callback, string environmentId, string collectionId, string name, string description = null, string configurationId = null) { if (callback == null) throw new ArgumentNullException("`callback` is required for `UpdateCollection`"); @@ -2127,7 +2127,7 @@ private void OnDeleteStopwordListResponse(RESTConnector.Request req, RESTConnect /// The ID of the environment. /// The ID of the collection. /// The content of the document to ingest. The maximum supported file size when adding a file - /// to a collection is 50 megabytes, the maximum supported file size when testing a confiruration is 1 megabyte. + /// to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. /// Files larger than the supported size are rejected. (optional) /// The filename for file. (optional) /// The content type of file. (optional) @@ -2298,7 +2298,7 @@ private void OnGetDocumentStatusResponse(RESTConnector.Request req, RESTConnecto /// The ID of the collection. /// The ID of the document. /// The content of the document to ingest. The maximum supported file size when adding a file - /// to a collection is 50 megabytes, the maximum supported file size when testing a confiruration is 1 megabyte. + /// to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. /// Files larger than the supported size are rejected. (optional) /// The filename for file. (optional) /// The content type of file. (optional) @@ -2832,8 +2832,7 @@ private void OnQueryNoticesResponse(RESTConnector.Request req, RESTConnector.Res /// /// The callback function that is invoked when the operation completes. /// The ID of the environment. - /// A comma-separated list of collection IDs to be queried against. - /// (optional) + /// A comma-separated list of collection IDs to be queried against. /// A cacheable query that excludes documents that don't mention the query content. Filter /// searches are better for metadata-type searches and for assessing the concepts in the data set. /// (optional) @@ -2889,7 +2888,7 @@ private void OnQueryNoticesResponse(RESTConnector.Request req, RESTConnector.Res /// If `true`, queries are not stored in the Discovery **Logs** endpoint. /// (optional, default to false) /// QueryResponse - public bool FederatedQuery(Callback callback, string environmentId, string collectionIds = null, string filter = null, string query = null, string naturalLanguageQuery = null, bool? passages = null, string aggregation = null, long? count = null, string _return = null, long? offset = null, string sort = null, bool? highlight = null, string passagesFields = null, long? passagesCount = null, long? passagesCharacters = null, bool? deduplicate = null, string deduplicateField = null, bool? similar = null, string similarDocumentIds = null, string similarFields = null, string bias = null, bool? xWatsonLoggingOptOut = null) + public bool FederatedQuery(Callback callback, string environmentId, string collectionIds, string filter = null, string query = null, string naturalLanguageQuery = null, bool? passages = null, string aggregation = null, long? count = null, string _return = null, long? offset = null, string sort = null, bool? highlight = null, string passagesFields = null, long? passagesCount = null, long? passagesCharacters = null, bool? deduplicate = null, string deduplicateField = null, bool? similar = null, string similarDocumentIds = null, string similarFields = null, string bias = null, bool? xWatsonLoggingOptOut = null) { if (callback == null) throw new ArgumentNullException("`callback` is required for `FederatedQuery`"); diff --git a/Scripts/Services/Discovery/V1/Model/QueryNoticesResult.cs b/Scripts/Services/Discovery/V1/Model/QueryNoticesResult.cs index bdf781190..bf0f1a604 100644 --- a/Scripts/Services/Discovery/V1/Model/QueryNoticesResult.cs +++ b/Scripts/Services/Discovery/V1/Model/QueryNoticesResult.cs @@ -77,11 +77,6 @@ public class FileTypeValue [JsonProperty("result_metadata", NullValueHandling = NullValueHandling.Ignore)] public QueryResultMetadata ResultMetadata { get; set; } /// - /// Automatically extracted result title. - /// - [JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)] - public string Title { get; set; } - /// /// The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the /// source document. /// diff --git a/Scripts/Services/Discovery/V1/Model/QueryResult.cs b/Scripts/Services/Discovery/V1/Model/QueryResult.cs index 3da2e92be..e3a0d68bc 100644 --- a/Scripts/Services/Discovery/V1/Model/QueryResult.cs +++ b/Scripts/Services/Discovery/V1/Model/QueryResult.cs @@ -46,10 +46,5 @@ public class QueryResult: DynamicModel /// [JsonProperty("result_metadata", NullValueHandling = NullValueHandling.Ignore)] public QueryResultMetadata ResultMetadata { get; set; } - /// - /// Automatically extracted result title. - /// - [JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)] - public string Title { get; set; } } } diff --git a/Scripts/Services/Discovery/V2.meta b/Scripts/Services/Discovery/V2.meta new file mode 100644 index 000000000..99366fc92 --- /dev/null +++ b/Scripts/Services/Discovery/V2.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bdb943723385c4472bfb8ac24b2573df +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Services/SpeechToText/V1/SpeechToTextService.cs b/Scripts/Services/SpeechToText/V1/SpeechToTextService.cs index 7fae9dbe6..80ee2d2f7 100644 --- a/Scripts/Services/SpeechToText/V1/SpeechToTextService.cs +++ b/Scripts/Services/SpeechToText/V1/SpeechToTextService.cs @@ -34,6 +34,8 @@ public partial class SpeechToTextService : BaseService private const string serviceId = "speech_to_text"; private const string defaultServiceUrl = "https://stream.watsonplatform.net/speech-to-text/api"; + #region VersionDate + #endregion #region DisableSslVerification private bool disableSslVerification = false; @@ -50,16 +52,17 @@ public bool DisableSslVerification /// /// SpeechToTextService constructor. /// + public SpeechToTextService() : this(ConfigBasedAuthenticatorFactory.GetAuthenticator(serviceId)) {} /// /// SpeechToTextService constructor. /// + /// The service authenticator. public SpeechToTextService(Authenticator authenticator) : base(authenticator, serviceId) { Authenticator = authenticator; - if (string.IsNullOrEmpty(GetServiceUrl())) { SetServiceUrl(defaultServiceUrl); @@ -1414,6 +1417,10 @@ private void OnDeleteJobResponse(RESTConnector.Request req, RESTConnector.Respon /// with the base model for which it is created. The model is owned by the instance of the service whose /// credentials are used to create it. /// + /// You can create a maximum of 1024 custom language models, per credential. The service returns an error if you + /// attempt to create more than 1024 models. You do not lose any models, but you cannot create any more until + /// your model count is below the limit. + /// /// **See also:** [Create a custom language /// model](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-languageCreate#createModel-language). /// @@ -3297,6 +3304,10 @@ private void OnDeleteGrammarResponse(RESTConnector.Request req, RESTConnector.Re /// with the base model for which it is created. The model is owned by the instance of the service whose /// credentials are used to create it. /// + /// You can create a maximum of 1024 custom acoustic models, per credential. The service returns an error if you + /// attempt to create more than 1024 models. You do not lose any models, but you cannot create any more until + /// your model count is below the limit. + /// /// **See also:** [Create a custom acoustic /// model](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-acoustic#createModel-acoustic). /// diff --git a/Tests/AssistantV1IntegrationTests.cs b/Tests/AssistantV1IntegrationTests.cs index 1ad73531e..367b3454f 100644 --- a/Tests/AssistantV1IntegrationTests.cs +++ b/Tests/AssistantV1IntegrationTests.cs @@ -265,6 +265,21 @@ public IEnumerator TestCreateWorkspace() { Log.Debug("AssistantServiceV1IntegrationTests", "Attempting to CreateWorkspace..."); Workspace createWorkspaceResponse = null; + var webhooks = new List() + { + new Webhook() + { + Url = "http://www.cloud.ibm.com", + Name = "IBM Cloud", + Headers = new List() + { + new WebhookHeader(){ + Name = "testWebhookHeaderName", + Value = "testWebhookHeaderValue" + } + } + } + }; service.CreateWorkspace( callback: (DetailedResponse response, IBMError error) => { @@ -281,7 +296,8 @@ public IEnumerator TestCreateWorkspace() name: createdWorkspaceName, description: createdWorkspaceDescription, language: createdWorkspaceLanguage, - learningOptOut: true + learningOptOut: true, + webhooks: webhooks ); while (createWorkspaceResponse == null) diff --git a/Tests/VisualRecognitionV4IntegrationTests.cs b/Tests/VisualRecognitionV4IntegrationTests.cs index a9f46f619..2e90f175c 100644 --- a/Tests/VisualRecognitionV4IntegrationTests.cs +++ b/Tests/VisualRecognitionV4IntegrationTests.cs @@ -428,6 +428,31 @@ public IEnumerator TestTrain() while (collection == null) yield return null; } + + [UnityTest, Order(12)] + public IEnumerator TestGetTrainingUsage() + { + Log.Debug("VisualRecognitionServiceV4IntegrationTests", "Attempting to Train..."); + var startTime = "2019-11-18"; + var endTime = "2019-11-20"; + TrainingEvents trainingEvents = null; + service.GetTrainingUsage( + callback: (DetailedResponse response, IBMError error) => + { + Log.Debug("VisualRecognitionServiceV4IntegrationTests", "GetTrainingUsage result: {0}", response.Response); + trainingEvents = response.Result; + Assert.IsNotNull(trainingEvents); + Assert.IsNotNull(trainingEvents.Events); + Assert.IsTrue(trainingEvents.Events.Count > 0); + Assert.IsNull(error); + }, + startTime: startTime, + endTime: endTime + ); + + while (trainingEvents == null) + yield return null; + } #endregion } }