Skip to content
docsv0.2.0

LlmServiceInterface

Interface for LLM (Large Language Model) services. Plugins can provide this interface to enable AI capabilities. Other plugins can require this interface to consume AI services.

LlmServiceInterface::generateResponse()

abstract public function generateResponse(string $prompt, array $tools = [], array $messages = [], int $maxTokens = 4096): array

Generate a response from the LLM.

Parameters

Parameters of generateResponse()
NameTypeDescription
$promptstringThe user prompt
$toolslist<array<string, mixed>>Available tools in MCP format
$messageslist<array<string, mixed>>Conversation history
$maxTokensint

Returns

The LLM response (OpenAI-compatible format)