- Categories:
String & binary functions (AI Functions)
AI_ COMPLETE(单张图像)¶
Note
AI_COMPLETE is the updated version of . For the latest functionality, use AI_COMPLETE.
使用支持的语言模型,根据文本提示生成响应(补全)。该函数的此变体为 AI_COMPLETE 增强了文档理解能力。提示可以引用包含文档的文件中找到的信息或图像。该函数支持单个文档输入。
语法
The function has three required arguments and one optional argument. The function can be used with either positional or named argument syntax.
将 AI_COMPLETE 与单个图像输入结合使用:
实参
model指定要使用模型的字符串。指定以下模型之一:
claude-3-7-sonnetclaude-4-opusclaude-4-sonnetclaude-haiku-4-5claude-opus-4-5claude-opus-4-6claude-opus-4-7claude-sonnet-4-5claude-sonnet-4-6gemini-3.1-prollama4-maverickllama4-scoutopenai-gpt-4.1openai-gpt-5openai-gpt-5-chatopenai-gpt-5-miniopenai-gpt-5-nanoopenai-gpt-5.1openai-gpt-5.2openai-gpt-5.4pixtral-large
Supported models might have different costs.
predicate字符串提示符。
file代表图像的 FILE 类型对象。
model_parametersAn object containing zero or more of the following options that affect the model’s hyperparameters. See LLM Settings (https://www.promptingguide.ai/introduction/settings).
temperature: A value from 0 to 1 (inclusive) that controls the randomness of the output of the language model. A higher temperature (for example, 0.7) results in more diverse and random output, while a lower temperature (such as 0.2) makes the output more deterministic and focused.
默认值:0
top_p: A value from 0 to 1 (inclusive) that controls the randomness and diversity of the language model, generally used as an alternative totemperature. The difference is thattop_prestricts the set of possible tokens that the model outputs, whiletemperatureinfluences which tokens are chosen at each step.
默认值:0
max_tokens: Sets the maximum number of output tokens in the response. Small values can result in truncated responses.
默认值:4096。最大允许值:8192
guardrails: Filters potentially unsafe and harmful responses from a language model using Cortex Guard. EitherTRUEorFALSE. The default value isFALSE.
返回
返回来自语言模型的字符串响应。
示例
The following examples demonstrate the basic capabilities of the AI_COMPLETE function with images.
视觉问答
通货膨胀率图表用于回答有关数据的问题。

Comparison between inflation rates in 2023 and in 2024 (Statista (https://www.statista.com/))
响应:
从图像中提取实体
此示例从图像中提取实体(对象)并以 JSON 格式返回结果。

响应:
关于处理图像的使用说明
-
仅支持文本和图像。不支持视频和音频文件。
-
支持的图像格式:
.jpg.jpeg.png.gif.webppixtralandllama4models also support.bmp.
-
The maximum image size is 10 MB for most models, and 3.75 MB for
claudemodels.claudemodels do not support images with resolutions above 8000x8000. -
包含图像的暂存区必须启用服务器端加密。不支持客户端加密暂存区。
-
该函数不支持自定义网络策略。
-
暂存区名称不区分大小写;路径区分大小写。