|
array readonly array | $actionconfig |
| The action specific settings for this instance.
|
|
array readonly array | $config |
| The configuration for this instance.
|
|
string readonly string | $provider |
| $provider The provider used to make this instance
|
|
◆ add_authentication_headers()
aiprovider_openai\provider::add_authentication_headers |
( |
RequestInterface | $request | ) |
|
Update a request to add any headers required by the provider (if needed).
AI providers will need to override this method to add their own headers.
- Parameters
-
- Return values
-
Reimplemented from core_ai\provider.
◆ generate_userid()
core_ai\provider::generate_userid |
( |
string | $userid | ) |
|
|
inherited |
Generate a user id.
This is a hash of the site id and user id, this means we can determine who made the request but don't pass any personal data to the AI provider.
- Parameters
-
string | $userid | The user id. |
- Return values
-
string | The generated user id. |
◆ get_action_list()
static aiprovider_openai\provider::get_action_list |
( |
| ) |
|
|
static |
Get the list of actions that this provider supports.
- Return values
-
array | An array of action class names. |
Reimplemented from core_ai\provider.
◆ get_action_setting_defaults()
static aiprovider_openai\provider::get_action_setting_defaults |
( |
string | $action | ) |
|
|
static |
Get the default settings for an action.
- Parameters
-
string | $action | The action class name. |
- Return values
-
array | The default settings for the action. |
Reimplemented from core_ai\provider.
◆ get_action_settings()
static aiprovider_openai\provider::get_action_settings |
( |
string | $action, |
|
|
array | $customdata = [] ) |
|
static |
Get any action settings for this provider.
- Parameters
-
string | $action | The action class name. |
array | $customdata | The customdata for the form. |
- Return values
-
action_settings_form|bool | The settings form for this action or false in no settings. |
Reimplemented from core_ai\provider.
◆ get_name()
core_ai\provider::get_name |
( |
| ) |
|
|
inherited |
Get the name of the provider.
- Return values
-
string | The name of the provider. |
◆ get_sub_actions()
core_ai\provider::get_sub_actions |
( |
string | $classname | ) |
|
|
inherited |
Given an action class name, return an array of sub actions that this provider supports.
- Parameters
-
string | $classname | The action class name. |
- Return values
-
array | An array of supported sub actions. |
◆ initialise_action_settings()
static core_ai\provider::initialise_action_settings |
( |
| ) |
|
|
staticinherited |
Initialise the action settings array.
- Return values
-
array | The initialised action settings. |
◆ is_provider_configured()
aiprovider_openai\provider::is_provider_configured |
( |
| ) |
|
Check this provider has the minimal configuration to work.
- Return values
-
bool | Return true if configured. |
Reimplemented from core_ai\provider.
◆ is_request_allowed()
Check if the request is allowed by the rate limiter.
- Parameters
-
aiactions::base | $action | The action to check. |
- Return values
-
array|bool | True on success, array of error details on failure. |
◆ to_record()
core_ai\provider::to_record |
( |
| ) |
|
|
inherited |
Convert this object to a stdClass, suitable for saving to the database.
- Return values
-
The documentation for this class was generated from the following file:
- ai/provider/openai/classes/provider.php