AI Model
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:
Parameter | Type | Description |
---|---|---|
$ai | \Luminova\Interface\AiInterface | The 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.