package wcs-lib

  1. Overview
  2. Docs

Watson Conversation Service data structures.

Data srcutures used in Watson Conversation Service.

Based on the documentation available at: https://www.ibm.com/watson/developercloud/conversation/api/v1/

Version 2017-05-26.

type workspace_status = [
  1. | `Ws_non_existent
  2. | `Ws_training
  3. | `Ws_failed
  4. | `Ws_available
  5. | `Ws_unavailable
]
type json = Json_t.json

Type of arbitraty JSON values.

type workspace_response = {
  1. ws_rsp_name : string option;
  2. ws_rsp_description : string option;
  3. ws_rsp_language : string option;
  4. ws_rsp_metadata : json option;
  5. ws_rsp_created : string option;
  6. ws_rsp_updated : string option;
  7. ws_rsp_workspace_id : string;
}

A workspace metadata.

type selector = Wcs_aux.selector

Goto selector.

type output_def = json

Type of outputs of a dialog node.

type next_step = {
  1. next_behavior : string;
  2. next_selector : selector;
  3. next_dialog_node : string;
}

Type of goto definitions.

type intent_example = {
  1. ex_text : string;
  2. ex_created : string option;
  3. ex_updated : string option;
}

Type of intent examples.

type intent_def = {
  1. i_def_intent : string;
  2. i_def_description : string option;
  3. i_def_examples : intent_example list;
  4. i_def_created : string option;
  5. i_def_updated : string option;
}

Type of intent definitions.

type entity_value = {
  1. e_value : string;
  2. e_metadata : json option;
  3. e_synonyms : string list;
  4. e_created : string option;
  5. e_updated : string option;
}

Type of entity values.

type entity_def = {
  1. e_def_entity : string;
  2. e_def_description : string option;
  3. e_def_metadata : json option;
  4. e_def_source : string option;
  5. e_def_open_list : bool option;
  6. e_def_values : entity_value list;
  7. e_def_created : string option;
  8. e_def_updated : string option;
  9. e_def_fuzzy_match : bool option;
}

Type of entity definitions.

type dialog_node_type =
  1. | Node_response_condition
  2. | Node_frame
  3. | Node_event_handler
  4. | Node_slot

Dialog node type.

type dialog_node_event_name = [
  1. | `Evt_focus
  2. | `Evt_input
  3. | `Evt_nomatch
  4. | `Evt_filled
  5. | `Evt_generic
]
type dialog_node = {
  1. node_dialog_node : string;
  2. node_type_ : dialog_node_type option;
  3. node_description : string option;
  4. node_conditions : string option;
  5. node_parent : string option;
  6. node_previous_sibling : string option;
  7. node_output : output_def option;
  8. node_context : json option;
  9. node_metadata : json option;
  10. node_next_step : next_step option;
  11. node_child_input_kind : string option;
  12. node_created : string option;
  13. node_updated : string option;
  14. node_event_name : dialog_node_event_name option;
  15. node_variable : string option;
}

Type of dialog nodes.

type workspace = {
  1. ws_name : string option;
  2. ws_description : string option;
  3. ws_language : string option;
  4. ws_metadata : json option;
  5. ws_counterexamples : intent_example list;
  6. ws_dialog_nodes : dialog_node list;
  7. ws_entities : entity_def list;
  8. ws_intents : intent_def list;
  9. ws_created : string option;
  10. ws_updated : string option;
  11. ws_modified : string option;
  12. ws_created_by : string option;
  13. ws_modified_by : string option;
  14. ws_workspace_id : string option;
  15. ws_status : workspace_status option;
}

Type of workspaces

type version = [
  1. | `V_2017_05_26
]

Supported versions

type sort_workspace_criteria = [
  1. | `Sort_name_incr
  2. | `Sort_modified_incr
  3. | `Sort_workspace_id_incr
  4. | `Sort_name_decr
  5. | `Sort_modified_decr
  6. | `Sort_workspace_id_decr
]

Sorting criteria for list of workspaces.

type sort_logs_criteria = [
  1. | `Sort_request_timestamp_incr
  2. | `Sort_request_timestamp_decr
]

Sorting criteria for logs.

type pagination_response = {
  1. pag_refresh_url : string option;
  2. pag_next_url : string option;
  3. pag_total : int option;
  4. pag_matched : int option;
}

Pagination information

type log_message = {
  1. log_msg__level : string;
  2. log_msg__msg : string;
}
type output = {
  1. out_log_messages : log_message list;
  2. out_text : string list;
  3. out_nodes_visited : string list;
  4. out_error : string option;
}
type intent = {
  1. i_intent : string;
  2. i_confidence : float;
}
type input = {
  1. in_text : string;
}
type entity = {
  1. e_entity : string;
  2. e_location : int list;
  3. e_value : string;
  4. e_confidence : float;
}
type message_response = {
  1. msg_rsp_input : input;
  2. msg_rsp_alternate_intents : bool;
  3. msg_rsp_context : json;
  4. msg_rsp_entities : entity list;
  5. msg_rsp_intents : intent list;
  6. msg_rsp_output : output;
}
type message_request = {
  1. msg_req_input : input;
  2. msg_req_alternate_intents : bool;
  3. msg_req_context : json option;
  4. msg_req_entities : entity list option;
  5. msg_req_intents : intent list option;
  6. msg_req_output : output option;
}
type log_entry = {
  1. log_request : message_request;
  2. log_response : message_response;
  3. log_log_id : string;
  4. log_request_timestamp : string;
  5. log_response_timestamp : string;
}
type logs_response = {
  1. logs_rsp_logs : log_entry list;
  2. logs_rsp_pagination : pagination_response;
}
type logs_request = {
  1. logs_filter : string option;
  2. logs_sort : sort_logs_criteria option;
  3. logs_page_limit : int option;
  4. logs_cursor : string option;
}

Request for the list the events from the log of a workspace.

type list_workspaces_response = {
  1. list_ws_rsp_workspaces : workspace_response list;
  2. list_ws_rsp_pagination : pagination_response;
}

Response to the list of workspaces request.

type list_workspaces_request = {
  1. list_ws_req_page_limit : int option;
  2. list_ws_req_include_count : bool option;
  3. list_ws_req_sort : sort_workspace_criteria option;
  4. list_ws_req_cursor : string option;
}

Request the list of workspaces.

type get_workspace_request = {
  1. get_ws_req_workspace_id : string;
  2. get_ws_req_export : bool option;
}
type credential = {
  1. cred_url : string;
  2. cred_password : string;
  3. cred_username : string;
}

Watson Conversation Service credentials.

type create_response = {
  1. crea_rsp_name : string option;
  2. crea_rsp_description : string option;
  3. crea_rsp_language : string option;
  4. crea_rsp_metadata : json option;
  5. crea_rsp_created : string option;
  6. crea_rsp_updated : string option;
  7. crea_rsp_workspace_id : string option;
}
type context = {
  1. ctx_conversation_id : string;
  2. ctx_system : json;
}
type action = {
  1. act_name : string;
  2. act_agent : string;
  3. act_type_ : string;
  4. act_parameters : json;
  5. act_result_variable : string option;
}