The CREATE_AI_MODEL_ENDPOINT procedure is used to create an endpoint for accessing an AI model object. You must specify the endpoint's address, access key, model provider, and other attributes.
Syntax
PROCEDURE create_ai_model_endpoint(
IN name VARCHAR(128),
IN params JSON);
Parameters
Parameter |
Description |
Type |
Value range |
Nullable |
|---|---|---|---|---|
| name | The name of the access endpoint for the AI model object. | VARCHAR(128) | NO | |
| params | ai_model_name, the name of the AI model object created by the CREATE_AI_MODEL procedure. |
JSON STRING | NO | |
url, which is the complete URL of the AI model service endpoint, that is, the specific API address for features such as chat, embedding, or reordering, rather than the base URL. |
JSON STRING | NO | ||
access_key, which is the access key for accessing the endpoint. |
JSON STRING | NO | ||
request_model_name, which indicates the user-defined model name, for example, big-m3-custom. This parameter is placed in the request body. |
JSON STRING | YES. It can be empty or unspecified. | ||
provider, which indicates the model provider. |
JSON STRING |
|
NO |
The value range of the url parameter is as follows:
Vendor |
Type |
Note/Example |
|---|---|---|
| Alibaba Cloud (compatible with OpenAI format) |
complete | https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions |
| embedding | https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings | |
| Alibaba Cloud DashScope (Not compatible with OpenAI format) |
complete | https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation |
| embed | https://dashscope.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding | |
| rerank | https://dashscope.aliyuncs.com/api/v1/services/rerank/text-rerank/text-rerank | |
| deepseek (compatible with OpenAI format) |
complete | https://api.deepseek.com/chat/completions |
| Silicon-based flow (compatible with OpenAI format) |
complete | https://api.siliconflow.cn/v1/chat/completions |
| embedding | https://api.siliconflow.cn/v1/embeddings | |
| rerank | https://api.siliconflow.cn/v1/rerank | |
| Tencent MixNLP Large Model (compatible with OpenAI interface) |
complete | https://api.hunyuan.cloud.tencent.com/v1/chat/completions |
| embedding | https://api.hunyuan.cloud.tencent.com/v1/embeddings |
Examples
Create an AI model object of type dense_embedding and the large model text-embedding-v2.
CALL DBMS_AI_SERVICE.CREATE_AI_MODEL_ENDPOINT (
'my_model_endpoint1', '{
"ai_model_name": "my_model1",
"url": "https://api.deepseek.com/chat/completions",
"access_key": "sk-xxxxxxxxxxxx",
"request_model_name": "deepseek-chat",
"provider": "deepseek"
}');