Package org.mockserver.llm
Class ProviderDetector
java.lang.Object
org.mockserver.llm.ProviderDetector
Deterministic, read-only heuristic that infers the
Provider from an
HttpRequest's path (and, as a fallback, its Host header). This
mirrors the UI-side provider detection in llmTraffic.ts and is used
by the MCP analysis tools to support an "AUTO" provider value for
proxied traffic where the caller may not know which provider was recorded.
Detection order matches the UI: Anthropic, Azure OpenAI, Bedrock, OpenAI Responses, OpenAI Chat Completions, Gemini, Ollama. The first match wins.
-
Method Summary
Modifier and TypeMethodDescriptiondetect(HttpRequest request) Attempt to detect the LLM provider from an HTTP request's path.detectFromPath(String path) Detect the provider from a request path string alone.detectFromRequests(List<HttpRequest> requests) Auto-detect the provider from a list of recorded requests by scanning their paths.
-
Method Details
-
detect
Attempt to detect the LLM provider from an HTTP request's path. Returns empty if no provider can be inferred. -
detectFromPath
Detect the provider from a request path string alone. -
detectFromRequests
Auto-detect the provider from a list of recorded requests by scanning their paths. Returns the first detected provider, or empty if none can be inferred.
-