Luminova Framework

AI Model

Last updated: 2024-07-25 19:23:37

The AI Model class, allows easy interaction with different AI models interchangeably without the need to manually initialize the AI class and pass API keys every time. It leverages the AI configuration class app\Config\AI to manage these settings.


  • Class namespace: \Luminova\Ai\Model
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Methods

constructor

Initialize model instance with AI interface.

public __construct(\Luminova\Interface\AiInterface $ai = null): mixed

Parameters:

ParameterTypeDescription
$ai\Luminova\Interface\AiInterfaceThe AI object to use (default: OpenAI).

getAiModel

Retrieves the instance of the AI interface.

public getAiModel(): \Luminova\Interface\AiInterface

Return Value:\Luminova\Interface\AiInterface - Return the AI object.