@@ -34,7 +34,7 @@ module IBMWatson
3434 class AssistantV2 < IBMCloudSdkCore ::BaseService
3535 include Concurrent ::Async
3636 DEFAULT_SERVICE_NAME = "assistant"
37- DEFAULT_SERVICE_URL = "https://gateway.watsonplatform.net/ assistant/api "
37+ DEFAULT_SERVICE_URL = "https://api.us-south. assistant.watson.cloud.ibm.com "
3838 ##
3939 # @!method initialize(args)
4040 # Construct a new client for the Assistant service.
@@ -164,8 +164,6 @@ def delete_session(assistant_id:, session_id:)
164164 # Send user input to an assistant and receive a response, with conversation state
165165 # (including context data) stored by Watson Assistant for the duration of the
166166 # session.
167- #
168- # There is no rate limit for this operation.
169167 # @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
170168 # Assistant user interface, open the assistant settings and click **API Details**.
171169 # For information about creating assistants, see the
@@ -218,8 +216,6 @@ def message(assistant_id:, session_id:, input: nil, context: nil)
218216 # Send user input to assistant (stateless).
219217 # Send user input to an assistant and receive a response, with conversation state
220218 # (including context data) managed by your application.
221- #
222- # There is no rate limit for this operation.
223219 # @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
224220 # Assistant user interface, open the assistant settings and click **API Details**.
225221 # For information about creating assistants, see the
@@ -264,5 +260,99 @@ def message_stateless(assistant_id:, input: nil, context: nil)
264260 )
265261 response
266262 end
263+ #########################
264+ # Logs
265+ #########################
266+
267+ ##
268+ # @!method list_logs(assistant_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
269+ # List log events for an assistant.
270+ # List the events from the log of an assistant.
271+ #
272+ # This method is available only with Premium plans.
273+ # @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
274+ # Assistant user interface, open the assistant settings and click **API Details**.
275+ # For information about creating assistants, see the
276+ # [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
277+ #
278+ # **Note:** Currently, the v2 API does not support creating assistants.
279+ # @param sort [String] How to sort the returned log events. You can sort by **request_timestamp**. To
280+ # reverse the sort order, prefix the parameter value with a minus sign (`-`).
281+ # @param filter [String] A cacheable parameter that limits the results to those matching the specified
282+ # filter. For more information, see the
283+ # [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference).
284+ # @param page_limit [Fixnum] The number of records to return in each page of results.
285+ # @param cursor [String] A token identifying the page of results to retrieve.
286+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
287+ def list_logs ( assistant_id :, sort : nil , filter : nil , page_limit : nil , cursor : nil )
288+ raise ArgumentError . new ( "assistant_id must be provided" ) if assistant_id . nil?
289+
290+ headers = {
291+ }
292+ sdk_headers = Common . new . get_sdk_headers ( "conversation" , "V2" , "list_logs" )
293+ headers . merge! ( sdk_headers )
294+
295+ params = {
296+ "version" => @version ,
297+ "sort" => sort ,
298+ "filter" => filter ,
299+ "page_limit" => page_limit ,
300+ "cursor" => cursor
301+ }
302+
303+ method_url = "/v2/assistants/%s/logs" % [ ERB ::Util . url_encode ( assistant_id ) ]
304+
305+ response = request (
306+ method : "GET" ,
307+ url : method_url ,
308+ headers : headers ,
309+ params : params ,
310+ accept_json : true
311+ )
312+ response
313+ end
314+ #########################
315+ # User data
316+ #########################
317+
318+ ##
319+ # @!method delete_user_data(customer_id:)
320+ # Delete labeled data.
321+ # Deletes all data associated with a specified customer ID. The method has no effect
322+ # if no data is associated with the customer ID.
323+ #
324+ # You associate a customer ID with data by passing the `X-Watson-Metadata` header
325+ # with a request that passes data. For more information about personal data and
326+ # customer IDs, see [Information
327+ # security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
328+ #
329+ # This operation is limited to 4 requests per minute. For more information, see
330+ # **Rate limiting**.
331+ # @param customer_id [String] The customer ID for which all data is to be deleted.
332+ # @return [nil]
333+ def delete_user_data ( customer_id :)
334+ raise ArgumentError . new ( "customer_id must be provided" ) if customer_id . nil?
335+
336+ headers = {
337+ }
338+ sdk_headers = Common . new . get_sdk_headers ( "conversation" , "V2" , "delete_user_data" )
339+ headers . merge! ( sdk_headers )
340+
341+ params = {
342+ "version" => @version ,
343+ "customer_id" => customer_id
344+ }
345+
346+ method_url = "/v2/user_data"
347+
348+ request (
349+ method : "DELETE" ,
350+ url : method_url ,
351+ headers : headers ,
352+ params : params ,
353+ accept_json : true
354+ )
355+ nil
356+ end
267357 end
268358end
0 commit comments