mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'MDL-83381-main' of https://github.com/davewoloszyn/moodle
This commit is contained in:
commit
7014d61d93
@ -28,7 +28,6 @@ Feature: AI Course assist summarise
|
||||
And I enable "openai" "aiprovider" plugin
|
||||
And the following config values are set as admin:
|
||||
| apikey | 123 | aiprovider_openai |
|
||||
| orgid | abc | aiprovider_openai |
|
||||
And I enable "courseassist" "aiplacement" plugin
|
||||
|
||||
@javascript
|
||||
|
@ -47,7 +47,6 @@ final class utils_test extends \advanced_testcase {
|
||||
|
||||
set_config('enabled', 1, 'aiprovider_openai');
|
||||
set_config('apikey', '123', 'aiprovider_openai');
|
||||
set_config('orgid', 'abc', 'aiprovider_openai');
|
||||
|
||||
// Plugin is not enabled.
|
||||
$this->setUser($user1);
|
||||
|
@ -73,7 +73,6 @@ final class utils_test extends \advanced_testcase {
|
||||
|
||||
set_config('enabled', 1, 'aiprovider_openai');
|
||||
set_config('apikey', '123', 'aiprovider_openai');
|
||||
set_config('orgid', 'abc', 'aiprovider_openai');
|
||||
|
||||
// Plugin is not enabled.
|
||||
$this->setUser($this->users[1]);
|
||||
|
@ -214,6 +214,6 @@ class provider extends \core_ai\provider {
|
||||
* @return bool Return true if configured.
|
||||
*/
|
||||
public function is_provider_configured(): bool {
|
||||
return !empty($this->apikey) && !empty($this->orgid);
|
||||
return !empty($this->apikey);
|
||||
}
|
||||
}
|
||||
|
@ -121,15 +121,8 @@ final class provider_test extends \advanced_testcase {
|
||||
$provider = new \aiprovider_openai\provider();
|
||||
$this->assertFalse($provider->is_provider_configured());
|
||||
|
||||
// Partially configured values.
|
||||
set_config('apikey', '123', 'aiprovider_openai');
|
||||
set_config('orgid', '', 'aiprovider_openai');
|
||||
$provider = new \aiprovider_openai\provider();
|
||||
$this->assertFalse($provider->is_provider_configured());
|
||||
|
||||
// Properly configured values.
|
||||
set_config('apikey', '123', 'aiprovider_openai');
|
||||
set_config('orgid', 'abc', 'aiprovider_openai');
|
||||
$provider = new \aiprovider_openai\provider();
|
||||
$this->assertTrue($provider->is_provider_configured());
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ Feature: An administrator can manage AI subsystem settings
|
||||
And I should see "OpenAI API Provider enabled."
|
||||
And the following config values are set as admin:
|
||||
| apikey | 123 | aiprovider_openai |
|
||||
| orgid | abc | aiprovider_openai |
|
||||
And I navigate to "AI > AI placements" in site administration
|
||||
And I click on the "Settings" link in the table row containing "HTML Text Editor Placement"
|
||||
Then I should not see "This action is unavailable."
|
||||
@ -57,7 +56,6 @@ Feature: An administrator can manage AI subsystem settings
|
||||
And I should see "OpenAI API Provider enabled."
|
||||
And the following config values are set as admin:
|
||||
| apikey | 123 | aiprovider_openai |
|
||||
| orgid | abc | aiprovider_openai |
|
||||
And I click on the "Settings" link in the table row containing "OpenAI API Provider"
|
||||
And I toggle the "Generate text" admin switch "off"
|
||||
And I navigate to "AI > AI placements" in site administration
|
||||
|
@ -75,7 +75,6 @@ final class manager_test extends \advanced_testcase {
|
||||
$this->resetAfterTest();
|
||||
set_config('enabled', 1, 'aiprovider_openai');
|
||||
set_config('apikey', '123', 'aiprovider_openai');
|
||||
set_config('orgid', 'abc', 'aiprovider_openai');
|
||||
|
||||
$manager = \core\di::get(manager::class);
|
||||
$actions = [
|
||||
@ -144,7 +143,6 @@ final class manager_test extends \advanced_testcase {
|
||||
// Enable the providers.
|
||||
set_config('enabled', 1, 'aiprovider_openai');
|
||||
set_config('apikey', '123', 'aiprovider_openai');
|
||||
set_config('orgid', 'abc', 'aiprovider_openai');
|
||||
set_config('enabled', 1, 'aiprovider_azureai');
|
||||
set_config('apikey', '123', 'aiprovider_azureai');
|
||||
set_config('endpoint', 'abc', 'aiprovider_azureai');
|
||||
@ -420,7 +418,6 @@ final class manager_test extends \advanced_testcase {
|
||||
$manager = \core_plugin_manager::resolve_plugininfo_class('aiprovider');
|
||||
$manager::enable_plugin('openai', 1);
|
||||
set_config('apikey', '123', 'aiprovider_openai');
|
||||
set_config('orgid', 'abc', 'aiprovider_openai');
|
||||
|
||||
// Should now be available.
|
||||
$result = manager::is_action_available($action);
|
||||
|
@ -31,7 +31,6 @@ Feature: Generate image using AI
|
||||
And I enable "openai" "aiprovider" plugin
|
||||
And the following config values are set as admin:
|
||||
| apikey | 123 | aiprovider_openai |
|
||||
| orgid | abc | aiprovider_openai |
|
||||
And I enable "editor" "aiplacement" plugin
|
||||
|
||||
@javascript
|
||||
|
@ -32,7 +32,6 @@ Feature: Generate text using AI
|
||||
And I enable "openai" "aiprovider" plugin
|
||||
And the following config values are set as admin:
|
||||
| apikey | 123 | aiprovider_openai |
|
||||
| orgid | abc | aiprovider_openai |
|
||||
And I enable "editor" "aiplacement" plugin
|
||||
|
||||
@javascript
|
||||
|
Loading…
x
Reference in New Issue
Block a user