Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Form/OchaAiConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Drupal\ocha_ai\Form;

use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\ocha_ai\Plugin\AnswerValidatorPluginManagerInterface;
Expand Down Expand Up @@ -88,6 +89,8 @@ class OchaAiConfigForm extends ConfigFormBase {
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager
* The typed config manager service.
* @param \Drupal\ocha_ai\Plugin\AnswerValidatorPluginManagerInterface $answer_validator_plugin_manager
* The answer validator plugin manager.
* @param \Drupal\ocha_ai\Plugin\CompletionPluginManagerInterface $completion_plugin_manager
Expand All @@ -107,6 +110,7 @@ class OchaAiConfigForm extends ConfigFormBase {
*/
public function __construct(
ConfigFactoryInterface $config_factory,
TypedConfigManagerInterface $typed_config_manager,
AnswerValidatorPluginManagerInterface $answer_validator_plugin_manager,
CompletionPluginManagerInterface $completion_plugin_manager,
EmbeddingPluginManagerInterface $embedding_plugin_manager,
Expand All @@ -116,7 +120,7 @@ public function __construct(
TextSplitterPluginManagerInterface $text_splitter_plugin_manager,
VectorStorePluginManagerInterface $vector_store_plugin_manager,
) {
parent::__construct($config_factory);
parent::__construct($config_factory, $typed_config_manager);

$this->answerValidatorPluginManager = $answer_validator_plugin_manager;
$this->completionPluginManager = $completion_plugin_manager;
Expand All @@ -134,6 +138,7 @@ public function __construct(
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('config.typed'),
$container->get('plugin.manager.ocha_ai.answer_validator'),
$container->get('plugin.manager.ocha_ai.completion'),
$container->get('plugin.manager.ocha_ai.embedding'),
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/ocha_ai/Ranker/OchaAiHelperRanker.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function rankTexts(string $text, array $texts, string $language, ?int $li
$endpoint = $this->getPluginSetting('endpoint');

try {
$response = $client = $this->httpClient->post($endpoint, [
$response = $this->httpClient->post($endpoint, [
'json' => [
'language' => $language,
'text' => $text,
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/ocha_ai/TextSplitter/NLPSentence.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function splitText(string $text, ?int $length = NULL, ?int $overlap = NUL
$endpoint = $this->getPluginSetting('endpoint');

try {
$response = $client = $this->httpClient->post($endpoint, [
$response = $this->httpClient->post($endpoint, [
'json' => [
'language' => $language,
'text' => $text,
Expand Down
Loading