package wcs-api

  1. Overview
  2. Docs

Generic bot runtime.

val user_input_default : unit -> string

interpret cred ws_id msg_req executes a complet conversation turn (including skip_user_input and calls) on the workspace id ws_id with the message request msg_req. The result is composed of the workspace id for the next conversation turn, the message response and the value of the field return in the context if it is defined.

val exec : ?before:(Wcs_lib.Wcs_t.message_request -> Wcs_lib.Wcs_t.message_request) -> ?after:(Wcs_lib.Wcs_t.message_response -> Wcs_lib.Wcs_t.message_response) -> ?user_input:(unit -> string) -> ?output:(string -> unit) -> Wcs_lib.Wcs_t.credential -> string -> Wcs_lib.Wcs_t.json -> string -> Wcs_lib.Wcs_t.json

exec cred ws_id ctx_init txt_init executes the workspace ws_id with the initial context ctx_init and the initial input text txt_init. The execution is completed when the field return is defined in the context. The return value is the value of the field return.

val get_credential : string option -> Wcs_lib.Wcs_t.credential

get_credential file_name read the credential in json format from the file file_name. If no file name is provided, the functions looks up in the environment if the variable WCS_CRED contains the file name with the credentials. If there is a problem while loading the credentials, Log.Error is raised.