Module Generation.Stats

Stats for a single generation. Many fields are nullable on the wire; we keep them as options rather than papering over with defaults.

type t = {
  1. id : string;
  2. model : string;
  3. provider_name : string option;
  4. created_at : string;
  5. api_type : string option;
  6. origin : string option;
  7. user_agent : string option;
  8. http_referer : string option;
  9. session_id : string option;
  10. request_id : string option;
  11. upstream_id : string option;
  12. app_id : Jsonaf.t option;
  13. external_user : Jsonaf.t option;
  14. router : Jsonaf.t option;
  15. streamed : bool option;
  16. cancelled : bool option;
  17. is_byok : bool option;
  18. finish_reason : string option;
  19. native_finish_reason : string option;
  20. service_tier : string option;
  21. latency : int option;
  22. moderation_latency : int option;
  23. generation_time : int option;
  24. tokens_prompt : int option;
  25. tokens_completion : int option;
  26. native_tokens_prompt : int option;
  27. native_tokens_completion : int option;
  28. native_tokens_completion_images : int option;
  29. native_tokens_reasoning : int option;
  30. native_tokens_cached : int option;
  31. num_media_prompt : int option;
  32. num_input_audio_prompt : int option;
  33. num_media_completion : int option;
  34. num_search_results : int option;
  35. num_fetches : int option;
  36. web_search_engine : string option;
  37. usage : float option;
  38. total_cost : float option;
  39. upstream_inference_cost : float option;
  40. cache_discount : float option;
  41. response_cache_source_id : string option;
  42. provider_responses : Provider_response.t list;
}
module Fields : sig ... end
include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t