52 lines
1.3 KiB
Plaintext
52 lines
1.3 KiB
Plaintext
/**
|
|
* Registers the service provider with a DI container.
|
|
*
|
|
* @param Container $container The DI container.
|
|
*
|
|
* @return void
|
|
* @since 3.2.0
|
|
*/
|
|
public function register(Container $container)
|
|
{
|
|
$container->alias(GetBible::class, 'GetBible.AI')
|
|
->share('GetBible.AI', [$this, 'getAI'], true);
|
|
|
|
$container->alias(Engineer::class, 'GetBible.AI.Engineer')
|
|
->share('GetBible.AI.Engineer', [$this, 'getEngineer'], true);
|
|
}
|
|
|
|
/**
|
|
* Get the GetBible AI class
|
|
*
|
|
* @param Container $container The DI container.
|
|
*
|
|
* @return GetBible
|
|
* @since 3.2.0
|
|
*/
|
|
public function getAI(Container $container): GetBible
|
|
{
|
|
return new GetBible(
|
|
$container->get('GetBible.Config'),
|
|
$container->get('GetBible.Response'),
|
|
$container->get('GetBible.AI.Engineer')
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the Engineer AI class
|
|
*
|
|
* @param Container $container The DI container.
|
|
*
|
|
* @return Engineer
|
|
* @since 3.2.0
|
|
*/
|
|
public function getEngineer(Container $container): Engineer
|
|
{
|
|
return new Engineer(
|
|
$container->get('GetBible.Scripture'),
|
|
$container->get('GetBible.Prompt'),
|
|
$container->get('GetBible.Placeholders'),
|
|
$container->get('Openai.Chat'),
|
|
$container->get('GetBible.Insert')
|
|
);
|
|
} |