Module Wcs_lib.Wcs_t

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 =
| Ws_non_existent
| Ws_training
| Ws_failed
| Ws_available
| Ws_unavailable
type json = Json_t.json

Type of arbitraty JSON values.

type workspace_response = {
ws_rsp_name : string option;
ws_rsp_description : string option;
ws_rsp_language : string option;
ws_rsp_metadata : json option;
ws_rsp_created : string option;
ws_rsp_updated : string option;
ws_rsp_workspace_id : string;
}

A workspace metadata.

type spel = Spel_t.expression

Type of Spel expressions.

type selector =
| Goto_user_input
| Goto_client
| Goto_condition
| Goto_body

Goto selector.

type json_spel = Json_spel_t.json_spel

Type of arbitraty JSON values with embedded Spel expressions.

type output_def = json_spel

Type of outputs of a dialog node.

type next_step = {
next_behavior : string;
next_selector : selector;
next_dialog_node : string;
}

Type of goto definitions.

type intent_example = {
ex_text : string;
ex_created : string option;
ex_updated : string option;
}

Type of intent examples.

type intent_def = {
i_def_intent : string;
i_def_description : string option;
i_def_examples : intent_example list;
i_def_created : string option;
i_def_updated : string option;
}

Type of intent definitions.

type entity_value = {
e_val_value : string;
e_val_metadata : json option;
e_val_synonyms : string list;
e_val_created : string option;
e_val_updated : string option;
}

Type of entity values.

type entity_def = {
e_def_entity : string;
e_def_description : string option;
e_def_metadata : json option;
e_def_source : string option;
e_def_open_list : bool option;
e_def_values : entity_value list;
e_def_created : string option;
e_def_updated : string option;
e_def_fuzzy_match : bool option;
}

Type of entity definitions.

type dialog_node_type =
| Node_standard
| Node_response_condition
| Node_frame
| Node_event_handler
| Node_slot

Dialog node type.

type dialog_node_event_name =
| Evt_focus
| Evt_input
| Evt_nomatch
| Evt_filled
| Evt_generic
type dialog_node = {
node_dialog_node : string;
node_type_ : dialog_node_type option;
node_description : string option;
node_conditions : spel option;
node_parent : string option;
node_previous_sibling : string option;
node_output : output_def option;
node_context : json_spel option;
node_metadata : json option;
node_next_step : next_step option;
node_child_input_kind : string option;
node_created : string option;
node_updated : string option;
node_event_name : dialog_node_event_name option;
node_variable : string option;
}

Type of dialog nodes.

type workspace = {
ws_name : string option;
ws_description : string option;
ws_language : string option;
ws_metadata : json option;
ws_counterexamples : intent_example list;
ws_dialog_nodes : dialog_node list;
ws_entities : entity_def list;
ws_intents : intent_def list;
ws_created : string option;
ws_updated : string option;
ws_modified : string option;
ws_created_by : string option;
ws_modified_by : string option;
ws_workspace_id : string option;
ws_status : workspace_status option;
}

Type of workspaces

type version =
| V_2017_05_26

Supported versions

type sort_workspace_criteria =
| Sort_name_incr
| Sort_modified_incr
| Sort_workspace_id_incr
| Sort_name_decr
| Sort_modified_decr
| Sort_workspace_id_decr

Sorting criteria for list of workspaces.

type sort_logs_criteria =
| Sort_request_timestamp_incr
| Sort_request_timestamp_decr

Sorting criteria for logs.

type pagination_response = {
pag_refresh_url : string option;
pag_next_url : string option;
pag_total : int option;
pag_matched : int option;
}

Pagination information

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

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

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

Response to the list of workspaces request.

type list_workspaces_request = {
list_ws_req_page_limit : int option;
list_ws_req_include_count : bool option;
list_ws_req_sort : sort_workspace_criteria option;
list_ws_req_cursor : string option;
}

Request the list of workspaces.

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

Watson Conversation Service credentials.

type create_response = {
crea_rsp_name : string option;
crea_rsp_description : string option;
crea_rsp_language : string option;
crea_rsp_metadata : json option;
crea_rsp_created : string option;
crea_rsp_updated : string option;
crea_rsp_workspace_id : string option;
}
type context = {
ctx_conversation_id : string;
ctx_system : json;
}
type action_def = {
act_def_name : string;
act_def_agent : string;
act_def_type_ : string;
act_def_parameters : json_spel;
act_def_result_variable : string option;
}
type action = {
act_name : string;
act_agent : string;
act_type_ : string;
act_parameters : json;
act_result_variable : string option;
}