LLMContextDetector Class

Detects known LLM and agentic execution contexts from environment variables.

public static class LLMContextDetector

Methods

NameDescription
Detect()Detects all known LLM and agentic execution contexts in the current environment.
IsLLMContext()Determines whether the current environment is a known LLM or agentic execution context.

Detects all known LLM and agentic execution contexts in the current environment.

public static IReadOnlyList<LLMContextKind> Detect()

Returns

IReadOnlyList<LLMContextKind> The detected contexts, in a stable order.

IsLLMContext()

LLMContextDetector.cs

Determines whether the current environment is a known LLM or agentic execution context.

public static bool IsLLMContext()

Returns

bool true when a known context is detected; otherwise, false.