LlmRequest class
Full model request payload used by LLM adapters.
Constructors
-
LlmRequest({String? model, List<
Content> ? contents, GenerateContentConfig? config, LiveConnectConfig? liveConnectConfig, Map<String, BaseTool> ? toolsDict, Object? cacheConfig, Object? cacheMetadata, int? cacheableContentsTokenCount, String? previousInteractionId}) - Creates an LLM request.
Properties
- cacheableContentsTokenCount ↔ int?
-
Number of tokens eligible for caching.
getter/setter pair
- cacheConfig ↔ Object?
-
Cache creation/update configuration payload.
getter/setter pair
- cacheMetadata ↔ Object?
-
Cache metadata returned by providers.
getter/setter pair
- config ↔ GenerateContentConfig
-
Generation config for standard model calls.
getter/setter pair
-
contents
↔ List<
Content> -
Conversation contents sent to the model.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- liveConnectConfig ↔ LiveConnectConfig
-
Connection config for realtime model calls.
getter/setter pair
- model ↔ String?
-
Target model identifier.
getter/setter pair
- previousInteractionId ↔ String?
-
Previous interaction ID for conversational continuity.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
toolsDict
↔ Map<
String, BaseTool> -
Runtime lookup map for declared tools by name.
getter/setter pair
Methods
-
appendInstructions(
Object instructions) → List< Content> -
Appends
instructionsto this request as system text and user content. -
appendTools(
List< BaseTool> tools) → void -
Appends tool declarations from
toolsto this request. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sanitizedForModelCall(
) → LlmRequest - Returns a sanitized clone safe for backend model calls.
-
setOutputSchema(
Object schema) → void -
Sets structured output
schemaand JSON response MIME type. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited