This commit is contained in:
Huong Nguyen
2025-02-06 09:26:09 +07:00
2 changed files with 1 additions and 3 deletions
+1 -1
View File
@@ -380,7 +380,7 @@ class manager {
$provider = new $classname(
enabled: $enabled,
name: $name,
config: $config ? json_encode($config) : '',
config: json_encode($config ?? []),
);
$id = $this->db->insert_record('ai_providers', $provider->to_record());
@@ -41,11 +41,9 @@ final class provider_test extends \advanced_testcase {
// Create the provider instance.
$this->manager = \core\di::get(\core_ai\manager::class);
$config = ['data' => 'goeshere'];
$this->provider = $this->manager->create_provider_instance(
classname: '\aiprovider_openai\provider',
name: 'dummy',
config: $config,
);
}