package openai

  1. Overview
  2. Docs
include module type of struct include Yojson.Safe end
type t = [
  1. | `Assoc of (string * t) list
  2. | `Bool of bool
  3. | `Float of float
  4. | `Int of int
  5. | `Intlit of string
  6. | `List of t list
  7. | `Null
  8. | `String of string
  9. | `Tuple of t list
  10. | `Variant of string * t option
]
val pp : Stdlib.Format.formatter -> t -> unit
val show : t -> string
val equal : t -> t -> bool
val to_basic : t -> Yojson__.Basic.t
val to_channel : ?buf:Stdlib.Buffer.t -> ?len:int -> ?suf:string -> ?std:bool -> Stdlib.out_channel -> t -> unit
val to_output : ?buf:Stdlib.Buffer.t -> ?len:int -> ?suf:string -> ?std:bool -> < output : string -> int -> int -> int.. > -> t -> unit
val to_file : ?len:int -> ?std:bool -> ?suf:string -> string -> t -> unit
val to_buffer : ?suf:string -> ?std:bool -> Stdlib.Buffer.t -> t -> unit
val seq_to_string : ?buf:Stdlib.Buffer.t -> ?len:int -> ?suf:string -> ?std:bool -> t Stdlib.Seq.t -> string
val seq_to_channel : ?buf:Stdlib.Buffer.t -> ?len:int -> ?suf:string -> ?std:bool -> Stdlib.out_channel -> t Stdlib.Seq.t -> unit
val seq_to_file : ?len:int -> ?suf:string -> ?std:bool -> string -> t Stdlib.Seq.t -> unit
val seq_to_buffer : ?suf:string -> ?std:bool -> Stdlib.Buffer.t -> t Stdlib.Seq.t -> unit
val write_t : Stdlib.Buffer.t -> t -> unit
val sort : t -> t
val write_null : Stdlib.Buffer.t -> unit -> unit
val write_bool : Stdlib.Buffer.t -> bool -> unit
val write_int : Stdlib.Buffer.t -> int -> unit
val write_float : Stdlib.Buffer.t -> float -> unit
val write_std_float : Stdlib.Buffer.t -> float -> unit
val write_float_prec : int -> Stdlib.Buffer.t -> float -> unit
val write_std_float_prec : int -> Stdlib.Buffer.t -> float -> unit
val write_string : Stdlib.Buffer.t -> string -> unit
val write_intlit : Stdlib.Buffer.t -> string -> unit
val write_assoc : Stdlib.Buffer.t -> (string * t) list -> unit
val write_list : Stdlib.Buffer.t -> t list -> unit
val write_tuple : Stdlib.Buffer.t -> t list -> unit
val write_std_tuple : Stdlib.Buffer.t -> t list -> unit
val write_variant : Stdlib.Buffer.t -> string -> t option -> unit
val write_std_variant : Stdlib.Buffer.t -> string -> t option -> unit
val write_json : Stdlib.Buffer.t -> t -> unit
val write_std_json : Stdlib.Buffer.t -> t -> unit
val pretty_print : ?std:bool -> Stdlib.Format.formatter -> t -> unit
val pretty_to_string : ?std:bool -> t -> string
val pretty_to_channel : ?std:bool -> Stdlib.out_channel -> t -> unit
val prettify : ?std:bool -> string -> string
val compact : ?std:bool -> string -> string
exception Finally of exn * exn
val from_string : ?buf:Stdlib.Buffer.t -> ?fname:string -> ?lnum:int -> string -> t
val from_channel : ?buf:Stdlib.Buffer.t -> ?fname:string -> ?lnum:int -> Stdlib.in_channel -> t
val from_file : ?buf:Stdlib.Buffer.t -> ?fname:string -> ?lnum:int -> string -> t
type lexer_state = Yojson__.Common.Lexer_state.t = {
  1. buf : Stdlib.Buffer.t;
  2. mutable lnum : int;
  3. mutable bol : int;
  4. mutable fname : string option;
}
val init_lexer : ?buf:Stdlib.Buffer.t -> ?fname:string -> ?lnum:int -> unit -> lexer_state
val from_lexbuf : lexer_state -> ?stream:bool -> Stdlib.Lexing.lexbuf -> t
val seq_from_string : ?buf:Stdlib.Buffer.t -> ?fname:string -> ?lnum:int -> string -> t Stdlib.Seq.t
val seq_from_channel : ?buf:Stdlib.Buffer.t -> ?fin:(unit -> unit) -> ?fname:string -> ?lnum:int -> Stdlib.in_channel -> t Stdlib.Seq.t
val seq_from_file : ?buf:Stdlib.Buffer.t -> ?fname:string -> ?lnum:int -> string -> t Stdlib.Seq.t
val seq_from_lexbuf : lexer_state -> ?fin:(unit -> unit) -> Stdlib.Lexing.lexbuf -> t Stdlib.Seq.t
type json_line = [
  1. | `Exn of exn
  2. | `Json of t
]
val lineseq_from_channel : ?buf:Stdlib.Buffer.t -> ?fin:(unit -> unit) -> ?fname:string -> ?lnum:int -> Stdlib.in_channel -> json_line Stdlib.Seq.t
val lineseq_from_file : ?buf:Stdlib.Buffer.t -> ?fname:string -> ?lnum:int -> string -> json_line Stdlib.Seq.t
val read_t : lexer_state -> Stdlib.Lexing.lexbuf -> t
val finish_string : lexer_state -> Stdlib.Lexing.lexbuf -> string
val read_string : lexer_state -> Stdlib.Lexing.lexbuf -> string
val read_ident : lexer_state -> Stdlib.Lexing.lexbuf -> string
val map_string : lexer_state -> (string -> int -> int -> 'a) -> Stdlib.Lexing.lexbuf -> 'a
val map_ident : lexer_state -> (string -> int -> int -> 'a) -> Stdlib.Lexing.lexbuf -> 'a
type variant_kind = [
  1. | `Double_quote
  2. | `Edgy_bracket
  3. | `Square_bracket
]
val start_any_variant : lexer_state -> Stdlib.Lexing.lexbuf -> variant_kind
val finish_variant : lexer_state -> Stdlib.Lexing.lexbuf -> t option
val finish_skip_variant : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_lt : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_gt : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_comma : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val finish_stringlit : lexer_state -> Stdlib.Lexing.lexbuf -> string
val finish_skip_stringlit : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val finish_escaped_char : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val finish_comment : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_space : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_eof : Stdlib.Lexing.lexbuf -> bool
val read_null : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_null_if_possible : lexer_state -> Stdlib.Lexing.lexbuf -> bool
val read_bool : lexer_state -> Stdlib.Lexing.lexbuf -> bool
val read_int : lexer_state -> Stdlib.Lexing.lexbuf -> int
val read_int8 : lexer_state -> Stdlib.Lexing.lexbuf -> char
val read_int32 : lexer_state -> Stdlib.Lexing.lexbuf -> int32
val read_int64 : lexer_state -> Stdlib.Lexing.lexbuf -> int64
val read_number : lexer_state -> Stdlib.Lexing.lexbuf -> float
val skip_ident : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_sequence : ('a -> lexer_state -> Stdlib.Lexing.lexbuf -> 'a) -> 'a -> lexer_state -> Stdlib.Lexing.lexbuf -> 'a
val read_list : (lexer_state -> Stdlib.Lexing.lexbuf -> 'a) -> lexer_state -> Stdlib.Lexing.lexbuf -> 'a list
val read_list_rev : (lexer_state -> Stdlib.Lexing.lexbuf -> 'a) -> lexer_state -> Stdlib.Lexing.lexbuf -> 'a list
val read_array_end : Stdlib.Lexing.lexbuf -> unit
val read_array_sep : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_array : (lexer_state -> Stdlib.Lexing.lexbuf -> 'a) -> lexer_state -> Stdlib.Lexing.lexbuf -> 'a array
val read_tuple : (int -> 'a -> lexer_state -> Stdlib.Lexing.lexbuf -> 'a) -> 'a -> lexer_state -> Stdlib.Lexing.lexbuf -> 'a
val start_any_tuple : lexer_state -> Stdlib.Lexing.lexbuf -> bool
val read_lpar : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_rpar : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_tuple_end : Stdlib.Lexing.lexbuf -> unit
val read_tuple_end2 : lexer_state -> bool -> Stdlib.Lexing.lexbuf -> unit
val read_tuple_sep : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_tuple_sep2 : lexer_state -> bool -> Stdlib.Lexing.lexbuf -> unit
val read_lbr : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_rbr : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_fields : ('acc -> string -> lexer_state -> Stdlib.Lexing.lexbuf -> 'acc) -> 'acc -> lexer_state -> Stdlib.Lexing.lexbuf -> 'acc
val read_abstract_fields : (lexer_state -> Stdlib.Lexing.lexbuf -> 'key) -> ('acc -> 'key -> lexer_state -> Stdlib.Lexing.lexbuf -> 'acc) -> 'acc -> lexer_state -> Stdlib.Lexing.lexbuf -> 'acc
val read_lcurl : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_object_end : Stdlib.Lexing.lexbuf -> unit
val read_object_sep : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_colon : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val read_json : lexer_state -> Stdlib.Lexing.lexbuf -> t
val skip_json : lexer_state -> Stdlib.Lexing.lexbuf -> unit
val buffer_json : lexer_state -> Stdlib.Lexing.lexbuf -> unit
module Util : sig ... end
include module type of struct include Util end
exception Type_error of string * Yojson__Safe.t
exception Undefined of string * Yojson__Safe.t
val keys : Yojson__Safe.t -> string list
val values : Yojson__Safe.t -> Yojson__Safe.t list
val combine : Yojson__Safe.t -> Yojson__Safe.t -> Yojson__Safe.t
val member : string -> Yojson__Safe.t -> Yojson__Safe.t
val path : string list -> Yojson__Safe.t -> Yojson__Safe.t option
val index : int -> Yojson__Safe.t -> Yojson__Safe.t
val map : (Yojson__Safe.t -> Yojson__Safe.t) -> Yojson__Safe.t -> Yojson__Safe.t
val to_assoc : Yojson__Safe.t -> (string * Yojson__Safe.t) list
val to_option : (Yojson__Safe.t -> 'a) -> Yojson__Safe.t -> 'a option
val to_bool : Yojson__Safe.t -> bool
val to_bool_option : Yojson__Safe.t -> bool option
val to_number : Yojson__Safe.t -> float
val to_number_option : Yojson__Safe.t -> float option
val to_float : Yojson__Safe.t -> float
val to_float_option : Yojson__Safe.t -> float option
val to_int : Yojson__Safe.t -> int
val to_int_option : Yojson__Safe.t -> int option
val to_list : Yojson__Safe.t -> Yojson__Safe.t list
val to_string : Yojson__Safe.t -> string
val to_string_option : Yojson__Safe.t -> string option
val convert_each : (Yojson__Safe.t -> 'a) -> Yojson__Safe.t -> 'a list
val filter_map : ('a -> 'b option) -> 'a list -> 'b list
val flatten : Yojson__Safe.t list -> Yojson__Safe.t list
val filter_index : int -> Yojson__Safe.t list -> Yojson__Safe.t list
val filter_list : Yojson__Safe.t list -> Yojson__Safe.t list list
val filter_member : string -> Yojson__Safe.t list -> Yojson__Safe.t list
val filter_assoc : Yojson__Safe.t list -> (string * Yojson__Safe.t) list list
val filter_bool : Yojson__Safe.t list -> bool list
val filter_int : Yojson__Safe.t list -> int list
val filter_float : Yojson__Safe.t list -> float list
val filter_number : Yojson__Safe.t list -> float list
val filter_string : Yojson__Safe.t list -> string list
val to_field_opt : 'a -> ('b -> [> `Null ] as 'c) -> 'b option -> 'a * 'c
OCaml

Innovation. Community. Security.