snowflake.cortex.extract_answer

snowflake.cortex.extract_answer(from_text: str | Column, question: str | Column, session: Session | None = None) → str | Column

Calls into the LLM inference service to extract an answer from within specified text.

Parameters:
  • from_text – A Column of strings representing input text.

  • question – A Column of strings representing a question to ask against from_text.

  • session – The snowpark session to use. Will be inferred by context if not specified.

Returns:

…, “score”: …}], matching legacy EXTRACT_ANSWER.

Return type:

A column of arrays, each [{“answer”

Raises:

SnowflakeAuthenticationException – if no session is provided and none is active.