All Products
Search
Document Center

PolarDB:SQL references

Last Updated:Apr 09, 2025

This topic provides an overview of the functions and parameters available for PolarDB for AI.

Model management

Function

Description

AI_CreateModel

Creates a model and registers it in a metadata table.

AI_AlterModel

Modifies the information of a model.

AI_SetModelToken

Sets token information for one or more models.

AI_CallModel

Calls a model to execute machine learning and natural language processing (NLP) tasks such as sentiment analysis, question-answering, translation, summarization, and text generation.

AI_DropModel

Deletes a model.

GUC settings

Parameter

Description

polar.ai.http_keep_alive

Specifies whether to enable persistent HTTP connections.

polar.ai.http_timeout_mesc

The timeout duration for HTTP connections. Unit: milliseconds.

polar.ai.retry_times

The maximum number of retry attempts for failed HTTP requests.

polar.ai.retry_interval_msec

The interval between retry attempts for failed HTTP requests. Unit: milliseconds.

Polar.ai.lru_entity_size

The size of the model metadata cache in the database.

Helper functions

Function

Description

AI_ResizeImage

Resizes an image.

AI_ImageAsBase64

Converts an image into a Base64-encoded string.

AI_ImageFromBase64

Converts a Base64-encoded string into an image.

AI_LoadFile

Loads a file from Object Storage Service (OSS).

AI_ModelCacheLists

Returns a list of currently cached models.