The CREATE_AI_MODEL_ENDPOINT procedure creates an access endpoint for an AI model object. You must specify the endpoint 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 endpoint of the AI model object. | VARCHAR(128) | NO | |
| params | ai_model_name specifies the name of the AI model object created by the CREATE_AI_MODEL procedure. |
JSON STRING | NO | |
url specifies the complete URL of the endpoint of the AI model service, which is the specific interface address for features such as chat, embedding, or reranking, not the base URL. |
JSON STRING | NO | ||
access_key specifies the access key of the endpoint. |
JSON STRING | NO | ||
request_model_name specifies the user-defined model name, such as big-m3-custom, placed in the request body. |
JSON STRING | YES, can be empty or unspecified | ||
provider specifies the model provider. |
JSON STRING |
|
NO |
Value range of the url parameter:
| Vendor | Type | Description/Example |
|---|---|---|
| Alibaba Cloud (OpenAI-compatible format) |
complete | https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions |
| embedding | https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings | |
| Alibaba Cloud DashScope (Non-OpenAI-compatible 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 (OpenAI-compatible format) |
complete | https://api.deepseek.com/chat/completions |
| SiliconFlow (OpenAI-compatible format) |
complete | https://api.siliconflow.cn/v1/chat/completions |
| embedding | https://api.siliconflow.cn/v1/embeddings | |
| rerank | https://api.siliconflow.cn/v1/rerank | |
| Tencent Hunyuan (OpenAI-compatible API) |
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 with 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"
}');
