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 = Wcs_t.workspace_status
type json = Json_t.json

Type of arbitraty JSON values.

type workspace_response = Wcs_t.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_t.selector

Goto selector.

type output_def = Wcs_t.output_def

Type of outputs of a dialog node.

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

Type of goto definitions.

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

Type of intent examples.

type intent_def = Wcs_t.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 = Wcs_t.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 = Wcs_t.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 = Wcs_t.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 = Wcs_t.dialog_node_event_name
type dialog_node = Wcs_t.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 = Wcs_t.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 = Wcs_t.version

Supported versions

type sort_workspace_criteria = Wcs_t.sort_workspace_criteria

Sorting criteria for list of workspaces.

type sort_logs_criteria = Wcs_t.sort_logs_criteria

Sorting criteria for logs.

type pagination_response = Wcs_t.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 = Wcs_t.log_message = {
  1. log_msg__level : string;
  2. log_msg__msg : string;
}
type output = Wcs_t.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 = Wcs_t.intent = {
  1. i_intent : string;
  2. i_confidence : float;
}
type input = Wcs_t.input = {
  1. in_text : string;
}
type entity = Wcs_t.entity = {
  1. e_entity : string;
  2. e_location : int list;
  3. e_value : string;
  4. e_confidence : float;
}
type message_response = Wcs_t.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 = Wcs_t.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 = Wcs_t.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 = Wcs_t.logs_response = {
  1. logs_rsp_logs : log_entry list;
  2. logs_rsp_pagination : pagination_response;
}
type logs_request = Wcs_t.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 = Wcs_t.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 = Wcs_t.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 = Wcs_t.get_workspace_request = {
  1. get_ws_req_workspace_id : string;
  2. get_ws_req_export : bool option;
}
type credential = Wcs_t.credential = {
  1. cred_url : string;
  2. cred_password : string;
  3. cred_username : string;
}

Watson Conversation Service credentials.

type create_response = Wcs_t.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 = Wcs_t.context = {
  1. ctx_conversation_id : string;
  2. ctx_system : json;
}
type action = Wcs_t.action = {
  1. act_name : string;
  2. act_agent : string;
  3. act_type_ : string;
  4. act_parameters : json;
  5. act_result_variable : string option;
}
val write_workspace_status : Bi_outbuf.t -> workspace_status -> unit

Output a JSON value of type workspace_status.

val string_of_workspace_status : ?len:int -> workspace_status -> string

Serialize a value of type workspace_status into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_workspace_status : Yojson.Safe.lexer_state -> Lexing.lexbuf -> workspace_status

Input JSON data of type workspace_status.

val workspace_status_of_string : string -> workspace_status

Deserialize JSON data of type workspace_status.

val write_json : Bi_outbuf.t -> json -> unit

Output a JSON value of type json.

val string_of_json : ?len:int -> json -> string

Serialize a value of type json into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type json.

val json_of_string : string -> json

Deserialize JSON data of type json.

val write_workspace_response : Bi_outbuf.t -> workspace_response -> unit

Output a JSON value of type workspace_response.

val string_of_workspace_response : ?len:int -> workspace_response -> string

Serialize a value of type workspace_response into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_workspace_response : Yojson.Safe.lexer_state -> Lexing.lexbuf -> workspace_response

Input JSON data of type workspace_response.

val workspace_response_of_string : string -> workspace_response

Deserialize JSON data of type workspace_response.

val write_selector : Bi_outbuf.t -> selector -> unit

Output a JSON value of type selector.

val string_of_selector : ?len:int -> selector -> string

Serialize a value of type selector into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type selector.

val selector_of_string : string -> selector

Deserialize JSON data of type selector.

val write_output_def : Bi_outbuf.t -> output_def -> unit

Output a JSON value of type output_def.

val string_of_output_def : ?len:int -> output_def -> string

Serialize a value of type output_def into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type output_def.

val output_def_of_string : string -> output_def

Deserialize JSON data of type output_def.

val write_next_step : Bi_outbuf.t -> next_step -> unit

Output a JSON value of type next_step.

val string_of_next_step : ?len:int -> next_step -> string

Serialize a value of type next_step into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type next_step.

val next_step_of_string : string -> next_step

Deserialize JSON data of type next_step.

val write_intent_example : Bi_outbuf.t -> intent_example -> unit

Output a JSON value of type intent_example.

val string_of_intent_example : ?len:int -> intent_example -> string

Serialize a value of type intent_example into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_intent_example : Yojson.Safe.lexer_state -> Lexing.lexbuf -> intent_example

Input JSON data of type intent_example.

val intent_example_of_string : string -> intent_example

Deserialize JSON data of type intent_example.

val write_intent_def : Bi_outbuf.t -> intent_def -> unit

Output a JSON value of type intent_def.

val string_of_intent_def : ?len:int -> intent_def -> string

Serialize a value of type intent_def into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type intent_def.

val intent_def_of_string : string -> intent_def

Deserialize JSON data of type intent_def.

val write_entity_value : Bi_outbuf.t -> entity_value -> unit

Output a JSON value of type entity_value.

val string_of_entity_value : ?len:int -> entity_value -> string

Serialize a value of type entity_value into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_entity_value : Yojson.Safe.lexer_state -> Lexing.lexbuf -> entity_value

Input JSON data of type entity_value.

val entity_value_of_string : string -> entity_value

Deserialize JSON data of type entity_value.

val write_entity_def : Bi_outbuf.t -> entity_def -> unit

Output a JSON value of type entity_def.

val string_of_entity_def : ?len:int -> entity_def -> string

Serialize a value of type entity_def into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type entity_def.

val entity_def_of_string : string -> entity_def

Deserialize JSON data of type entity_def.

val write_dialog_node_type : Bi_outbuf.t -> dialog_node_type -> unit

Output a JSON value of type dialog_node_type.

val string_of_dialog_node_type : ?len:int -> dialog_node_type -> string

Serialize a value of type dialog_node_type into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_dialog_node_type : Yojson.Safe.lexer_state -> Lexing.lexbuf -> dialog_node_type

Input JSON data of type dialog_node_type.

val dialog_node_type_of_string : string -> dialog_node_type

Deserialize JSON data of type dialog_node_type.

val write_dialog_node_event_name : Bi_outbuf.t -> dialog_node_event_name -> unit

Output a JSON value of type dialog_node_event_name.

val string_of_dialog_node_event_name : ?len:int -> dialog_node_event_name -> string

Serialize a value of type dialog_node_event_name into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_dialog_node_event_name : Yojson.Safe.lexer_state -> Lexing.lexbuf -> dialog_node_event_name

Input JSON data of type dialog_node_event_name.

val dialog_node_event_name_of_string : string -> dialog_node_event_name

Deserialize JSON data of type dialog_node_event_name.

val write_dialog_node : Bi_outbuf.t -> dialog_node -> unit

Output a JSON value of type dialog_node.

val string_of_dialog_node : ?len:int -> dialog_node -> string

Serialize a value of type dialog_node into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type dialog_node.

val dialog_node_of_string : string -> dialog_node

Deserialize JSON data of type dialog_node.

val write_workspace : Bi_outbuf.t -> workspace -> unit

Output a JSON value of type workspace.

val string_of_workspace : ?len:int -> workspace -> string

Serialize a value of type workspace into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type workspace.

val workspace_of_string : string -> workspace

Deserialize JSON data of type workspace.

val write_version : Bi_outbuf.t -> version -> unit

Output a JSON value of type version.

val string_of_version : ?len:int -> version -> string

Serialize a value of type version into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type version.

val version_of_string : string -> version

Deserialize JSON data of type version.

val write_sort_workspace_criteria : Bi_outbuf.t -> sort_workspace_criteria -> unit

Output a JSON value of type sort_workspace_criteria.

val string_of_sort_workspace_criteria : ?len:int -> sort_workspace_criteria -> string

Serialize a value of type sort_workspace_criteria into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_sort_workspace_criteria : Yojson.Safe.lexer_state -> Lexing.lexbuf -> sort_workspace_criteria

Input JSON data of type sort_workspace_criteria.

val sort_workspace_criteria_of_string : string -> sort_workspace_criteria

Deserialize JSON data of type sort_workspace_criteria.

val write_sort_logs_criteria : Bi_outbuf.t -> sort_logs_criteria -> unit

Output a JSON value of type sort_logs_criteria.

val string_of_sort_logs_criteria : ?len:int -> sort_logs_criteria -> string

Serialize a value of type sort_logs_criteria into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_sort_logs_criteria : Yojson.Safe.lexer_state -> Lexing.lexbuf -> sort_logs_criteria

Input JSON data of type sort_logs_criteria.

val sort_logs_criteria_of_string : string -> sort_logs_criteria

Deserialize JSON data of type sort_logs_criteria.

val write_pagination_response : Bi_outbuf.t -> pagination_response -> unit

Output a JSON value of type pagination_response.

val string_of_pagination_response : ?len:int -> pagination_response -> string

Serialize a value of type pagination_response into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_pagination_response : Yojson.Safe.lexer_state -> Lexing.lexbuf -> pagination_response

Input JSON data of type pagination_response.

val pagination_response_of_string : string -> pagination_response

Deserialize JSON data of type pagination_response.

val write_log_message : Bi_outbuf.t -> log_message -> unit

Output a JSON value of type log_message.

val string_of_log_message : ?len:int -> log_message -> string

Serialize a value of type log_message into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type log_message.

val log_message_of_string : string -> log_message

Deserialize JSON data of type log_message.

val write_output : Bi_outbuf.t -> output -> unit

Output a JSON value of type output.

val string_of_output : ?len:int -> output -> string

Serialize a value of type output into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type output.

val output_of_string : string -> output

Deserialize JSON data of type output.

val write_intent : Bi_outbuf.t -> intent -> unit

Output a JSON value of type intent.

val string_of_intent : ?len:int -> intent -> string

Serialize a value of type intent into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type intent.

val intent_of_string : string -> intent

Deserialize JSON data of type intent.

val write_input : Bi_outbuf.t -> input -> unit

Output a JSON value of type input.

val string_of_input : ?len:int -> input -> string

Serialize a value of type input into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type input.

val input_of_string : string -> input

Deserialize JSON data of type input.

val write_entity : Bi_outbuf.t -> entity -> unit

Output a JSON value of type entity.

val string_of_entity : ?len:int -> entity -> string

Serialize a value of type entity into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type entity.

val entity_of_string : string -> entity

Deserialize JSON data of type entity.

val write_message_response : Bi_outbuf.t -> message_response -> unit

Output a JSON value of type message_response.

val string_of_message_response : ?len:int -> message_response -> string

Serialize a value of type message_response into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_message_response : Yojson.Safe.lexer_state -> Lexing.lexbuf -> message_response

Input JSON data of type message_response.

val message_response_of_string : string -> message_response

Deserialize JSON data of type message_response.

val write_message_request : Bi_outbuf.t -> message_request -> unit

Output a JSON value of type message_request.

val string_of_message_request : ?len:int -> message_request -> string

Serialize a value of type message_request into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_message_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> message_request

Input JSON data of type message_request.

val message_request_of_string : string -> message_request

Deserialize JSON data of type message_request.

val write_log_entry : Bi_outbuf.t -> log_entry -> unit

Output a JSON value of type log_entry.

val string_of_log_entry : ?len:int -> log_entry -> string

Serialize a value of type log_entry into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_log_entry : Yojson.Safe.lexer_state -> Lexing.lexbuf -> log_entry

Input JSON data of type log_entry.

val log_entry_of_string : string -> log_entry

Deserialize JSON data of type log_entry.

val write_logs_response : Bi_outbuf.t -> logs_response -> unit

Output a JSON value of type logs_response.

val string_of_logs_response : ?len:int -> logs_response -> string

Serialize a value of type logs_response into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_logs_response : Yojson.Safe.lexer_state -> Lexing.lexbuf -> logs_response

Input JSON data of type logs_response.

val logs_response_of_string : string -> logs_response

Deserialize JSON data of type logs_response.

val write_logs_request : Bi_outbuf.t -> logs_request -> unit

Output a JSON value of type logs_request.

val string_of_logs_request : ?len:int -> logs_request -> string

Serialize a value of type logs_request into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_logs_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> logs_request

Input JSON data of type logs_request.

val logs_request_of_string : string -> logs_request

Deserialize JSON data of type logs_request.

val write_list_workspaces_response : Bi_outbuf.t -> list_workspaces_response -> unit

Output a JSON value of type list_workspaces_response.

val string_of_list_workspaces_response : ?len:int -> list_workspaces_response -> string

Serialize a value of type list_workspaces_response into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_list_workspaces_response : Yojson.Safe.lexer_state -> Lexing.lexbuf -> list_workspaces_response

Input JSON data of type list_workspaces_response.

val list_workspaces_response_of_string : string -> list_workspaces_response

Deserialize JSON data of type list_workspaces_response.

val write_list_workspaces_request : Bi_outbuf.t -> list_workspaces_request -> unit

Output a JSON value of type list_workspaces_request.

val string_of_list_workspaces_request : ?len:int -> list_workspaces_request -> string

Serialize a value of type list_workspaces_request into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_list_workspaces_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> list_workspaces_request

Input JSON data of type list_workspaces_request.

val list_workspaces_request_of_string : string -> list_workspaces_request

Deserialize JSON data of type list_workspaces_request.

val write_get_workspace_request : Bi_outbuf.t -> get_workspace_request -> unit

Output a JSON value of type get_workspace_request.

val string_of_get_workspace_request : ?len:int -> get_workspace_request -> string

Serialize a value of type get_workspace_request into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_get_workspace_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> get_workspace_request

Input JSON data of type get_workspace_request.

val get_workspace_request_of_string : string -> get_workspace_request

Deserialize JSON data of type get_workspace_request.

val write_credential : Bi_outbuf.t -> credential -> unit

Output a JSON value of type credential.

val string_of_credential : ?len:int -> credential -> string

Serialize a value of type credential into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type credential.

val credential_of_string : string -> credential

Deserialize JSON data of type credential.

val write_create_response : Bi_outbuf.t -> create_response -> unit

Output a JSON value of type create_response.

val string_of_create_response : ?len:int -> create_response -> string

Serialize a value of type create_response into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_create_response : Yojson.Safe.lexer_state -> Lexing.lexbuf -> create_response

Input JSON data of type create_response.

val create_response_of_string : string -> create_response

Deserialize JSON data of type create_response.

val write_context : Bi_outbuf.t -> context -> unit

Output a JSON value of type context.

val string_of_context : ?len:int -> context -> string

Serialize a value of type context into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type context.

val context_of_string : string -> context

Deserialize JSON data of type context.

val write_action : Bi_outbuf.t -> action -> unit

Output a JSON value of type action.

val string_of_action : ?len:int -> action -> string

Serialize a value of type action into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type action.

val action_of_string : string -> action

Deserialize JSON data of type action.

OCaml

Innovation. Community. Security.