Skip to content

Commit 8ffd374

Browse files
committed
[docs] AI providers: Add minimal configuration (MDL-83381)
1 parent 7a34f71 commit 8ffd374

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/apis/plugintypes/ai/provider.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,19 @@ For example, the `aiprovider_openai` plugin provides settings for the user and g
226226
));
227227
$settings->hide_if('aiprovider_openai/userratelimit', 'aiprovider_openai/enableuserratelimit', 'eq', 0);
228228
```
229+
230+
## Minimal configuration
231+
232+
Each provider will need to specify what it takes to achieve minimal configuration. The parent method `is_provider_configured()` will
233+
return `false` by default and will need to be overwritten by the child class.
234+
235+
The `is_provider_configured()` must return `true` for UI component visibility and functionality.
236+
237+
For example, the `aiprovider_azureai` provider checks values are set for `$this->apikey` and `$this->apiendpoint` and returns
238+
the result.
239+
240+
```php
241+
public function is_provider_configured(): bool {
242+
return !empty($this->apikey) && !empty($this->apiendpoint);
243+
}
244+
```

0 commit comments

Comments
 (0)