@arizeai/phoenix-evals 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
- package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
- package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js +37 -0
- package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
- package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
- package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
- package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js +43 -0
- package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
- package/dist/esm/__generated__/default_templates/index.d.ts +3 -0
- package/dist/esm/__generated__/default_templates/index.d.ts.map +1 -0
- package/dist/esm/__generated__/default_templates/index.js +4 -0
- package/dist/esm/__generated__/default_templates/index.js.map +1 -0
- package/dist/esm/__generated__/types.d.ts +9 -0
- package/dist/esm/__generated__/types.d.ts.map +1 -0
- package/dist/esm/__generated__/types.js +3 -0
- package/dist/esm/__generated__/types.js.map +1 -0
- package/dist/esm/core/FunctionEvaluator.d.ts +16 -0
- package/dist/esm/core/FunctionEvaluator.d.ts.map +1 -0
- package/dist/esm/core/FunctionEvaluator.js +18 -0
- package/dist/esm/core/FunctionEvaluator.js.map +1 -0
- package/dist/esm/helpers/asEvaluatorFn.d.ts +6 -0
- package/dist/esm/helpers/asEvaluatorFn.d.ts.map +1 -0
- package/dist/esm/helpers/asEvaluatorFn.js +15 -0
- package/dist/esm/helpers/asEvaluatorFn.js.map +1 -0
- package/dist/esm/helpers/createEvaluator.d.ts +141 -0
- package/dist/esm/helpers/createEvaluator.d.ts.map +1 -0
- package/dist/esm/helpers/createEvaluator.js +96 -0
- package/dist/esm/helpers/createEvaluator.js.map +1 -0
- package/dist/esm/helpers/index.d.ts +2 -0
- package/dist/esm/helpers/index.d.ts.map +1 -0
- package/dist/esm/helpers/index.js +2 -0
- package/dist/esm/helpers/index.js.map +1 -0
- package/dist/esm/helpers/toEvaluationResult.d.ts +67 -0
- package/dist/esm/helpers/toEvaluationResult.d.ts.map +1 -0
- package/dist/esm/helpers/toEvaluationResult.js +133 -0
- package/dist/esm/helpers/toEvaluationResult.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/llm/{createDocumentRelevancyEvaluator.d.ts → createDocumentRelevanceEvaluator.d.ts} +11 -11
- package/dist/esm/llm/{createDocumentRelevancyEvaluator.d.ts.map → createDocumentRelevanceEvaluator.d.ts.map} +1 -1
- package/dist/esm/llm/{createDocumentRelevancyEvaluator.js → createDocumentRelevanceEvaluator.js} +10 -10
- package/dist/esm/llm/createDocumentRelevanceEvaluator.js.map +1 -0
- package/dist/esm/llm/createHallucinationEvaluator.d.ts +0 -1
- package/dist/esm/llm/createHallucinationEvaluator.d.ts.map +1 -1
- package/dist/esm/llm/createHallucinationEvaluator.js +2 -2
- package/dist/esm/llm/createHallucinationEvaluator.js.map +1 -1
- package/dist/esm/llm/index.d.ts +1 -1
- package/dist/esm/llm/index.js +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types/base.d.ts +2 -0
- package/dist/esm/types/base.d.ts.map +1 -0
- package/dist/esm/types/base.js +2 -0
- package/dist/esm/types/base.js.map +1 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/utils/bindEvaluator.d.ts +1 -1
- package/dist/esm/utils/bindEvaluator.js +1 -1
- package/dist/esm/utils/typeUtils.d.ts +7 -0
- package/dist/esm/utils/typeUtils.d.ts.map +1 -0
- package/dist/esm/utils/typeUtils.js +13 -0
- package/dist/esm/utils/typeUtils.js.map +1 -0
- package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
- package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
- package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js +40 -0
- package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
- package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
- package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
- package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js +46 -0
- package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
- package/dist/src/__generated__/default_templates/index.d.ts +3 -0
- package/dist/src/__generated__/default_templates/index.d.ts.map +1 -0
- package/dist/src/__generated__/default_templates/index.js +9 -0
- package/dist/src/__generated__/default_templates/index.js.map +1 -0
- package/dist/src/__generated__/types.d.ts +9 -0
- package/dist/src/__generated__/types.d.ts.map +1 -0
- package/dist/src/__generated__/types.js +4 -0
- package/dist/src/__generated__/types.js.map +1 -0
- package/dist/src/core/FunctionEvaluator.d.ts +16 -0
- package/dist/src/core/FunctionEvaluator.d.ts.map +1 -0
- package/dist/src/core/FunctionEvaluator.js +33 -0
- package/dist/src/core/FunctionEvaluator.js.map +1 -0
- package/dist/src/helpers/asEvaluatorFn.d.ts +6 -0
- package/dist/src/helpers/asEvaluatorFn.d.ts.map +1 -0
- package/dist/src/helpers/asEvaluatorFn.js +18 -0
- package/dist/src/helpers/asEvaluatorFn.js.map +1 -0
- package/dist/src/helpers/createEvaluator.d.ts +141 -0
- package/dist/src/helpers/createEvaluator.d.ts.map +1 -0
- package/dist/src/helpers/createEvaluator.js +99 -0
- package/dist/src/helpers/createEvaluator.js.map +1 -0
- package/dist/src/helpers/index.d.ts +2 -0
- package/dist/src/helpers/index.d.ts.map +1 -0
- package/dist/src/{default_templates → helpers}/index.js +1 -2
- package/dist/src/helpers/index.js.map +1 -0
- package/dist/src/helpers/toEvaluationResult.d.ts +67 -0
- package/dist/src/helpers/toEvaluationResult.d.ts.map +1 -0
- package/dist/src/helpers/toEvaluationResult.js +136 -0
- package/dist/src/helpers/toEvaluationResult.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/llm/{createDocumentRelevancyEvaluator.d.ts → createDocumentRelevanceEvaluator.d.ts} +11 -11
- package/dist/src/llm/{createDocumentRelevancyEvaluator.d.ts.map → createDocumentRelevanceEvaluator.d.ts.map} +1 -1
- package/dist/src/llm/{createDocumentRelevancyEvaluator.js → createDocumentRelevanceEvaluator.js} +11 -11
- package/dist/src/llm/createDocumentRelevanceEvaluator.js.map +1 -0
- package/dist/src/llm/createHallucinationEvaluator.d.ts +0 -1
- package/dist/src/llm/createHallucinationEvaluator.d.ts.map +1 -1
- package/dist/src/llm/createHallucinationEvaluator.js +2 -2
- package/dist/src/llm/createHallucinationEvaluator.js.map +1 -1
- package/dist/src/llm/index.d.ts +1 -1
- package/dist/src/llm/index.js +1 -1
- package/dist/src/types/base.d.ts +2 -0
- package/dist/src/types/base.d.ts.map +1 -0
- package/dist/src/types/base.js +3 -0
- package/dist/src/types/base.js.map +1 -0
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +1 -0
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/utils/bindEvaluator.d.ts +1 -1
- package/dist/src/utils/bindEvaluator.js +1 -1
- package/dist/src/utils/typeUtils.d.ts +7 -0
- package/dist/src/utils/typeUtils.d.ts.map +1 -0
- package/dist/src/utils/typeUtils.js +16 -0
- package/dist/src/utils/typeUtils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -1
- package/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.ts +39 -0
- package/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.ts +45 -0
- package/src/__generated__/default_templates/index.ts +4 -0
- package/src/__generated__/types.ts +11 -0
- package/src/core/FunctionEvaluator.ts +28 -0
- package/src/helpers/asEvaluatorFn.ts +19 -0
- package/src/helpers/createEvaluator.ts +184 -0
- package/src/helpers/index.ts +1 -0
- package/src/helpers/toEvaluationResult.ts +145 -0
- package/src/index.ts +1 -0
- package/src/llm/{createDocumentRelevancyEvaluator.ts → createDocumentRelevanceEvaluator.ts} +18 -21
- package/src/llm/createHallucinationEvaluator.ts +5 -9
- package/src/llm/index.ts +1 -1
- package/src/types/base.ts +2 -0
- package/src/types/index.ts +1 -0
- package/src/utils/bindEvaluator.ts +1 -1
- package/src/utils/typeUtils.ts +14 -0
- package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts +0 -6
- package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts.map +0 -1
- package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js +0 -25
- package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js.map +0 -1
- package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.d.ts +0 -6
- package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.d.ts.map +0 -1
- package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.js +0 -31
- package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.js.map +0 -1
- package/dist/esm/default_templates/index.d.ts +0 -3
- package/dist/esm/default_templates/index.d.ts.map +0 -1
- package/dist/esm/default_templates/index.js +0 -3
- package/dist/esm/default_templates/index.js.map +0 -1
- package/dist/esm/llm/createDocumentRelevancyEvaluator.js.map +0 -1
- package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts +0 -6
- package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts.map +0 -1
- package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js +0 -28
- package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js.map +0 -1
- package/dist/src/default_templates/HALLUCINATION_TEMPLATE.d.ts +0 -6
- package/dist/src/default_templates/HALLUCINATION_TEMPLATE.d.ts.map +0 -1
- package/dist/src/default_templates/HALLUCINATION_TEMPLATE.js +0 -34
- package/dist/src/default_templates/HALLUCINATION_TEMPLATE.js.map +0 -1
- package/dist/src/default_templates/index.d.ts +0 -3
- package/dist/src/default_templates/index.d.ts.map +0 -1
- package/dist/src/default_templates/index.js.map +0 -1
- package/dist/src/llm/createDocumentRelevancyEvaluator.js.map +0 -1
- package/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.ts +0 -25
- package/src/default_templates/HALLUCINATION_TEMPLATE.ts +0 -31
- package/src/default_templates/index.ts +0 -2
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export const DOCUMENT_RELEVANCY_TEMPLATE = `
|
|
2
|
-
You are comparing a document to a question and trying to determine if the document text
|
|
3
|
-
contains information relevant to answering the question. Here is the data:
|
|
4
|
-
|
|
5
|
-
[BEGIN DATA]
|
|
6
|
-
************
|
|
7
|
-
[Question]: {{input}}
|
|
8
|
-
************
|
|
9
|
-
[Document text]: {{documentText}}
|
|
10
|
-
************
|
|
11
|
-
[END DATA]
|
|
12
|
-
|
|
13
|
-
Compare the Question above to the Document text. You must determine whether the Document text
|
|
14
|
-
contains information that can answer the Question. Please focus on whether the very specific
|
|
15
|
-
question can be answered by the information in the Document text.
|
|
16
|
-
Your response must be single word, either "relevant" or "unrelated",
|
|
17
|
-
and should not contain any text or characters aside from that word.
|
|
18
|
-
"unrelated" means that the document text does not contain an answer to the Question.
|
|
19
|
-
"relevant" means the document text contains an answer to the Question.
|
|
20
|
-
`;
|
|
21
|
-
export const DOCUMENT_RELEVANCY_CHOICES = {
|
|
22
|
-
relevant: 1,
|
|
23
|
-
unrelated: 0,
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=DOCUMENT_RELEVANCY_TEMPLATE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DOCUMENT_RELEVANCY_TEMPLATE.js","sourceRoot":"","sources":["../../../src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;CAmB1C,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;CACb,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const HALLUCINATION_TEMPLATE = "\nIn this task, you will be presented with a query, a reference text and an answer. The answer is\ngenerated to the question based on the reference text. The answer may contain false information. You\nmust use the reference text to determine if the answer to the question contains false information,\nif the answer is a hallucination of facts. Your objective is to determine whether the answer text\ncontains factual information and is not a hallucination. A 'hallucination' refers to\nan answer that is not based on the reference text or assumes information that is not available in\nthe reference text. Your response should be a single word: either \"factual\" or \"hallucinated\", and\nit should not include any other text or characters. \"hallucinated\" indicates that the answer\nprovides factually inaccurate information to the query based on the reference text. \"factual\"\nindicates that the answer to the question is correct relative to the reference text, and does not\ncontain made up information. Please read the query and reference text carefully before determining\nyour response.\n\n [BEGIN DATA]\n ************\n [Query]: {{input}}\n ************\n [Reference text]: {{reference}}\n ************\n [Answer]: {{output}}\n ************\n [END DATA]\n\nIs the answer above factual or hallucinated based on the query and reference text?\n";
|
|
2
|
-
export declare const HALLUCINATION_CHOICES: {
|
|
3
|
-
hallucinated: number;
|
|
4
|
-
factual: number;
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=HALLUCINATION_TEMPLATE.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HALLUCINATION_TEMPLATE.d.ts","sourceRoot":"","sources":["../../../src/default_templates/HALLUCINATION_TEMPLATE.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,u2CAyBlC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;CAGjC,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export const HALLUCINATION_TEMPLATE = `
|
|
2
|
-
In this task, you will be presented with a query, a reference text and an answer. The answer is
|
|
3
|
-
generated to the question based on the reference text. The answer may contain false information. You
|
|
4
|
-
must use the reference text to determine if the answer to the question contains false information,
|
|
5
|
-
if the answer is a hallucination of facts. Your objective is to determine whether the answer text
|
|
6
|
-
contains factual information and is not a hallucination. A 'hallucination' refers to
|
|
7
|
-
an answer that is not based on the reference text or assumes information that is not available in
|
|
8
|
-
the reference text. Your response should be a single word: either "factual" or "hallucinated", and
|
|
9
|
-
it should not include any other text or characters. "hallucinated" indicates that the answer
|
|
10
|
-
provides factually inaccurate information to the query based on the reference text. "factual"
|
|
11
|
-
indicates that the answer to the question is correct relative to the reference text, and does not
|
|
12
|
-
contain made up information. Please read the query and reference text carefully before determining
|
|
13
|
-
your response.
|
|
14
|
-
|
|
15
|
-
[BEGIN DATA]
|
|
16
|
-
************
|
|
17
|
-
[Query]: {{input}}
|
|
18
|
-
************
|
|
19
|
-
[Reference text]: {{reference}}
|
|
20
|
-
************
|
|
21
|
-
[Answer]: {{output}}
|
|
22
|
-
************
|
|
23
|
-
[END DATA]
|
|
24
|
-
|
|
25
|
-
Is the answer above factual or hallucinated based on the query and reference text?
|
|
26
|
-
`;
|
|
27
|
-
export const HALLUCINATION_CHOICES = {
|
|
28
|
-
hallucinated: 1,
|
|
29
|
-
factual: 0,
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=HALLUCINATION_TEMPLATE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HALLUCINATION_TEMPLATE.js","sourceRoot":"","sources":["../../../src/default_templates/HALLUCINATION_TEMPLATE.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyBrC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,CAAC;CACX,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/default_templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/default_templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDocumentRelevancyEvaluator.js","sourceRoot":"","sources":["../../../src/llm/createDocumentRelevancyEvaluator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,kDAAkD,CAAC;AAI1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AA0BhF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,gCAAgC,CAM9C,IAAgD;IAEhD,MAAM,EACJ,OAAO,GAAG,0BAA0B,EACpC,cAAc,GAAG,2BAA2B,EAC5C,qBAAqB,GAAG,UAAU,EAClC,IAAI,GAAG,oBAAoB,EAC3B,GAAG,IAAI,EACR,GAAG,IAAI,CAAC;IACT,OAAO,6BAA6B,CAAa;QAC/C,GAAG,IAAI;QACP,cAAc;QACd,OAAO;QACP,qBAAqB;QACrB,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const DOCUMENT_RELEVANCY_TEMPLATE = "\nYou are comparing a document to a question and trying to determine if the document text\ncontains information relevant to answering the question. Here is the data:\n\n [BEGIN DATA]\n ************\n [Question]: {{input}}\n ************\n [Document text]: {{documentText}}\n ************\n [END DATA]\n\nCompare the Question above to the Document text. You must determine whether the Document text\ncontains information that can answer the Question. Please focus on whether the very specific\nquestion can be answered by the information in the Document text.\nYour response must be single word, either \"relevant\" or \"unrelated\",\nand should not contain any text or characters aside from that word.\n\"unrelated\" means that the document text does not contain an answer to the Question.\n\"relevant\" means the document text contains an answer to the Question.\n";
|
|
2
|
-
export declare const DOCUMENT_RELEVANCY_CHOICES: {
|
|
3
|
-
relevant: number;
|
|
4
|
-
unrelated: number;
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=DOCUMENT_RELEVANCY_TEMPLATE.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DOCUMENT_RELEVANCY_TEMPLATE.d.ts","sourceRoot":"","sources":["../../../src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,23BAmBvC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;CAGtC,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DOCUMENT_RELEVANCY_CHOICES = exports.DOCUMENT_RELEVANCY_TEMPLATE = void 0;
|
|
4
|
-
exports.DOCUMENT_RELEVANCY_TEMPLATE = `
|
|
5
|
-
You are comparing a document to a question and trying to determine if the document text
|
|
6
|
-
contains information relevant to answering the question. Here is the data:
|
|
7
|
-
|
|
8
|
-
[BEGIN DATA]
|
|
9
|
-
************
|
|
10
|
-
[Question]: {{input}}
|
|
11
|
-
************
|
|
12
|
-
[Document text]: {{documentText}}
|
|
13
|
-
************
|
|
14
|
-
[END DATA]
|
|
15
|
-
|
|
16
|
-
Compare the Question above to the Document text. You must determine whether the Document text
|
|
17
|
-
contains information that can answer the Question. Please focus on whether the very specific
|
|
18
|
-
question can be answered by the information in the Document text.
|
|
19
|
-
Your response must be single word, either "relevant" or "unrelated",
|
|
20
|
-
and should not contain any text or characters aside from that word.
|
|
21
|
-
"unrelated" means that the document text does not contain an answer to the Question.
|
|
22
|
-
"relevant" means the document text contains an answer to the Question.
|
|
23
|
-
`;
|
|
24
|
-
exports.DOCUMENT_RELEVANCY_CHOICES = {
|
|
25
|
-
relevant: 1,
|
|
26
|
-
unrelated: 0,
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=DOCUMENT_RELEVANCY_TEMPLATE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DOCUMENT_RELEVANCY_TEMPLATE.js","sourceRoot":"","sources":["../../../src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;CAmB1C,CAAC;AAEW,QAAA,0BAA0B,GAAG;IACxC,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;CACb,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const HALLUCINATION_TEMPLATE = "\nIn this task, you will be presented with a query, a reference text and an answer. The answer is\ngenerated to the question based on the reference text. The answer may contain false information. You\nmust use the reference text to determine if the answer to the question contains false information,\nif the answer is a hallucination of facts. Your objective is to determine whether the answer text\ncontains factual information and is not a hallucination. A 'hallucination' refers to\nan answer that is not based on the reference text or assumes information that is not available in\nthe reference text. Your response should be a single word: either \"factual\" or \"hallucinated\", and\nit should not include any other text or characters. \"hallucinated\" indicates that the answer\nprovides factually inaccurate information to the query based on the reference text. \"factual\"\nindicates that the answer to the question is correct relative to the reference text, and does not\ncontain made up information. Please read the query and reference text carefully before determining\nyour response.\n\n [BEGIN DATA]\n ************\n [Query]: {{input}}\n ************\n [Reference text]: {{reference}}\n ************\n [Answer]: {{output}}\n ************\n [END DATA]\n\nIs the answer above factual or hallucinated based on the query and reference text?\n";
|
|
2
|
-
export declare const HALLUCINATION_CHOICES: {
|
|
3
|
-
hallucinated: number;
|
|
4
|
-
factual: number;
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=HALLUCINATION_TEMPLATE.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HALLUCINATION_TEMPLATE.d.ts","sourceRoot":"","sources":["../../../src/default_templates/HALLUCINATION_TEMPLATE.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,u2CAyBlC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;CAGjC,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HALLUCINATION_CHOICES = exports.HALLUCINATION_TEMPLATE = void 0;
|
|
4
|
-
exports.HALLUCINATION_TEMPLATE = `
|
|
5
|
-
In this task, you will be presented with a query, a reference text and an answer. The answer is
|
|
6
|
-
generated to the question based on the reference text. The answer may contain false information. You
|
|
7
|
-
must use the reference text to determine if the answer to the question contains false information,
|
|
8
|
-
if the answer is a hallucination of facts. Your objective is to determine whether the answer text
|
|
9
|
-
contains factual information and is not a hallucination. A 'hallucination' refers to
|
|
10
|
-
an answer that is not based on the reference text or assumes information that is not available in
|
|
11
|
-
the reference text. Your response should be a single word: either "factual" or "hallucinated", and
|
|
12
|
-
it should not include any other text or characters. "hallucinated" indicates that the answer
|
|
13
|
-
provides factually inaccurate information to the query based on the reference text. "factual"
|
|
14
|
-
indicates that the answer to the question is correct relative to the reference text, and does not
|
|
15
|
-
contain made up information. Please read the query and reference text carefully before determining
|
|
16
|
-
your response.
|
|
17
|
-
|
|
18
|
-
[BEGIN DATA]
|
|
19
|
-
************
|
|
20
|
-
[Query]: {{input}}
|
|
21
|
-
************
|
|
22
|
-
[Reference text]: {{reference}}
|
|
23
|
-
************
|
|
24
|
-
[Answer]: {{output}}
|
|
25
|
-
************
|
|
26
|
-
[END DATA]
|
|
27
|
-
|
|
28
|
-
Is the answer above factual or hallucinated based on the query and reference text?
|
|
29
|
-
`;
|
|
30
|
-
exports.HALLUCINATION_CHOICES = {
|
|
31
|
-
hallucinated: 1,
|
|
32
|
-
factual: 0,
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=HALLUCINATION_TEMPLATE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HALLUCINATION_TEMPLATE.js","sourceRoot":"","sources":["../../../src/default_templates/HALLUCINATION_TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyBrC,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACnC,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,CAAC;CACX,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/default_templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/default_templates/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,gEAA8C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDocumentRelevancyEvaluator.js","sourceRoot":"","sources":["../../../src/llm/createDocumentRelevancyEvaluator.ts"],"names":[],"mappings":";;;;;;;;;;;;;AA2DA,4EAsBC;AAjFD,kGAG0D;AAI1D,mFAAgF;AA0BhF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,gCAAgC,CAM9C,IAAgD;IAEhD,MAAM,EACJ,OAAO,GAAG,wDAA0B,EACpC,cAAc,GAAG,yDAA2B,EAC5C,qBAAqB,GAAG,UAAU,EAClC,IAAI,GAAG,oBAAoB,KAEzB,IAAI,EADH,IAAI,UACL,IAAI,EANF,8DAML,CAAO,CAAC;IACT,OAAO,IAAA,6DAA6B,kCAC/B,IAAI,KACP,cAAc;QACd,OAAO;QACP,qBAAqB;QACrB,IAAI,IACJ,CAAC;AACL,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export const DOCUMENT_RELEVANCY_TEMPLATE = `
|
|
2
|
-
You are comparing a document to a question and trying to determine if the document text
|
|
3
|
-
contains information relevant to answering the question. Here is the data:
|
|
4
|
-
|
|
5
|
-
[BEGIN DATA]
|
|
6
|
-
************
|
|
7
|
-
[Question]: {{input}}
|
|
8
|
-
************
|
|
9
|
-
[Document text]: {{documentText}}
|
|
10
|
-
************
|
|
11
|
-
[END DATA]
|
|
12
|
-
|
|
13
|
-
Compare the Question above to the Document text. You must determine whether the Document text
|
|
14
|
-
contains information that can answer the Question. Please focus on whether the very specific
|
|
15
|
-
question can be answered by the information in the Document text.
|
|
16
|
-
Your response must be single word, either "relevant" or "unrelated",
|
|
17
|
-
and should not contain any text or characters aside from that word.
|
|
18
|
-
"unrelated" means that the document text does not contain an answer to the Question.
|
|
19
|
-
"relevant" means the document text contains an answer to the Question.
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
export const DOCUMENT_RELEVANCY_CHOICES = {
|
|
23
|
-
relevant: 1,
|
|
24
|
-
unrelated: 0,
|
|
25
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export const HALLUCINATION_TEMPLATE = `
|
|
2
|
-
In this task, you will be presented with a query, a reference text and an answer. The answer is
|
|
3
|
-
generated to the question based on the reference text. The answer may contain false information. You
|
|
4
|
-
must use the reference text to determine if the answer to the question contains false information,
|
|
5
|
-
if the answer is a hallucination of facts. Your objective is to determine whether the answer text
|
|
6
|
-
contains factual information and is not a hallucination. A 'hallucination' refers to
|
|
7
|
-
an answer that is not based on the reference text or assumes information that is not available in
|
|
8
|
-
the reference text. Your response should be a single word: either "factual" or "hallucinated", and
|
|
9
|
-
it should not include any other text or characters. "hallucinated" indicates that the answer
|
|
10
|
-
provides factually inaccurate information to the query based on the reference text. "factual"
|
|
11
|
-
indicates that the answer to the question is correct relative to the reference text, and does not
|
|
12
|
-
contain made up information. Please read the query and reference text carefully before determining
|
|
13
|
-
your response.
|
|
14
|
-
|
|
15
|
-
[BEGIN DATA]
|
|
16
|
-
************
|
|
17
|
-
[Query]: {{input}}
|
|
18
|
-
************
|
|
19
|
-
[Reference text]: {{reference}}
|
|
20
|
-
************
|
|
21
|
-
[Answer]: {{output}}
|
|
22
|
-
************
|
|
23
|
-
[END DATA]
|
|
24
|
-
|
|
25
|
-
Is the answer above factual or hallucinated based on the query and reference text?
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
export const HALLUCINATION_CHOICES = {
|
|
29
|
-
hallucinated: 1,
|
|
30
|
-
factual: 0,
|
|
31
|
-
};
|