@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.
Files changed (176) hide show
  1. package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
  2. package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
  3. package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js +37 -0
  4. package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
  5. package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
  6. package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
  7. package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js +43 -0
  8. package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
  9. package/dist/esm/__generated__/default_templates/index.d.ts +3 -0
  10. package/dist/esm/__generated__/default_templates/index.d.ts.map +1 -0
  11. package/dist/esm/__generated__/default_templates/index.js +4 -0
  12. package/dist/esm/__generated__/default_templates/index.js.map +1 -0
  13. package/dist/esm/__generated__/types.d.ts +9 -0
  14. package/dist/esm/__generated__/types.d.ts.map +1 -0
  15. package/dist/esm/__generated__/types.js +3 -0
  16. package/dist/esm/__generated__/types.js.map +1 -0
  17. package/dist/esm/core/FunctionEvaluator.d.ts +16 -0
  18. package/dist/esm/core/FunctionEvaluator.d.ts.map +1 -0
  19. package/dist/esm/core/FunctionEvaluator.js +18 -0
  20. package/dist/esm/core/FunctionEvaluator.js.map +1 -0
  21. package/dist/esm/helpers/asEvaluatorFn.d.ts +6 -0
  22. package/dist/esm/helpers/asEvaluatorFn.d.ts.map +1 -0
  23. package/dist/esm/helpers/asEvaluatorFn.js +15 -0
  24. package/dist/esm/helpers/asEvaluatorFn.js.map +1 -0
  25. package/dist/esm/helpers/createEvaluator.d.ts +141 -0
  26. package/dist/esm/helpers/createEvaluator.d.ts.map +1 -0
  27. package/dist/esm/helpers/createEvaluator.js +96 -0
  28. package/dist/esm/helpers/createEvaluator.js.map +1 -0
  29. package/dist/esm/helpers/index.d.ts +2 -0
  30. package/dist/esm/helpers/index.d.ts.map +1 -0
  31. package/dist/esm/helpers/index.js +2 -0
  32. package/dist/esm/helpers/index.js.map +1 -0
  33. package/dist/esm/helpers/toEvaluationResult.d.ts +67 -0
  34. package/dist/esm/helpers/toEvaluationResult.d.ts.map +1 -0
  35. package/dist/esm/helpers/toEvaluationResult.js +133 -0
  36. package/dist/esm/helpers/toEvaluationResult.js.map +1 -0
  37. package/dist/esm/index.d.ts +1 -0
  38. package/dist/esm/index.d.ts.map +1 -1
  39. package/dist/esm/index.js +1 -0
  40. package/dist/esm/index.js.map +1 -1
  41. package/dist/esm/llm/{createDocumentRelevancyEvaluator.d.ts → createDocumentRelevanceEvaluator.d.ts} +11 -11
  42. package/dist/esm/llm/{createDocumentRelevancyEvaluator.d.ts.map → createDocumentRelevanceEvaluator.d.ts.map} +1 -1
  43. package/dist/esm/llm/{createDocumentRelevancyEvaluator.js → createDocumentRelevanceEvaluator.js} +10 -10
  44. package/dist/esm/llm/createDocumentRelevanceEvaluator.js.map +1 -0
  45. package/dist/esm/llm/createHallucinationEvaluator.d.ts +0 -1
  46. package/dist/esm/llm/createHallucinationEvaluator.d.ts.map +1 -1
  47. package/dist/esm/llm/createHallucinationEvaluator.js +2 -2
  48. package/dist/esm/llm/createHallucinationEvaluator.js.map +1 -1
  49. package/dist/esm/llm/index.d.ts +1 -1
  50. package/dist/esm/llm/index.js +1 -1
  51. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  52. package/dist/esm/types/base.d.ts +2 -0
  53. package/dist/esm/types/base.d.ts.map +1 -0
  54. package/dist/esm/types/base.js +2 -0
  55. package/dist/esm/types/base.js.map +1 -0
  56. package/dist/esm/types/index.d.ts +1 -0
  57. package/dist/esm/types/index.d.ts.map +1 -1
  58. package/dist/esm/types/index.js +1 -0
  59. package/dist/esm/types/index.js.map +1 -1
  60. package/dist/esm/utils/bindEvaluator.d.ts +1 -1
  61. package/dist/esm/utils/bindEvaluator.js +1 -1
  62. package/dist/esm/utils/typeUtils.d.ts +7 -0
  63. package/dist/esm/utils/typeUtils.d.ts.map +1 -0
  64. package/dist/esm/utils/typeUtils.js +13 -0
  65. package/dist/esm/utils/typeUtils.js.map +1 -0
  66. package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
  67. package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
  68. package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js +40 -0
  69. package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
  70. package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
  71. package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
  72. package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js +46 -0
  73. package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
  74. package/dist/src/__generated__/default_templates/index.d.ts +3 -0
  75. package/dist/src/__generated__/default_templates/index.d.ts.map +1 -0
  76. package/dist/src/__generated__/default_templates/index.js +9 -0
  77. package/dist/src/__generated__/default_templates/index.js.map +1 -0
  78. package/dist/src/__generated__/types.d.ts +9 -0
  79. package/dist/src/__generated__/types.d.ts.map +1 -0
  80. package/dist/src/__generated__/types.js +4 -0
  81. package/dist/src/__generated__/types.js.map +1 -0
  82. package/dist/src/core/FunctionEvaluator.d.ts +16 -0
  83. package/dist/src/core/FunctionEvaluator.d.ts.map +1 -0
  84. package/dist/src/core/FunctionEvaluator.js +33 -0
  85. package/dist/src/core/FunctionEvaluator.js.map +1 -0
  86. package/dist/src/helpers/asEvaluatorFn.d.ts +6 -0
  87. package/dist/src/helpers/asEvaluatorFn.d.ts.map +1 -0
  88. package/dist/src/helpers/asEvaluatorFn.js +18 -0
  89. package/dist/src/helpers/asEvaluatorFn.js.map +1 -0
  90. package/dist/src/helpers/createEvaluator.d.ts +141 -0
  91. package/dist/src/helpers/createEvaluator.d.ts.map +1 -0
  92. package/dist/src/helpers/createEvaluator.js +99 -0
  93. package/dist/src/helpers/createEvaluator.js.map +1 -0
  94. package/dist/src/helpers/index.d.ts +2 -0
  95. package/dist/src/helpers/index.d.ts.map +1 -0
  96. package/dist/src/{default_templates → helpers}/index.js +1 -2
  97. package/dist/src/helpers/index.js.map +1 -0
  98. package/dist/src/helpers/toEvaluationResult.d.ts +67 -0
  99. package/dist/src/helpers/toEvaluationResult.d.ts.map +1 -0
  100. package/dist/src/helpers/toEvaluationResult.js +136 -0
  101. package/dist/src/helpers/toEvaluationResult.js.map +1 -0
  102. package/dist/src/index.d.ts +1 -0
  103. package/dist/src/index.d.ts.map +1 -1
  104. package/dist/src/index.js +1 -0
  105. package/dist/src/index.js.map +1 -1
  106. package/dist/src/llm/{createDocumentRelevancyEvaluator.d.ts → createDocumentRelevanceEvaluator.d.ts} +11 -11
  107. package/dist/src/llm/{createDocumentRelevancyEvaluator.d.ts.map → createDocumentRelevanceEvaluator.d.ts.map} +1 -1
  108. package/dist/src/llm/{createDocumentRelevancyEvaluator.js → createDocumentRelevanceEvaluator.js} +11 -11
  109. package/dist/src/llm/createDocumentRelevanceEvaluator.js.map +1 -0
  110. package/dist/src/llm/createHallucinationEvaluator.d.ts +0 -1
  111. package/dist/src/llm/createHallucinationEvaluator.d.ts.map +1 -1
  112. package/dist/src/llm/createHallucinationEvaluator.js +2 -2
  113. package/dist/src/llm/createHallucinationEvaluator.js.map +1 -1
  114. package/dist/src/llm/index.d.ts +1 -1
  115. package/dist/src/llm/index.js +1 -1
  116. package/dist/src/types/base.d.ts +2 -0
  117. package/dist/src/types/base.d.ts.map +1 -0
  118. package/dist/src/types/base.js +3 -0
  119. package/dist/src/types/base.js.map +1 -0
  120. package/dist/src/types/index.d.ts +1 -0
  121. package/dist/src/types/index.d.ts.map +1 -1
  122. package/dist/src/types/index.js +1 -0
  123. package/dist/src/types/index.js.map +1 -1
  124. package/dist/src/utils/bindEvaluator.d.ts +1 -1
  125. package/dist/src/utils/bindEvaluator.js +1 -1
  126. package/dist/src/utils/typeUtils.d.ts +7 -0
  127. package/dist/src/utils/typeUtils.d.ts.map +1 -0
  128. package/dist/src/utils/typeUtils.js +16 -0
  129. package/dist/src/utils/typeUtils.js.map +1 -0
  130. package/dist/tsconfig.tsbuildinfo +1 -1
  131. package/package.json +7 -1
  132. package/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.ts +39 -0
  133. package/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.ts +45 -0
  134. package/src/__generated__/default_templates/index.ts +4 -0
  135. package/src/__generated__/types.ts +11 -0
  136. package/src/core/FunctionEvaluator.ts +28 -0
  137. package/src/helpers/asEvaluatorFn.ts +19 -0
  138. package/src/helpers/createEvaluator.ts +184 -0
  139. package/src/helpers/index.ts +1 -0
  140. package/src/helpers/toEvaluationResult.ts +145 -0
  141. package/src/index.ts +1 -0
  142. package/src/llm/{createDocumentRelevancyEvaluator.ts → createDocumentRelevanceEvaluator.ts} +18 -21
  143. package/src/llm/createHallucinationEvaluator.ts +5 -9
  144. package/src/llm/index.ts +1 -1
  145. package/src/types/base.ts +2 -0
  146. package/src/types/index.ts +1 -0
  147. package/src/utils/bindEvaluator.ts +1 -1
  148. package/src/utils/typeUtils.ts +14 -0
  149. package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts +0 -6
  150. package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts.map +0 -1
  151. package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js +0 -25
  152. package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js.map +0 -1
  153. package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.d.ts +0 -6
  154. package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.d.ts.map +0 -1
  155. package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.js +0 -31
  156. package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.js.map +0 -1
  157. package/dist/esm/default_templates/index.d.ts +0 -3
  158. package/dist/esm/default_templates/index.d.ts.map +0 -1
  159. package/dist/esm/default_templates/index.js +0 -3
  160. package/dist/esm/default_templates/index.js.map +0 -1
  161. package/dist/esm/llm/createDocumentRelevancyEvaluator.js.map +0 -1
  162. package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts +0 -6
  163. package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts.map +0 -1
  164. package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js +0 -28
  165. package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js.map +0 -1
  166. package/dist/src/default_templates/HALLUCINATION_TEMPLATE.d.ts +0 -6
  167. package/dist/src/default_templates/HALLUCINATION_TEMPLATE.d.ts.map +0 -1
  168. package/dist/src/default_templates/HALLUCINATION_TEMPLATE.js +0 -34
  169. package/dist/src/default_templates/HALLUCINATION_TEMPLATE.js.map +0 -1
  170. package/dist/src/default_templates/index.d.ts +0 -3
  171. package/dist/src/default_templates/index.d.ts.map +0 -1
  172. package/dist/src/default_templates/index.js.map +0 -1
  173. package/dist/src/llm/createDocumentRelevancyEvaluator.js.map +0 -1
  174. package/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.ts +0 -25
  175. package/src/default_templates/HALLUCINATION_TEMPLATE.ts +0 -31
  176. 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,3 +0,0 @@
1
- export * from "./HALLUCINATION_TEMPLATE.js";
2
- export * from "./DOCUMENT_RELEVANCY_TEMPLATE.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -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,3 +0,0 @@
1
- export * from "./HALLUCINATION_TEMPLATE.js";
2
- export * from "./DOCUMENT_RELEVANCY_TEMPLATE.js";
3
- //# sourceMappingURL=index.js.map
@@ -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,3 +0,0 @@
1
- export * from "./HALLUCINATION_TEMPLATE";
2
- export * from "./DOCUMENT_RELEVANCY_TEMPLATE";
3
- //# sourceMappingURL=index.d.ts.map
@@ -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
- };
@@ -1,2 +0,0 @@
1
- export * from "./HALLUCINATION_TEMPLATE";
2
- export * from "./DOCUMENT_RELEVANCY_TEMPLATE";