AIAgentLLMSession
Represents a session for an AI agent that interacts with an LLM (Language Learning Model). The session manages prompt execution, structured outputs, and tools integration.
This is a sealed class that provides common behavior and lifecycle management for derived types. It ensures that operations are only performed while the session is active and allows proper cleanup upon closure.
Inheritors
Functions
Sends a request to the underlying LLM and returns the first response. This method ensures the session is active before executing the request.
Sends a request to the language model while enforcing the use of a specific tool, and returns the response.
Sends a request to the language model, potentially utilizing multiple tools, and returns a list of responses from the model.
Sends a request to the language model, potentially receiving multiple choices, and returns a list of choices from the model.
Sends a request to the language model that enforces the usage of tools and retrieves the response.
Coerce LLM to provide a structured output.
Expect LLM to reply in a structured format and try to parse it. For more robust version with model coercion and correction see requestLLMStructured
Sends a request to the language model without utilizing any tools and returns the response.
Sends a moderation request to the specified or default large language model (LLM) for content moderation.