The arguments for creating the document relevance evaluator.
Arguments for the document relevance evaluator.
Optionalchoices?: ClassificationChoicesMapOptionalinputMapping?: ObjectMapping<RecordType>The mapping of the input to evaluate to the shape that the evaluator expects
Optionalname?: stringOptionaloptimizationDirection?: OptimizationDirectionOptionalpromptTemplate?: PromptTemplateOptionaltelemetry?: TelemetryConfigAn evaluator function that takes a DocumentRelevanceEvaluationRecord and returns a classification result indicating whether the document is relevant to the input question.
Use createRetrievalRelevanceEvaluator instead. Rename the
documentText input field to context, and update code that checks for the
unrelated label to check for irrelevant. Pass one document as context to
preserve per-document evaluation. This function will be removed in the next major
release.
This function returns an evaluator that determines whether a given document text is relevant to a provided input question. The evaluator uses a classification model and a prompt template to make its determination.
Creates a document relevance evaluator function.