Skip to contents

Tests whether a signature has been transformed with with_reasoning(). Checks for the presence of a reasoning field in the output type.

Usage

has_reasoning(sig, reasoning_field = "reasoning")

Arguments

sig

A Signature object

reasoning_field

Character. Name of reasoning field to check for.

Value

Logical. TRUE if signature has chain-of-thought reasoning.

Examples

sig <- signature("question -> answer")
has_reasoning(sig)
#> [1] FALSE
# FALSE

cot_sig <- with_reasoning(sig)
has_reasoning(cot_sig)
#> [1] TRUE
# TRUE