Module Openai_gym.Json
val read_json_file : (Yojson.lexer_state -> Stdlib.Lexing.lexbuf -> 'a) -> string -> 'aread_json_file reader fnamereads the filefnameusing the readerreadergenerated by atdgen.
Builders
val null : Json_t.jsonThe
nullvalue of JSON.
val int : int -> Json_t.jsonint nbuild the value of JSONn.
val bool : bool -> Json_t.jsonbool bbuild the value of JSONb.
val string : string -> Json_t.jsonstring sbuild the value of JSONs.
val assoc : (string * Json_t.json) list -> Json_t.jsonassoc obuild the JSON objecto.
val list : Json_t.json list -> Json_t.jsonlist lbuild the JSON listl.
Manipulation functions
val set : Json_t.json -> string -> Json_t.json -> Json_t.jsonset o x vadd (or replace) the a fieldxof the objectowith valuev.
val get : Json_t.json -> string -> Json_t.json optionget o xgets the value of the fieldxof the objecto.
val take : Json_t.json -> string -> Json_t.json * Json_t.json optiontake o xgets the value of the fieldxof the objectoand remove the field from the object. The left part of the return value is the modified object and the right part is the value of the field.
val assign : Json_t.json list -> Json_t.jsonassign [o1; ...; on]create a json object that contains all the fields of the objetso1, ...,on. It is similare the the JavaScript functionObject.assing({}, o1, ... on).
val push : Json_t.json -> string -> Json_t.json -> Json_t.jsonpush o x vadd the valuevin the list stored in a fieldxof the objecto. It the fieldxdoesn't exists, it creates it.
val pop : Json_t.json -> string -> Json_t.json * Json_t.json optionpop o xtake a value in a list stored in the fieldxofo.
Setters and getters
Boolean fields
val set_bool : Json_t.json -> string -> bool -> Json_t.jsonset_bool o x bsets the a fieldxof the objectowith valueb.
val get_bool : Json_t.json -> string -> bool optionget_bool o xgets the value of the fieldxof the objecto.
String fields
val set_string : Json_t.json -> string -> string -> Json_t.jsonset_string o x xsets the a fieldxof the objectowith strings.
val get_string : Json_t.json -> string -> string optionget_string o xgets the value of the fieldxof the objecto.
val take_string : Json_t.json -> string -> Json_t.json * string optiontake_string o xtakes the value of the fieldxof the objecto.