Package org.mockserver.llm.analysis
package org.mockserver.llm.analysis
-
ClassDescriptionDeterministic, read-only analysis of an agent run reconstructed from recorded LLM requests.The correlated call graph of an agent run.A directed edge in the agent-run call graph.A node in the agent-run call graph.Structural summary of an agent run (for
explain_agent_run).A single tool call the assistant made.Result of averify_tool_call-style inspection.Deterministic, prompt-level diff of two recorded agent runs.A single message-level difference between the two runs.The full diff of two runs.One side of the diff: the recorded requests, the provider, and optional usage totals.Token / cost deltas (after − before).Turns captured LLM sessions (the samerequest/response pairsthe optimisation report is built from) into datasets that off-the-shelf eval / fine-tune tooling consumes:LlmDatasetExporter.DatasetFormat.OPENAI_EVALS— OpenAI-evals JSONL: one sample per line,{"input":[messages…],"ideal":"<assistant response>"}.LlmDatasetExporter.DatasetFormat.FINE_TUNE— chat fine-tune JSONL: one conversation per line,{"messages":[…,{"role":"assistant","content":…}]}(the prompt messages plus the captured assistant turn).LlmDatasetExporter.DatasetFormat.PROMPTFOO— a promptfoo test-suite JSON document:{"tests":[{"vars":{"messages":[…]},"assert":[{"type":"equals", "value":"<assistant response>"}]}]}.The supported dataset export formats.Renders anLlmOptimisationReportto a copy-paste Markdown "optimisation brief" — bundle (A) of the LLM optimisation export feature.Renders anLlmOptimisationReportto CSV — a third export format alongside the JSON bundle and the Markdownbrief.Structured, deterministic optimisation report for a captured LLM session (the JSON bundle "B" of the LLM optimisation export feature).One captured LLM call (request/response exchange).A structured, copy-paste-friendly remediation for aLlmOptimisationReport.Signal.How the captured traffic was grouped into one report.What redaction was applied before the report/brief was produced.Identity and scope of the session this report covers.A deterministic optimisation lead.A single assistant tool call observed in a call.Aggregated counts across every included call.A deterministic, in-product verdict — A–F grade plus the recoverable-spend headline.Builds a deterministicLlmOptimisationReportfrom captured LLMFORWARDED_REQUESTexchanges.A transport-agnostic captured exchange: the forwarded request, the upstream response, and the request timestamp in epoch millis (ornullwhen unknown).Application service that turns capturedREQUEST_RESPONSESlog entries into anLlmOptimisationReport(JSON bundle) or a rendered Markdown brief, applying the optionalsession/host/providerfilters, redaction, and themockserver.llmOptimisationMaxCallsbound.Optional filters; null/blank means "no filter".The built report plus the markdown brief, so callers render once.Deterministic optimisation-signal detectors over the assembled calls of anLlmOptimisationReport.