Previously different parameters were passed into the service constructor for authentication.
def example
service = IBMWatson::AssistantV1.new(
iam_apikey: "{iam_apikey}",
url: "{service_endpoint}",
version: "{version_date}"
);
service.url = "{service_endpoint}";
endNow we use an Authenticator to authenticate the service. Available authentication schemes include IamAuthenticator, BasicAuthenticator, CloudPakForDataAuthenticator and BearerTokenAuthenticator
def example
authenticator = IBMWatson::Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
service = IBMWatson::AssistantV1.new(
authenticator: authenticator,
version: "{version_date}"
);
service.service_url = "{serviceUrl}";
enddef example
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
username: "{username}",
password: "{password}"
)
service = IBMWatson::AssistantV1.new(
authenticator: authenticator,
version: "{version_date}"
);
service.service_url = "{serviceUrl}";
end authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
bearer_token: "{bearerToken}"
)
service = IBMWatson::AssistantV1.new(
authenticator: authenticator,
version: "{version_date}"
);
service.service_url = "{serviceUrl}"; authenticator = IBMWatson::Authenticators::CloudPakForDataAuthenticator.new(
url: "https://{cp4d_cluster_host}{:port}",
username: "{username}",
password: "{password}"
)
service = IBMWatson::AssistantV1.new(
authenticator: authenticator,
version: "{version_date}"
);
service.service_url = "{serviceUrl}";You can supply credentials to your service using external ibm-credentials.env files.
service = IBMWatson::AssistantV1.new(
version: "{version_date}"
);
response = service.list_workspaces.result
puts JSON.pretty_generate(response)Previously we would look for these files first in the system home directory, followed by the current project directory.
Now in order to allow developers to have different configurations for each project we look first in the current project directory, followed by the home directory.
Previously we set the service url by setting url.
def example
service = IBMWatson::AssistantV1.new(
iam_apikey: "{iam_apikey}",
url: "{service_endpoint}",
version: "{version_date}"
);
service.url = "{service_endpoint}";
endNow we set the service url by calling the service_url setter.
def example
authenticator = IBMWatson::Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
service = IBMWatson::AssistantV1.new(
authenticator: authenticator,
version: "{version_date}"
);
service.service_url = "{serviceUrl}";
endinclude_countis no longer a parameter of thelist_workspaces()methodinclude_countis no longer a parameter of thelist_intents()methodinclude_countis no longer a parameter of thelist_examples()methodinclude_countis no longer a parameter of thelist_counterexamples()methodinclude_countis no longer a parameter of thelist_entities()methodinclude_countis no longer a parameter of thelist_values()methodinclude_countis no longer a parameter of thelist_synonyms()methodinclude_countis no longer a parameter of thelist_dialogNodes()methodvalue_typewas renamed totypein thecalue()methodnew_value_typewas renamed tonewTypein theupdate_value()methodnode_typewas renamed totypein thecreate_dialog_node()methodnode_typewas renamed totypein thecreate_dialog_node()methodnew_node_typewas renamed tonew_typein theupdate_dialog_node()method
convert_to_html()method does not require afilenameparameter
return_fieldswas renamed to_returnin thequery()methodlogging_optOutwas renamed tox_watson_logging_optOutin thequery()methodspelling_suggestionswas added to thequery()methodcollection_idsis no longer a parameter of thequery()methodreturn_fieldswas renamed to_returnin theQueryNotices()methodlogging_optOutwas renamed tox_watson_logging_optOutin thefederated_query()methodcollection_idsis now required in thefederated_query()methodcollection_idschanged position in thefederated_query()methodreturn_fieldswas renamed to_returnin thefederated_query()methodreturn_fieldswas renamed to_returnin thefederated_query_notices()methodtest_configuration_in_environment()method was removedquery_entities()method was removedquery_relations()method was removed
default_modelswas renamed to_defaultin thelist_models()method
metadatawas renamed totraining_metadatain thecreate_classifier()method
strictis no longer a parameter of thetrain_acoustic_model()methodrecognize_with_websocket()method was removed
detect_faces()method was removed
- New service!