EXTRACT_ANSWER
functiondeferredAI & MLNotice This page is provided for backward compatibility. For new use cases, start with AI_EXTRACT, which is the canonical surface going forward. This legacy function will be deprecated by the end of 2026. Extracts an answer to a given question from a text document. The document may be a plain-English document or a string representation of a semi-structured (JSON) data object.
Syntax
SNOWFLAKE.CORTEX.EXTRACT_ANSWER(
<source_document>, <question>)
Parameters
| Name | Required | Description |
|---|---|---|
source_document | required | A string containing the plain-text or JSON document that contains the answer to the question. |
question | required | A string containing the question to be answered. |
Returns
A string containing an answer to the given question.
Access control requirements
Users must use a role that has been granted the SNOWFLAKE.CORTEX_USER database role. See Cortex LLM privileges for more information on granting this privilege.
Legal notices
Refer to Snowflake AI and ML.
Known gaps
- The emulator does not run a language model, so Cortex AI functions that generate, classify, extract or score text have no model to answer with.