LlmProvider class abstract

LLM provider interface for mcp_llm internal use.

This is mcp_llm's internal interface using its own type system. For integration with other MCP packages, use LlmPortAdapter which implements mcp_bundle.LlmPort and converts between type systems.

Constructors

LlmProvider()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportsPromptCaching bool
Whether this provider applies the CacheHints on a request. Providers that do not implement prompt caching return false and silently ignore hints. See mcp_llm package docs for the per- provider default policy when LlmRequest.cacheHints is null.
no setter

Methods

close() Future<void>
Close and cleanup resources.
complete(LlmRequest request) Future<LlmResponse>
Complete a request using mcp_llm's internal types.
extractToolCallFromMetadata(Map<String, dynamic> metadata) LlmToolCall?
Extracts a tool call from metadata if present.
getEmbeddings(String text) Future<List<double>>
Get embeddings for text.
hasToolCallMetadata(Map<String, dynamic> metadata) bool
Checks if a metadata map contains tool call information.
initialize(LlmConfiguration config) Future<void>
Initialize the LLM with configuration.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
standardizeMetadata(Map<String, dynamic> metadata) Map<String, dynamic>
Standardizes the provider-specific metadata to a common format. This can be used to ensure consistent metadata across different providers.
streamComplete(LlmRequest request) Stream<LlmResponseChunk>
Stream completion using mcp_llm's internal types.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited