The REGISTER_PROVIDER procedure is used to create an AI provider configuration within a tenant. A provider manages model service connection information and access credentials. After configuration, you can call AI functions in the provider/model format. Built-in and custom providers are supported.
Note
This process is supported starting from V4.6.0 BP1.
Syntax
PROCEDURE register_provider(
IN provider_name VARCHAR(256),
IN json_params JSON);
Parameters
Parameter |
Description |
Type |
Value range |
Nullable |
|---|---|---|---|---|
| provider_name | Provider name. | VARCHAR(256) | Up to 256 bytes | NO |
| json_params | Provider configuration, which must be a JSON object. | JSON | See the following table | NO |
The json_params parameter supports the following fields:
field |
Type |
Required |
Description |
|---|---|---|---|
protocol |
VARCHAR(256) | No | Communication protocol. The default for custom providers is openai. This parameter can be omitted when a built-in provider is registered for the first time, as the system automatically fills in the default value. |
base_url |
VARCHAR(2048) | Yes (required when a custom provider is created for the first time) | The base URL of the model service. This parameter can be omitted for built-in providers, as the system automatically populates it. |
access_key |
VARCHAR(2048) | Yes | Access credentials, stored in encrypted form during write operations. |
Notice
If a provider with the same name already exists, use ALTER_PROVIDER to update the configuration.
Built-in providers
The current version includes built-in default values for the protocol and base_url parameters of the following providers. These default values are preset configurations and are not directly written to system tables. When executing the REGISTER_PROVIDER statement, if the provider is a built-in type and the protocol or base_url parameter is not specified, the system will automatically fill in the missing values:
provider |
protocol |
base_url |
|---|---|---|
aliyun |
openai |
https://dashscope.aliyuncs.com/compatible-mode/v1 |
aliyun-dashscope |
dashscope |
https://dashscope.aliyuncs.com/api/v1 |
deepseek |
openai |
https://api.deepseek.com |
siliconflow |
openai |
https://api.siliconflow.cn/v1 |
openai |
openai |
https://api.openai.com/v1 |
cohere |
cohere |
https://api.cohere.com/v2 |
tencent |
openai |
https://api.hunyuan.cloud.tencent.com/v1 |
Examples
To register a built-in provider, you only need to specify the access_key:
CALL DBMS_AI_SERVICE.REGISTER_PROVIDER('aliyun', '{
"access_key": "sk-xxxx"
}');
Register a custom provider:
CALL DBMS_AI_SERVICE.REGISTER_PROVIDER('ob-mass', '{
"protocol": "openai",
"base_url": "https://example.com/v1",
"access_key": "sk-xxxx"
}');
