public class Assistant
extends com.ibm.cloud.sdk.core.service.BaseService
The Assistant v2 API provides runtime methods your client application can use to send user input to an assistant and receive a response.
Constructor and Description |
---|
Assistant(java.lang.String versionDate)
Constructs a new `Assistant` client using the DEFAULT_SERVICE_NAME.
|
Assistant(java.lang.String versionDate,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs a new `Assistant` client with the DEFAULT_SERVICE_NAME and the specified
Authenticator.
|
Assistant(java.lang.String versionDate,
java.lang.String serviceName)
Constructs a new `Assistant` client with the specified serviceName.
|
Assistant(java.lang.String versionDate,
java.lang.String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs a new `Assistant` client with the specified Authenticator and serviceName.
|
Modifier and Type | Method and Description |
---|---|
com.ibm.cloud.sdk.core.http.ServiceCall<SessionResponse> |
createSession(CreateSessionOptions createSessionOptions)
Create a session.
|
com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> |
deleteSession(DeleteSessionOptions deleteSessionOptions)
Delete session.
|
com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> |
deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
Delete labeled data.
|
com.ibm.cloud.sdk.core.http.ServiceCall<LogCollection> |
listLogs(ListLogsOptions listLogsOptions)
List log events for an assistant.
|
com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponse> |
message(MessageOptions messageOptions)
Send user input to assistant (stateful).
|
com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponseStateless> |
messageStateless(MessageStatelessOptions messageStatelessOptions)
Send user input to assistant (stateless).
|
configureClient, configureHttpClient, configureService, createServiceCall, getAuthenticator, getClient, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, processServiceCall, setAuthentication, setClient, setDefaultHeaders, setDefaultHeaders, setEndPoint, setServiceUrl, toString
public Assistant(java.lang.String versionDate)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.public Assistant(java.lang.String versionDate, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.authenticator
- the Authenticator instance to be configured for this servicepublic Assistant(java.lang.String versionDate, java.lang.String serviceName)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.serviceName
- The name of the service to configure.public Assistant(java.lang.String versionDate, java.lang.String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.serviceName
- The name of the service to configure.authenticator
- the Authenticator instance to be configured for this servicepublic com.ibm.cloud.sdk.core.http.ServiceCall<SessionResponse> createSession(CreateSessionOptions createSessionOptions)
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. 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/assistant?topic=assistant-assistant-settings).
createSessionOptions
- the CreateSessionOptions
containing the options for the
callServiceCall
with a response type of SessionResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> deleteSession(DeleteSessionOptions deleteSessionOptions)
Deletes a session explicitly before it times out. (For more information about the session inactivity timeout, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings)).
deleteSessionOptions
- the DeleteSessionOptions
containing the options for the
callServiceCall
with a response type of Voidpublic com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponse> message(MessageOptions messageOptions)
Send user input to an assistant and receive a response, with conversation state (including context data) stored by Watson Assistant for the duration of the session.
messageOptions
- the MessageOptions
containing the options for the callServiceCall
with a response type of MessageResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponseStateless> messageStateless(MessageStatelessOptions messageStatelessOptions)
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
messageStatelessOptions
- the MessageStatelessOptions
containing the options for
the callServiceCall
with a response type of MessageResponseStateless
public com.ibm.cloud.sdk.core.http.ServiceCall<LogCollection> listLogs(ListLogsOptions listLogsOptions)
List the events from the log of an assistant.
This method is available only with Premium plans.
listLogsOptions
- the ListLogsOptions
containing the options for the callServiceCall
with a response type of LogCollection
public com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the `X-Watson-Metadata` header with a request that passes data. For more information about personal data and customer IDs, see [Information security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
This operation is limited to 4 requests per minute. For more information, see **Rate limiting**.
deleteUserDataOptions
- the DeleteUserDataOptions
containing the options for the
callServiceCall
with a response type of Void