AI_COMPLETE¶
备注
AI_COMPLETE 是 COMPLETE (SNOWFLAKE.CORTEX) 的更新版本。要获得最新功能,请使用 AI_COMPLETE。
使用支持的语言模型从文本或图像生成响应(补全)。您可以提供:
文本提示,用于根据模型生成响应。有关更多信息,请参阅 AI_COMPLETE(单字符串)。
单个图像和文本提示,用于根据图像和提示生成响应。有关更多信息,请参阅 AI_COMPLETE(单张图像)。
可以支持多个图像和文本的提示对象。有关更多信息,请参阅 AI_COMPLETE(提示对象)。
语法¶
该函数的语法取决于您提供的输入类型。有关语法的信息,请参阅以下部分:
访问控制要求¶
Users must use a role that has been granted the SNOWFLAKE.CORTEX_USER database role. See Cortex LLM privileges for more information on this privilege.
Error handling¶
By default, an AI_COMPLETE stops running when there's an error on a row. This behavior can disrupt large batch operations where an error can stop all processing. With error handling enabled, AI_COMPLETE can return NULL or an error object for rows that encounter non-fatal errors, while continuing to process other rows.
Use the following code to enable error handling for your session:
ALTER SESSION SET AI_SQL_ERROR_HANDLING_USE_FAIL_ON_ERROR=false;
For more information about error handling, see the following sections:
法律声明¶
有关法律声明,请参阅 Snowflake AI 和 ML。
限制¶
Snowflake Cortex 函数不支持动态表。