ibm_watson 2.0.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -29
- data/lib/ibm_watson/assistant_v1.rb +114 -79
- data/lib/ibm_watson/assistant_v2.rb +83 -59
- data/lib/ibm_watson/compare_comply_v1.rb +11 -4
- data/lib/ibm_watson/discovery_v1.rb +5 -12
- data/lib/ibm_watson/discovery_v2.rb +201 -110
- data/lib/ibm_watson/language_translator_v3.rb +1 -2
- data/lib/ibm_watson/natural_language_classifier_v1.rb +14 -6
- data/lib/ibm_watson/natural_language_understanding_v1.rb +690 -3
- data/lib/ibm_watson/personality_insights_v3.rb +13 -11
- data/lib/ibm_watson/speech_to_text_v1.rb +582 -333
- data/lib/ibm_watson/text_to_speech_v1.rb +617 -35
- data/lib/ibm_watson/tone_analyzer_v3.rb +1 -2
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +1 -2
- data/lib/ibm_watson/visual_recognition_v4.rb +11 -8
- data/test/integration/test_discovery_v2.rb +15 -0
- data/test/integration/test_natural_language_understanding_v1.rb +134 -1
- data/test/integration/test_text_to_speech_v1.rb +57 -0
- data/test/unit/test_discovery_v2.rb +29 -0
- data/test/unit/test_natural_language_understanding_v1.rb +231 -0
- data/test/unit/test_text_to_speech_v1.rb +145 -0
- metadata +3 -3
@@ -14,10 +14,18 @@
|
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
|
-
# IBM OpenAPI SDK Code Generator Version: 3.
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.38.0-07189efd-20210827-205025
|
18
18
|
#
|
19
|
-
# IBM Watson™ Compare and Comply
|
20
|
-
#
|
19
|
+
# IBM Watson™ Compare and Comply is discontinued. Existing instances are supported
|
20
|
+
# until 30 November 2021, but as of 1 December 2020, you can't create instances. Any
|
21
|
+
# instance that exists on 30 November 2021 will be deleted. Consider migrating to Watson
|
22
|
+
# Discovery Premium on IBM Cloud for your Compare and Comply use cases. To start the
|
23
|
+
# migration process, visit
|
24
|
+
# [https://ibm.biz/contact-wdc-premium](https://ibm.biz/contact-wdc-premium).
|
25
|
+
# {: deprecated}
|
26
|
+
#
|
27
|
+
# Compare and Comply analyzes governing documents to provide details about critical
|
28
|
+
# aspects of the documents.
|
21
29
|
|
22
30
|
require "concurrent"
|
23
31
|
require "erb"
|
@@ -25,7 +33,6 @@ require "json"
|
|
25
33
|
require "ibm_cloud_sdk_core"
|
26
34
|
require_relative "./common.rb"
|
27
35
|
|
28
|
-
# Module for the Watson APIs
|
29
36
|
module IBMWatson
|
30
37
|
##
|
31
38
|
# The Compare Comply V1 service.
|
@@ -14,7 +14,7 @@
|
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
|
-
# IBM OpenAPI SDK Code Generator Version: 3.
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.38.0-07189efd-20210827-205025
|
18
18
|
#
|
19
19
|
# IBM Watson™ Discovery is a cognitive search and content analytics engine that
|
20
20
|
# you can add to applications to identify patterns, trends and actionable insights to
|
@@ -28,7 +28,6 @@ require "json"
|
|
28
28
|
require "ibm_cloud_sdk_core"
|
29
29
|
require_relative "./common.rb"
|
30
30
|
|
31
|
-
# Module for the Watson APIs
|
32
31
|
module IBMWatson
|
33
32
|
##
|
34
33
|
# The Discovery V1 service.
|
@@ -1430,7 +1429,7 @@ module IBMWatson
|
|
1430
1429
|
# parameter.
|
1431
1430
|
# @param spelling_suggestions [Boolean] When `true` and the **natural_language_query** parameter is used, the
|
1432
1431
|
# **natural_languge_query** parameter is spell checked. The most likely correction
|
1433
|
-
# is
|
1432
|
+
# is returned in the **suggested_query** field of the response (if one exists).
|
1434
1433
|
#
|
1435
1434
|
# **Important:** this parameter is only valid when using the Cloud Pak version of
|
1436
1435
|
# Discovery.
|
@@ -1810,7 +1809,7 @@ module IBMWatson
|
|
1810
1809
|
# @param environment_id [String] The ID of the environment.
|
1811
1810
|
# @param collection_id [String] The ID of the collection.
|
1812
1811
|
# @param prefix [String] The prefix to use for autocompletion. For example, the prefix `Ho` could
|
1813
|
-
# autocomplete to `
|
1812
|
+
# autocomplete to `hot`, `housing`, or `how`.
|
1814
1813
|
# @param field [String] The field in the result documents that autocompletion suggestions are identified
|
1815
1814
|
# from.
|
1816
1815
|
# @param count [Fixnum] The number of autocompletion suggestions to return.
|
@@ -2650,10 +2649,7 @@ module IBMWatson
|
|
2650
2649
|
# @param credential_details [CredentialDetails] Object containing details of the stored credentials.
|
2651
2650
|
#
|
2652
2651
|
# Obtain credentials for your source from the administrator of the source.
|
2653
|
-
# @param status [
|
2654
|
-
# credentials are available to use with the source configuration of a collection.
|
2655
|
-
# `invalid` refers to the credentials (for example, the password provided has
|
2656
|
-
# expired) and must be corrected before they can be used with a collection.
|
2652
|
+
# @param status [StatusDetails] Object that contains details about the status of the authentication process.
|
2657
2653
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2658
2654
|
def create_credentials(environment_id:, source_type: nil, credential_details: nil, status: nil)
|
2659
2655
|
raise ArgumentError.new("version must be provided") if version.nil?
|
@@ -2747,10 +2743,7 @@ module IBMWatson
|
|
2747
2743
|
# @param credential_details [CredentialDetails] Object containing details of the stored credentials.
|
2748
2744
|
#
|
2749
2745
|
# Obtain credentials for your source from the administrator of the source.
|
2750
|
-
# @param status [
|
2751
|
-
# credentials are available to use with the source configuration of a collection.
|
2752
|
-
# `invalid` refers to the credentials (for example, the password provided has
|
2753
|
-
# expired) and must be corrected before they can be used with a collection.
|
2746
|
+
# @param status [StatusDetails] Object that contains details about the status of the authentication process.
|
2754
2747
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2755
2748
|
def update_credentials(environment_id:, credential_id:, source_type: nil, credential_details: nil, status: nil)
|
2756
2749
|
raise ArgumentError.new("version must be provided") if version.nil?
|
@@ -14,7 +14,7 @@
|
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
|
-
# IBM OpenAPI SDK Code Generator Version: 3.
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.38.0-07189efd-20210827-205025
|
18
18
|
#
|
19
19
|
# IBM Watson™ Discovery is a cognitive search and content analytics engine that
|
20
20
|
# you can add to applications to identify patterns, trends and actionable insights to
|
@@ -28,7 +28,6 @@ require "json"
|
|
28
28
|
require "ibm_cloud_sdk_core"
|
29
29
|
require_relative "./common.rb"
|
30
30
|
|
31
|
-
# Module for the Watson APIs
|
32
31
|
module IBMWatson
|
33
32
|
##
|
34
33
|
# The Discovery V2 service.
|
@@ -43,7 +42,7 @@ module IBMWatson
|
|
43
42
|
#
|
44
43
|
# @param args [Hash] The args to initialize with
|
45
44
|
# @option args version [String] Release date of the version of the API you want to use. Specify dates in
|
46
|
-
# YYYY-MM-DD format. The current version is `
|
45
|
+
# YYYY-MM-DD format. The current version is `2020-08-30`.
|
47
46
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
48
47
|
# The base service_url may differ between IBM Cloud regions.
|
49
48
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
@@ -74,8 +73,8 @@ module IBMWatson
|
|
74
73
|
# @!method list_collections(project_id:)
|
75
74
|
# List collections.
|
76
75
|
# Lists existing collections for the specified project.
|
77
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
78
|
-
#
|
76
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
77
|
+
# Deploy* page in Discovery.
|
79
78
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
80
79
|
def list_collections(project_id:)
|
81
80
|
raise ArgumentError.new("project_id must be provided") if project_id.nil?
|
@@ -107,8 +106,8 @@ module IBMWatson
|
|
107
106
|
# @!method create_collection(project_id:, name:, description: nil, language: nil, enrichments: nil)
|
108
107
|
# Create a collection.
|
109
108
|
# Create a new collection in the specified project.
|
110
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
111
|
-
#
|
109
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
110
|
+
# Deploy* page in Discovery.
|
112
111
|
# @param name [String] The name of the collection.
|
113
112
|
# @param description [String] A description of the collection.
|
114
113
|
# @param language [String] The language of the collection.
|
@@ -154,8 +153,8 @@ module IBMWatson
|
|
154
153
|
# @!method get_collection(project_id:, collection_id:)
|
155
154
|
# Get collection.
|
156
155
|
# Get details about the specified collection.
|
157
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
158
|
-
#
|
156
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
157
|
+
# Deploy* page in Discovery.
|
159
158
|
# @param collection_id [String] The ID of the collection.
|
160
159
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
161
160
|
def get_collection(project_id:, collection_id:)
|
@@ -190,8 +189,8 @@ module IBMWatson
|
|
190
189
|
# @!method update_collection(project_id:, collection_id:, name: nil, description: nil, enrichments: nil)
|
191
190
|
# Update a collection.
|
192
191
|
# Updates the specified collection's name, description, and enrichments.
|
193
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
194
|
-
#
|
192
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
193
|
+
# Deploy* page in Discovery.
|
195
194
|
# @param collection_id [String] The ID of the collection.
|
196
195
|
# @param name [String] The name of the collection.
|
197
196
|
# @param description [String] A description of the collection.
|
@@ -237,8 +236,8 @@ module IBMWatson
|
|
237
236
|
# Delete a collection.
|
238
237
|
# Deletes the specified collection from the project. All documents stored in the
|
239
238
|
# specified collection and not shared is also deleted.
|
240
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
241
|
-
#
|
239
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
240
|
+
# Deploy* page in Discovery.
|
242
241
|
# @param collection_id [String] The ID of the collection.
|
243
242
|
# @return [nil]
|
244
243
|
def delete_collection(project_id:, collection_id:)
|
@@ -283,8 +282,8 @@ module IBMWatson
|
|
283
282
|
# for an overview of the standard default settings, and see [the Projects API
|
284
283
|
# documentation](#create-project) for details about how to set custom default query
|
285
284
|
# settings.
|
286
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
287
|
-
#
|
285
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
286
|
+
# Deploy* page in Discovery.
|
288
287
|
# @param collection_ids [Array[String]] A comma-separated list of collection IDs to be queried against.
|
289
288
|
# @param filter [String] A cacheable query that excludes documents that don't mention the query content.
|
290
289
|
# Filter searches are better for metadata-type searches and for assessing the
|
@@ -298,15 +297,14 @@ module IBMWatson
|
|
298
297
|
# filters. Useful for applications to build lists, tables, and time series. For a
|
299
298
|
# full list of possible aggregations, see the Query reference.
|
300
299
|
# @param count [Fixnum] Number of results to return.
|
301
|
-
# @param _return [Array[String]] A list of the fields in the document hierarchy to return. If this parameter
|
302
|
-
#
|
300
|
+
# @param _return [Array[String]] A list of the fields in the document hierarchy to return. If this parameter is an
|
301
|
+
# empty list, then all fields are returned.
|
303
302
|
# @param offset [Fixnum] The number of query results to skip at the beginning. For example, if the total
|
304
303
|
# number of results that are returned is 10 and the offset is 8, it returns the last
|
305
304
|
# two results.
|
306
305
|
# @param sort [String] A comma-separated list of fields in the document to sort on. You can optionally
|
307
306
|
# specify a sort direction by prefixing the field with `-` for descending or `+` for
|
308
|
-
# ascending. Ascending is the default sort direction if no prefix is specified.
|
309
|
-
# parameter cannot be used in the same query as the **bias** parameter.
|
307
|
+
# ascending. Ascending is the default sort direction if no prefix is specified.
|
310
308
|
# @param highlight [Boolean] When `true`, a highlight field is returned for each result which contains the
|
311
309
|
# fields which match the query with `<em></em>` tags around the matching query
|
312
310
|
# terms.
|
@@ -314,7 +312,7 @@ module IBMWatson
|
|
314
312
|
# **natural_language_query** parameter is spell checked. The most likely correction
|
315
313
|
# is returned in the **suggested_query** field of the response (if one exists).
|
316
314
|
# @param table_results [QueryLargeTableResults] Configuration for table retrieval.
|
317
|
-
# @param suggested_refinements [QueryLargeSuggestedRefinements] Configuration for suggested refinements.
|
315
|
+
# @param suggested_refinements [QueryLargeSuggestedRefinements] Configuration for suggested refinements. Available with Premium plans only.
|
318
316
|
# @param passages [QueryLargePassages] Configuration for passage retrieval.
|
319
317
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
320
318
|
def query(project_id:, collection_ids: nil, filter: nil, query: nil, natural_language_query: nil, aggregation: nil, count: nil, _return: nil, offset: nil, sort: nil, highlight: nil, spelling_suggestions: nil, table_results: nil, suggested_refinements: nil, passages: nil)
|
@@ -365,10 +363,10 @@ module IBMWatson
|
|
365
363
|
# @!method get_autocompletion(project_id:, prefix:, collection_ids: nil, field: nil, count: nil)
|
366
364
|
# Get Autocomplete Suggestions.
|
367
365
|
# Returns completion query suggestions for the specified prefix.
|
368
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
369
|
-
#
|
366
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
367
|
+
# Deploy* page in Discovery.
|
370
368
|
# @param prefix [String] The prefix to use for autocompletion. For example, the prefix `Ho` could
|
371
|
-
# autocomplete to `
|
369
|
+
# autocomplete to `hot`, `housing`, or `how`.
|
372
370
|
# @param collection_ids [Array[String]] Comma separated list of the collection IDs. If this parameter is not specified,
|
373
371
|
# all collections in the project are used.
|
374
372
|
# @param field [String] The field in the result documents that autocompletion suggestions are identified
|
@@ -408,14 +406,68 @@ module IBMWatson
|
|
408
406
|
response
|
409
407
|
end
|
410
408
|
|
409
|
+
##
|
410
|
+
# @!method query_collection_notices(project_id:, collection_id:, filter: nil, query: nil, natural_language_query: nil, count: nil, offset: nil)
|
411
|
+
# Query collection notices.
|
412
|
+
# Finds collection-level notices (errors and warnings) that are generated when
|
413
|
+
# documents are ingested.
|
414
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
415
|
+
# Deploy* page in Discovery.
|
416
|
+
# @param collection_id [String] The ID of the collection.
|
417
|
+
# @param filter [String] A cacheable query that excludes documents that don't mention the query content.
|
418
|
+
# Filter searches are better for metadata-type searches and for assessing the
|
419
|
+
# concepts in the data set.
|
420
|
+
# @param query [String] A query search returns all documents in your data set with full enrichments and
|
421
|
+
# full text, but with the most relevant documents listed first.
|
422
|
+
# @param natural_language_query [String] A natural language query that returns relevant documents by utilizing training
|
423
|
+
# data and natural language understanding.
|
424
|
+
# @param count [Fixnum] Number of results to return. The maximum for the **count** and **offset** values
|
425
|
+
# together in any one query is **10000**.
|
426
|
+
# @param offset [Fixnum] The number of query results to skip at the beginning. For example, if the total
|
427
|
+
# number of results that are returned is 10 and the offset is 8, it returns the last
|
428
|
+
# two results. The maximum for the **count** and **offset** values together in any
|
429
|
+
# one query is **10000**.
|
430
|
+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
431
|
+
def query_collection_notices(project_id:, collection_id:, filter: nil, query: nil, natural_language_query: nil, count: nil, offset: nil)
|
432
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
433
|
+
|
434
|
+
raise ArgumentError.new("project_id must be provided") if project_id.nil?
|
435
|
+
|
436
|
+
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
437
|
+
|
438
|
+
headers = {
|
439
|
+
}
|
440
|
+
sdk_headers = Common.new.get_sdk_headers("discovery", "V2", "query_collection_notices")
|
441
|
+
headers.merge!(sdk_headers)
|
442
|
+
|
443
|
+
params = {
|
444
|
+
"version" => @version,
|
445
|
+
"filter" => filter,
|
446
|
+
"query" => query,
|
447
|
+
"natural_language_query" => natural_language_query,
|
448
|
+
"count" => count,
|
449
|
+
"offset" => offset
|
450
|
+
}
|
451
|
+
|
452
|
+
method_url = "/v2/projects/%s/collections/%s/notices" % [ERB::Util.url_encode(project_id), ERB::Util.url_encode(collection_id)]
|
453
|
+
|
454
|
+
response = request(
|
455
|
+
method: "GET",
|
456
|
+
url: method_url,
|
457
|
+
headers: headers,
|
458
|
+
params: params,
|
459
|
+
accept_json: true
|
460
|
+
)
|
461
|
+
response
|
462
|
+
end
|
463
|
+
|
411
464
|
##
|
412
465
|
# @!method query_notices(project_id:, filter: nil, query: nil, natural_language_query: nil, count: nil, offset: nil)
|
413
|
-
# Query
|
414
|
-
#
|
415
|
-
#
|
416
|
-
#
|
417
|
-
#
|
418
|
-
# Discovery administrative tooling.
|
466
|
+
# Query project notices.
|
467
|
+
# Finds project-level notices (errors and warnings). Currently, project-level
|
468
|
+
# notices are generated by relevancy training.
|
469
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
470
|
+
# Deploy* page in Discovery.
|
419
471
|
# @param filter [String] A cacheable query that excludes documents that don't mention the query content.
|
420
472
|
# Filter searches are better for metadata-type searches and for assessing the
|
421
473
|
# concepts in the data set.
|
@@ -466,8 +518,8 @@ module IBMWatson
|
|
466
518
|
# List fields.
|
467
519
|
# Gets a list of the unique fields (and their types) stored in the the specified
|
468
520
|
# collections.
|
469
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
470
|
-
#
|
521
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
522
|
+
# Deploy* page in Discovery.
|
471
523
|
# @param collection_ids [Array[String]] Comma separated list of the collection IDs. If this parameter is not specified,
|
472
524
|
# all collections in the project are used.
|
473
525
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
@@ -506,8 +558,8 @@ module IBMWatson
|
|
506
558
|
# @!method get_component_settings(project_id:)
|
507
559
|
# List component settings.
|
508
560
|
# Returns default configuration settings for components.
|
509
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
510
|
-
#
|
561
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
562
|
+
# Deploy* page in Discovery.
|
511
563
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
512
564
|
def get_component_settings(project_id:)
|
513
565
|
raise ArgumentError.new("project_id must be provided") if project_id.nil?
|
@@ -543,44 +595,42 @@ module IBMWatson
|
|
543
595
|
# Add a document.
|
544
596
|
# Add a document to a collection with optional metadata.
|
545
597
|
#
|
546
|
-
#
|
598
|
+
# Returns immediately after the system has accepted the document for processing.
|
547
599
|
#
|
548
600
|
# * The user must provide document content, metadata, or both. If the request is
|
549
601
|
# missing both document content and metadata, it is rejected.
|
550
602
|
#
|
551
|
-
# *
|
552
|
-
#
|
553
|
-
#
|
554
|
-
#
|
555
|
-
# document's media type.
|
603
|
+
# * You can set the **Content-Type** parameter on the **file** part to indicate
|
604
|
+
# the media type of the document. If the **Content-Type** parameter is missing or is
|
605
|
+
# one of the generic media types (for example, `application/octet-stream`), then the
|
606
|
+
# service attempts to automatically detect the document's media type.
|
556
607
|
#
|
557
|
-
# * The following field names are reserved and
|
558
|
-
#
|
559
|
-
#
|
608
|
+
# * The following field names are reserved and are filtered out if present after
|
609
|
+
# normalization: `id`, `score`, `highlight`, and any field with the prefix of: `_`,
|
610
|
+
# `+`, or `-`
|
560
611
|
#
|
561
612
|
# * Fields with empty name values after normalization are filtered out before
|
562
613
|
# indexing.
|
563
614
|
#
|
564
|
-
# * Fields
|
615
|
+
# * Fields that contain the following characters after normalization are filtered
|
565
616
|
# out before indexing: `#` and `,`
|
566
617
|
#
|
567
|
-
# If the document is uploaded to a collection that
|
568
|
-
#
|
569
|
-
#
|
618
|
+
# If the document is uploaded to a collection that shares its data with another
|
619
|
+
# collection, the **X-Watson-Discovery-Force** header must be set to `true`.
|
570
620
|
#
|
571
|
-
#
|
572
|
-
#
|
621
|
+
# **Note:** You can assign an ID to a document that you add by appending the ID to
|
622
|
+
# the endpoint
|
623
|
+
# (`/v2/projects/{project_id}/collections/{collection_id}/documents/{document_id}`).
|
624
|
+
# If a document already exists with the specified ID, it is replaced.
|
573
625
|
#
|
574
|
-
# **Note:** This operation
|
575
|
-
#
|
576
|
-
#
|
577
|
-
#
|
578
|
-
# Discovery administrative tooling.
|
626
|
+
# **Note:** This operation works with a file upload collection. It cannot be used to
|
627
|
+
# modify a collection that crawls an external data source.
|
628
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
629
|
+
# Deploy* page in Discovery.
|
579
630
|
# @param collection_id [String] The ID of the collection.
|
580
|
-
# @param file [File] The content of the document to ingest.
|
581
|
-
#
|
582
|
-
#
|
583
|
-
# rejected.
|
631
|
+
# @param file [File] The content of the document to ingest. For maximum supported file size limits, see
|
632
|
+
# [the
|
633
|
+
# documentation](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-collections#collections-doc-limits).
|
584
634
|
# @param filename [String] The filename for file.
|
585
635
|
# @param file_content_type [String] The content type of file.
|
586
636
|
# @param metadata [String] The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB
|
@@ -642,7 +692,7 @@ module IBMWatson
|
|
642
692
|
# Replace an existing document or add a document with a specified **document_id**.
|
643
693
|
# Starts ingesting a document with optional metadata.
|
644
694
|
#
|
645
|
-
# If the document is uploaded to a collection that
|
695
|
+
# If the document is uploaded to a collection that shares its data with another
|
646
696
|
# collection, the **X-Watson-Discovery-Force** header must be set to `true`.
|
647
697
|
#
|
648
698
|
# **Note:** When uploading a new document with this method it automatically replaces
|
@@ -652,16 +702,15 @@ module IBMWatson
|
|
652
702
|
# uploads. It cannot be used to modify a collection that connects to an external
|
653
703
|
# source such as Microsoft SharePoint.
|
654
704
|
#
|
655
|
-
# **Note:** If an uploaded document is segmented, all segments
|
656
|
-
#
|
657
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
658
|
-
#
|
705
|
+
# **Note:** If an uploaded document is segmented, all segments are overwritten, even
|
706
|
+
# if the updated version of the document has fewer segments.
|
707
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
708
|
+
# Deploy* page in Discovery.
|
659
709
|
# @param collection_id [String] The ID of the collection.
|
660
710
|
# @param document_id [String] The ID of the document.
|
661
|
-
# @param file [File] The content of the document to ingest.
|
662
|
-
#
|
663
|
-
#
|
664
|
-
# rejected.
|
711
|
+
# @param file [File] The content of the document to ingest. For maximum supported file size limits, see
|
712
|
+
# [the
|
713
|
+
# documentation](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-collections#collections-doc-limits).
|
665
714
|
# @param filename [String] The filename for file.
|
666
715
|
# @param file_content_type [String] The content type of file.
|
667
716
|
# @param metadata [String] The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB
|
@@ -732,8 +781,8 @@ module IBMWatson
|
|
732
781
|
#
|
733
782
|
# **Note:** Segments of an uploaded document cannot be deleted individually. Delete
|
734
783
|
# all segments by deleting using the `parent_document_id` of a segment result.
|
735
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
736
|
-
#
|
784
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
785
|
+
# Deploy* page in Discovery.
|
737
786
|
# @param collection_id [String] The ID of the collection.
|
738
787
|
# @param document_id [String] The ID of the document.
|
739
788
|
# @param x_watson_discovery_force [Boolean] When `true`, the uploaded document is added to the collection even if the data for
|
@@ -777,8 +826,8 @@ module IBMWatson
|
|
777
826
|
# @!method list_training_queries(project_id:)
|
778
827
|
# List training queries.
|
779
828
|
# List the training queries for the specified project.
|
780
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
781
|
-
#
|
829
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
830
|
+
# Deploy* page in Discovery.
|
782
831
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
783
832
|
def list_training_queries(project_id:)
|
784
833
|
raise ArgumentError.new("version must be provided") if version.nil?
|
@@ -810,8 +859,8 @@ module IBMWatson
|
|
810
859
|
# @!method delete_training_queries(project_id:)
|
811
860
|
# Delete training queries.
|
812
861
|
# Removes all training queries for the specified project.
|
813
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
814
|
-
#
|
862
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
863
|
+
# Deploy* page in Discovery.
|
815
864
|
# @return [nil]
|
816
865
|
def delete_training_queries(project_id:)
|
817
866
|
raise ArgumentError.new("version must be provided") if version.nil?
|
@@ -844,8 +893,8 @@ module IBMWatson
|
|
844
893
|
# Create training query.
|
845
894
|
# Add a query to the training data for this project. The query can contain a filter
|
846
895
|
# and natural language query.
|
847
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
848
|
-
#
|
896
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
897
|
+
# Deploy* page in Discovery.
|
849
898
|
# @param natural_language_query [String] The natural text query for the training query.
|
850
899
|
# @param examples [Array[TrainingExample]] Array of training examples.
|
851
900
|
# @param filter [String] The filter used on the collection before the **natural_language_query** is
|
@@ -893,8 +942,8 @@ module IBMWatson
|
|
893
942
|
# Get a training data query.
|
894
943
|
# Get details for a specific training data query, including the query string and all
|
895
944
|
# examples.
|
896
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
897
|
-
#
|
945
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
946
|
+
# Deploy* page in Discovery.
|
898
947
|
# @param query_id [String] The ID of the query used for training.
|
899
948
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
900
949
|
def get_training_query(project_id:, query_id:)
|
@@ -929,8 +978,8 @@ module IBMWatson
|
|
929
978
|
# @!method update_training_query(project_id:, query_id:, natural_language_query:, examples:, filter: nil)
|
930
979
|
# Update a training query.
|
931
980
|
# Updates an existing training query and it's examples.
|
932
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
933
|
-
#
|
981
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
982
|
+
# Deploy* page in Discovery.
|
934
983
|
# @param query_id [String] The ID of the query used for training.
|
935
984
|
# @param natural_language_query [String] The natural text query for the training query.
|
936
985
|
# @param examples [Array[TrainingExample]] Array of training examples.
|
@@ -975,6 +1024,43 @@ module IBMWatson
|
|
975
1024
|
)
|
976
1025
|
response
|
977
1026
|
end
|
1027
|
+
|
1028
|
+
##
|
1029
|
+
# @!method delete_training_query(project_id:, query_id:)
|
1030
|
+
# Delete a training data query.
|
1031
|
+
# Removes details from a training data query, including the query string and all
|
1032
|
+
# examples.
|
1033
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
1034
|
+
# Deploy* page in Discovery.
|
1035
|
+
# @param query_id [String] The ID of the query used for training.
|
1036
|
+
# @return [nil]
|
1037
|
+
def delete_training_query(project_id:, query_id:)
|
1038
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
1039
|
+
|
1040
|
+
raise ArgumentError.new("project_id must be provided") if project_id.nil?
|
1041
|
+
|
1042
|
+
raise ArgumentError.new("query_id must be provided") if query_id.nil?
|
1043
|
+
|
1044
|
+
headers = {
|
1045
|
+
}
|
1046
|
+
sdk_headers = Common.new.get_sdk_headers("discovery", "V2", "delete_training_query")
|
1047
|
+
headers.merge!(sdk_headers)
|
1048
|
+
|
1049
|
+
params = {
|
1050
|
+
"version" => @version
|
1051
|
+
}
|
1052
|
+
|
1053
|
+
method_url = "/v2/projects/%s/training_data/queries/%s" % [ERB::Util.url_encode(project_id), ERB::Util.url_encode(query_id)]
|
1054
|
+
|
1055
|
+
request(
|
1056
|
+
method: "DELETE",
|
1057
|
+
url: method_url,
|
1058
|
+
headers: headers,
|
1059
|
+
params: params,
|
1060
|
+
accept_json: false
|
1061
|
+
)
|
1062
|
+
nil
|
1063
|
+
end
|
978
1064
|
#########################
|
979
1065
|
# analyze
|
980
1066
|
#########################
|
@@ -982,21 +1068,18 @@ module IBMWatson
|
|
982
1068
|
##
|
983
1069
|
# @!method analyze_document(project_id:, collection_id:, file: nil, filename: nil, file_content_type: nil, metadata: nil)
|
984
1070
|
# Analyze a Document.
|
985
|
-
# Process a document
|
986
|
-
# realtime use.
|
1071
|
+
# Process a document and return it for realtime use. Supports JSON files only.
|
987
1072
|
#
|
988
|
-
#
|
989
|
-
# collection.
|
1073
|
+
# The document is processed according to the collection's configuration settings but
|
1074
|
+
# is not stored in the collection.
|
990
1075
|
#
|
991
|
-
# **Note:** This method is
|
992
|
-
#
|
993
|
-
#
|
994
|
-
# Discovery administrative tooling.
|
1076
|
+
# **Note:** This method is supported on installed instances of Discovery only.
|
1077
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
1078
|
+
# Deploy* page in Discovery.
|
995
1079
|
# @param collection_id [String] The ID of the collection.
|
996
|
-
# @param file [File] The content of the document to ingest.
|
997
|
-
#
|
998
|
-
#
|
999
|
-
# rejected.
|
1080
|
+
# @param file [File] The content of the document to ingest. For maximum supported file size limits, see
|
1081
|
+
# [the
|
1082
|
+
# documentation](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-collections#collections-doc-limits).
|
1000
1083
|
# @param filename [String] The filename for file.
|
1001
1084
|
# @param file_content_type [String] The content type of file.
|
1002
1085
|
# @param metadata [String] The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB
|
@@ -1055,9 +1138,11 @@ module IBMWatson
|
|
1055
1138
|
##
|
1056
1139
|
# @!method list_enrichments(project_id:)
|
1057
1140
|
# List Enrichments.
|
1058
|
-
#
|
1059
|
-
#
|
1060
|
-
#
|
1141
|
+
# Lists the enrichments available to this project. The *Part of Speech* and
|
1142
|
+
# *Sentiment of Phrases* enrichments might be listed, but are reserved for internal
|
1143
|
+
# use only.
|
1144
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
1145
|
+
# Deploy* page in Discovery.
|
1061
1146
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1062
1147
|
def list_enrichments(project_id:)
|
1063
1148
|
raise ArgumentError.new("version must be provided") if version.nil?
|
@@ -1088,10 +1173,10 @@ module IBMWatson
|
|
1088
1173
|
##
|
1089
1174
|
# @!method create_enrichment(project_id:, enrichment:, file: nil)
|
1090
1175
|
# Create an enrichment.
|
1091
|
-
# Create an enrichment for use with the specified project
|
1092
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
1093
|
-
#
|
1094
|
-
# @param enrichment [CreateEnrichment]
|
1176
|
+
# Create an enrichment for use with the specified project.
|
1177
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
1178
|
+
# Deploy* page in Discovery.
|
1179
|
+
# @param enrichment [CreateEnrichment] Information about a specific enrichment.
|
1095
1180
|
# @param file [File] The enrichment file to upload.
|
1096
1181
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1097
1182
|
def create_enrichment(project_id:, enrichment:, file: nil)
|
@@ -1138,8 +1223,8 @@ module IBMWatson
|
|
1138
1223
|
# @!method get_enrichment(project_id:, enrichment_id:)
|
1139
1224
|
# Get enrichment.
|
1140
1225
|
# Get details about a specific enrichment.
|
1141
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
1142
|
-
#
|
1226
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
1227
|
+
# Deploy* page in Discovery.
|
1143
1228
|
# @param enrichment_id [String] The ID of the enrichment.
|
1144
1229
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1145
1230
|
def get_enrichment(project_id:, enrichment_id:)
|
@@ -1174,8 +1259,8 @@ module IBMWatson
|
|
1174
1259
|
# @!method update_enrichment(project_id:, enrichment_id:, name:, description: nil)
|
1175
1260
|
# Update an enrichment.
|
1176
1261
|
# Updates an existing enrichment's name and description.
|
1177
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
1178
|
-
#
|
1262
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
1263
|
+
# Deploy* page in Discovery.
|
1179
1264
|
# @param enrichment_id [String] The ID of the enrichment.
|
1180
1265
|
# @param name [String] A new name for the enrichment.
|
1181
1266
|
# @param description [String] A new description for the enrichment.
|
@@ -1222,8 +1307,8 @@ module IBMWatson
|
|
1222
1307
|
# Deletes an existing enrichment from the specified project.
|
1223
1308
|
#
|
1224
1309
|
# **Note:** Only enrichments that have been manually created can be deleted.
|
1225
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
1226
|
-
#
|
1310
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
1311
|
+
# Deploy* page in Discovery.
|
1227
1312
|
# @param enrichment_id [String] The ID of the enrichment.
|
1228
1313
|
# @return [nil]
|
1229
1314
|
def delete_enrichment(project_id:, enrichment_id:)
|
@@ -1291,7 +1376,13 @@ module IBMWatson
|
|
1291
1376
|
# Create a Project.
|
1292
1377
|
# Create a new project for this instance.
|
1293
1378
|
# @param name [String] The human readable name of this project.
|
1294
|
-
# @param type [String] The
|
1379
|
+
# @param type [String] The type of project.
|
1380
|
+
#
|
1381
|
+
# The `content_intelligence` type is a *Document Retrieval for Contracts* project
|
1382
|
+
# and the `other` type is a *Custom* project.
|
1383
|
+
#
|
1384
|
+
# The `content_mining` and `content_intelligence` types are available with Premium
|
1385
|
+
# plan managed deployments and installed deployments only.
|
1295
1386
|
# @param default_query_parameters [DefaultQueryParams] Default query parameters for this project.
|
1296
1387
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1297
1388
|
def create_project(name:, type:, default_query_parameters: nil)
|
@@ -1333,8 +1424,8 @@ module IBMWatson
|
|
1333
1424
|
# @!method get_project(project_id:)
|
1334
1425
|
# Get project.
|
1335
1426
|
# Get details on the specified project.
|
1336
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
1337
|
-
#
|
1427
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
1428
|
+
# Deploy* page in Discovery.
|
1338
1429
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1339
1430
|
def get_project(project_id:)
|
1340
1431
|
raise ArgumentError.new("version must be provided") if version.nil?
|
@@ -1366,8 +1457,8 @@ module IBMWatson
|
|
1366
1457
|
# @!method update_project(project_id:, name: nil)
|
1367
1458
|
# Update a project.
|
1368
1459
|
# Update the specified project's name.
|
1369
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
1370
|
-
#
|
1460
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
1461
|
+
# Deploy* page in Discovery.
|
1371
1462
|
# @param name [String] The new name to give this project.
|
1372
1463
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1373
1464
|
def update_project(project_id:, name: nil)
|
@@ -1408,8 +1499,8 @@ module IBMWatson
|
|
1408
1499
|
#
|
1409
1500
|
# **Important:** Deleting a project deletes everything that is part of the specified
|
1410
1501
|
# project, including all collections.
|
1411
|
-
# @param project_id [String] The ID of the project. This information can be found from the
|
1412
|
-
#
|
1502
|
+
# @param project_id [String] The ID of the project. This information can be found from the *Integrate and
|
1503
|
+
# Deploy* page in Discovery.
|
1413
1504
|
# @return [nil]
|
1414
1505
|
def delete_project(project_id:)
|
1415
1506
|
raise ArgumentError.new("version must be provided") if version.nil?
|