SQL reference

更新时间:
复制 MD 格式

This topic lists the functions available for Polar_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.

Model services

  • General-purpose text embedding.

    Function

    Description

    AI_Text_Embedding

    Calls an existing general-purpose text embedding model to convert text into vectors online. If you do not specify a model, the function calls the built-in model _dashscope/text_embedding/text_embedding_v2.

  • Open-domain text understanding.

    Function

    Description

    AI_Text_Classification

    Calls a text comprehension model for tasks such as sentiment classification, topic classification, or information extraction. If you do not specify a model, the function calls the built-in model _dashscope/text-classfication/opennlu-v1.

  • Text conversation.

    Function name

    Description

    AI_Text_Generation

    Calls a text generation model for tasks such as text conversation and Q&A pairs. If a model is not specified, the function uses the default built-in model _dashscope/text-generation/deepseek-r1.

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.