Provider interface 

interface ProviderInterface
Fully qualified name
\Netresearch\NrLlm\Provider\Contract\ProviderInterface

Contract for LLM providers.

getName(): string

Get human-readable provider name.

getIdentifier(): string

Get provider identifier for configuration.

configure(array $config): void

Configure the provider with API key and settings.

param array $config

Configuration key-value pairs

isAvailable(): bool

Check if provider is available and configured.

supportsFeature(string|ModelCapability $feature): bool

Check if provider supports a specific feature.

chatCompletion(array $messages, array $options = []): CompletionResponse

Execute chat completion.

param array $messages

Messages with role and content. Content can be a string (plain text) or an array of content blocks for multimodal input (text, image_url, document).

complete(string $prompt, array $options = []): CompletionResponse

Execute simple completion from a prompt.

embeddings(string|array $input, array $options = []): EmbeddingResponse

Generate embeddings for text.

getAvailableModels(): array

Get list of available models.

getDefaultModel(): string

Get the default model identifier.

testConnection(): array

Test the connection to the provider.

throws

ProviderConnectionException

Returns

array{success, message, models?}

interface VisionCapableInterface
Fully qualified name
\Netresearch\NrLlm\Provider\Contract\VisionCapableInterface

Contract for providers supporting vision/image analysis.

analyzeImage(array $content, array $options = []): VisionResponse

Analyze an image.

param array $content

Array of content parts (text and image_url entries)

param array $options

Optional configuration

Returns

VisionResponse

supportsVision(): bool

Check if vision is supported.

getSupportedImageFormats(): array

Get supported image formats.

getMaxImageSize(): int

Get maximum image size in bytes.

interface StreamingCapableInterface
Fully qualified name
\Netresearch\NrLlm\Provider\Contract\StreamingCapableInterface

Contract for providers supporting streaming.

streamChatCompletion(array $messages, array $options = []): Generator

Stream chat completion.

supportsStreaming(): bool

Check if streaming is supported.

interface ToolCapableInterface
Fully qualified name
\Netresearch\NrLlm\Provider\Contract\ToolCapableInterface

Contract for providers supporting tool/function calling.

chatCompletionWithTools(array $messages, array $tools, array $options = []): CompletionResponse

Chat with tool calling. Messages support multimodal content (string or array of content blocks).

supportsTools(): bool

Check if tool calling is supported.