Skip to content

qanary-component-eat-simple/eat-classifier

This page is auto-generated from TSDoc output. Edit the source file, not this Markdown.

qanary-component-eat-simple/eat-classifier

Section titled “qanary-component-eat-simple/eat-classifier”
  • Package: qanary-component-eat-simple
  • Source file: apps/qanary-component-eat-simple/src/eat-classifier.ts

All supported Expected Answer Types. Each maps to a URN in the Qanary EAT namespace.

function classifyExpectedAnswerType(question: string, modelFactory: () => ReturnType<typeof getLlmModel>): Promise<EatResponse | null>

Calls the LLM to classify the expected answer type for a question.

Parameters

  • question (string): The natural-language question to classify.
  • modelFactory (() => ReturnType): Optional override for the model factory (for testing). Returns
  • Promise<EatResponse | null>: The full structured EAT response, or null if classification fails. Defined at: line 75
function eatTypeToUrl(eatType: EatType): URL

Maps an EatType string to its full Qanary EAT namespace URL.

Parameters

  • eatType (EatType) Returns
  • URL Defined at: line 103
type EatType = (typeof EAT_TYPES)[number]

Defined at: line 22

type EatResponse = z.infer<typeof EatResponseSchema>

Defined at: line 43

const EAT_TYPES: unknown

All supported Expected Answer Types. Each maps to a URN in the Qanary EAT namespace.

Defined at: line 9

const EatResponseSchema: unknown

Zod schema for the structured LLM response. Using generateObject forces the model to return a validated enum value instead of free-form text, eliminating fragile string parsing.

Defined at: line 29