|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -# (C) Copyright IBM Corp. 2019. |
| 3 | +# (C) Copyright IBM Corp. 2020. |
4 | 4 | # |
5 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
6 | 6 | # you may not use this file except in compliance with the License. |
@@ -387,14 +387,14 @@ def get_component_settings(project_id:) |
387 | 387 | # **_/v2/projects/{project_id}/collections/{collection_id}/documents** method. |
388 | 388 | # |
389 | 389 | # **Note:** This operation only works on collections created to accept direct file |
390 | | - # uploads. It cannot be used to modify a collection that conects to an external |
| 390 | + # uploads. It cannot be used to modify a collection that connects to an external |
391 | 391 | # source such as Microsoft SharePoint. |
392 | 392 | # @param project_id [String] The ID of the project. This information can be found from the deploy page of the |
393 | 393 | # Discovery administrative tooling. |
394 | 394 | # @param collection_id [String] The ID of the collection. |
395 | 395 | # @param file [File] The content of the document to ingest. The maximum supported file size when adding |
396 | 396 | # a file to a collection is 50 megabytes, the maximum supported file size when |
397 | | - # testing a confiruration is 1 megabyte. Files larger than the supported size are |
| 397 | + # testing a configuration is 1 megabyte. Files larger than the supported size are |
398 | 398 | # rejected. |
399 | 399 | # @param filename [String] The filename for file. |
400 | 400 | # @param file_content_type [String] The content type of file. |
@@ -459,15 +459,15 @@ def add_document(project_id:, collection_id:, file: nil, filename: nil, file_con |
459 | 459 | # any document stored with the same **document_id** if it exists. |
460 | 460 | # |
461 | 461 | # **Note:** This operation only works on collections created to accept direct file |
462 | | - # uploads. It cannot be used to modify a collection that conects to an external |
| 462 | + # uploads. It cannot be used to modify a collection that connects to an external |
463 | 463 | # source such as Microsoft SharePoint. |
464 | 464 | # @param project_id [String] The ID of the project. This information can be found from the deploy page of the |
465 | 465 | # Discovery administrative tooling. |
466 | 466 | # @param collection_id [String] The ID of the collection. |
467 | 467 | # @param document_id [String] The ID of the document. |
468 | 468 | # @param file [File] The content of the document to ingest. The maximum supported file size when adding |
469 | 469 | # a file to a collection is 50 megabytes, the maximum supported file size when |
470 | | - # testing a confiruration is 1 megabyte. Files larger than the supported size are |
| 470 | + # testing a configuration is 1 megabyte. Files larger than the supported size are |
471 | 471 | # rejected. |
472 | 472 | # @param filename [String] The filename for file. |
473 | 473 | # @param file_content_type [String] The content type of file. |
@@ -529,7 +529,7 @@ def update_document(project_id:, collection_id:, document_id:, file: nil, filena |
529 | 529 | # 'deleted'. |
530 | 530 | # |
531 | 531 | # **Note:** This operation only works on collections created to accept direct file |
532 | | - # uploads. It cannot be used to modify a collection that conects to an external |
| 532 | + # uploads. It cannot be used to modify a collection that connects to an external |
533 | 533 | # source such as Microsoft SharePoint. |
534 | 534 | # @param project_id [String] The ID of the project. This information can be found from the deploy page of the |
535 | 535 | # Discovery administrative tooling. |
@@ -647,6 +647,10 @@ def delete_training_queries(project_id:) |
647 | 647 | def create_training_query(project_id:, natural_language_query:, examples:, filter: nil) |
648 | 648 | raise ArgumentError.new("project_id must be provided") if project_id.nil? |
649 | 649 |
|
| 650 | + raise ArgumentError.new("natural_language_query must be provided") if natural_language_query.nil? |
| 651 | + |
| 652 | + raise ArgumentError.new("examples must be provided") if examples.nil? |
| 653 | + |
650 | 654 | headers = { |
651 | 655 | } |
652 | 656 | sdk_headers = Common.new.get_sdk_headers("discovery", "V2", "create_training_query") |
|
0 commit comments