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
Summary
Section titled “Summary”All supported Expected Answer Types. Each maps to a URN in the Qanary EAT namespace.
Functions
Section titled “Functions”classifyExpectedAnswerType
Section titled “classifyExpectedAnswerType”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
eatTypeToUrl
Section titled “eatTypeToUrl”function eatTypeToUrl(eatType: EatType): URLMaps an EatType string to its full Qanary EAT namespace URL.
Parameters
eatType(EatType) ReturnsURLDefined at: line 103
EatType
Section titled “EatType”type EatType = (typeof EAT_TYPES)[number]Defined at: line 22
EatResponse
Section titled “EatResponse”type EatResponse = z.infer<typeof EatResponseSchema>Defined at: line 43
Constants
Section titled “Constants”EAT_TYPES
Section titled “EAT_TYPES”const EAT_TYPES: unknownAll supported Expected Answer Types. Each maps to a URN in the Qanary EAT namespace.
Defined at: line 9
EatResponseSchema
Section titled “EatResponseSchema”const EatResponseSchema: unknownZod 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
In qanary-component-eat-simple
Section titled “In qanary-component-eat-simple”qanary-component-eat-simple/eat-classifierqanary-component-eat-simple/handlerqanary-component-eat-simple/index