@awell-health/awell-extensions 2.0.236 → 2.0.237

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.
@@ -14,7 +14,7 @@
14
14
  * - LANGSMITH_PROJECT=ai-actions-local
15
15
  *
16
16
  * Usage:
17
- * node getTagsFromLLM/evaluateTags.ts
17
+ * * yarn ts-node extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/evaluateTags.ts
18
18
  *
19
19
  * Results can be viewed in LangSmith dashboard:
20
20
  * https://smith.langchain.com/o/3fffae83-70ff-4574-81ba-aaaedf0b4dc5/datasets/745cea13-3379-463f-9a8a-c6b10e29b8f6
@@ -15,7 +15,7 @@
15
15
  * - LANGSMITH_PROJECT=ai-actions-local
16
16
  *
17
17
  * Usage:
18
- * node getTagsFromLLM/evaluateTags.ts
18
+ * * yarn ts-node extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/evaluateTags.ts
19
19
  *
20
20
  * Results can be viewed in LangSmith dashboard:
21
21
  * https://smith.langchain.com/o/3fffae83-70ff-4574-81ba-aaaedf0b4dc5/datasets/745cea13-3379-463f-9a8a-c6b10e29b8f6
@@ -45,7 +45,7 @@ const fetchTestExamples = async () => {
45
45
  try {
46
46
  const testExamples = langsmith.listExamples({
47
47
  datasetName,
48
- splits: ['test'],
48
+ splits: ['test'], // change to ['validation'] to run on validation set
49
49
  });
50
50
  const examples = [];
51
51
  for await (const example of testExamples) {
@@ -63,10 +63,8 @@ const fetchTestExamples = async () => {
63
63
  };
64
64
  // Custom evaluator to compare generated tags with expected tags
65
65
  const tagsMatchEvaluator = async ({ outputs, referenceOutputs, }) => {
66
- console.log('Evaluator received:', { outputs, referenceOutputs }); // Debug log
67
66
  const generatedTags = outputs === null || outputs === void 0 ? void 0 : outputs.validatedTags;
68
67
  const expectedTags = referenceOutputs === null || referenceOutputs === void 0 ? void 0 : referenceOutputs.expected_updated_tags;
69
- // console.log('Comparing tags:', { generatedTags, expectedTags }); // Debug log
70
68
  const isEqual = Array.isArray(generatedTags) &&
71
69
  Array.isArray(expectedTags) &&
72
70
  generatedTags.length === expectedTags.length &&
@@ -129,7 +127,8 @@ const runEvaluation = async () => {
129
127
  data: testExamples,
130
128
  evaluators: [tagsMatchEvaluator],
131
129
  experimentPrefix: 'GetTagsFromLLM Evaluation',
132
- maxConcurrency: 4,
130
+ maxConcurrency: 16,
131
+ numRepetitions: 3,
133
132
  });
134
133
  const resultsArray = Array.isArray(results) ? results : [results];
135
134
  const experimentId = (_b = (_a = resultsArray[0]) === null || _a === void 0 ? void 0 : _a.run) === null || _b === void 0 ? void 0 : _b.run_id;
@@ -1 +1 @@
1
- {"version":3,"file":"evaluateTags.js","sourceRoot":"","sources":["../../../../../../../extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/evaluateTags.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;AAEH,yCAAgD;AAChD,qDAA+C;AAC/C,8FAA0F;AAC1F,qDAAiD;AACjD,8EAA8E;AAE9E,mCAA8B;AAE9B,oDAA2B;AAC3B,gBAAM,CAAC,MAAM,EAAE,CAAA;AAEf,MAAM,SAAS,GAAG,IAAI,kBAAM,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;IACrC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;CACvC,CAAC,CAAA;AAEF,0BAA0B;AAC1B,MAAM,WAAW,GAAG,wCAAwC,CAAA;AAiB5D,mDAAmD;AACnD,MAAM,iBAAiB,GAAG,KAAK,IAAwB,EAAE;IACvD,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;YAC1C,WAAW;YACX,MAAM,EAAE,CAAC,MAAM,CAAC;SACjB,CAAC,CAAA;QACF,MAAM,QAAQ,GAAc,EAAE,CAAA;QAC9B,IAAI,KAAK,EAAE,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;YACzC,IAA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AAC,CAAA;QACzD,MAAM,YAAY,GAAG,MAAM,iBAAiB,EAAE,CAAA;QAC9C,OAAO,CAAC,GAAG,CAAC,YAAY,YAAY,CAAC,MAAM,kBAAkB,CAAC,CAAA;QAE9D,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;QACzC,MAAM,OAAO,GAAG,MAAM,IAAA,qBAAQ,EAAC,qBAAqB,EAAE;YACpD,IAAI,EAAE,YAAY;YAClB,UAAU,EAAE,CAAC,kBAAkB,CAAC;YAChC,gBAAgB,EAAE,2BAA2B;YAC7C,cAAc,EAAE,CAAC;SAClB,CAAC,CAAA;QAEF,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;QACjE,MAAM,YAAY,GAAG,MAAA,MAAA,YAAY,CAAC,CAAC,CAAC,0CAAE,GAAG,0CAAE,MAAgB,CAAA;QAE3D,IAAI,CAAC,IAAA,cAAK,EAAC,YAAY,CAAC,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACvD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;YACvC,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAA;YAClD,OAAO,CAAC,GAAG,CAAC,oCAAoC,YAAY,EAAE,CAAC,CAAA;QACjE,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAA;QAClD,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AAED,yBAAyB;AACzB,KAAK,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"evaluateTags.js","sourceRoot":"","sources":["../../../../../../../extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/evaluateTags.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;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cAAK,EAAC,YAAY,CAAC,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACvD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;YACvC,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAA;YAClD,OAAO,CAAC,GAAG,CAAC,oCAAoC,YAAY,EAAE,CAAC,CAAA;QACjE,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAA;QAClD,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AAED,yBAAyB;AACzB,KAAK,aAAa,EAAE,CAAA"}
@@ -1,2 +1,2 @@
1
1
  import { ChatPromptTemplate } from '@langchain/core/prompts';
2
- export declare const systemPrompt: ChatPromptTemplate<import("@langchain/core/prompts").ParamsFromFString<"\n You are a clinical data manager with expert knowledge of Elation Patient Tags, which help care teams organize patient care (e.g., grouping, reporting, or identifying patients for care).\n\n Your task is to manage a single patient's tags based on the provided instructions.\n\n You will receive:\n - existing_tags: An array of the patient's current tags.\n - instruction: A directive specifying which tags to add, update, or remove. Ensure to follow them diligently.\n\n ### Step-by-Step Approach:\n 1. **Review the Instruction**\n - Identify the required tag modifications: additions, updates, or removals.\n\n 2. **Apply Modifications**\n - **Removing Tags:**\n - Only remove tags if explicitly stated in the instruction.\n - Match existing tags for removal, allowing minor variations (e.g., capitalization, spacing).\n - If unsure, do not remove the tag.\n\n - **Adding Tags:**\n - Use the exact wording and formatting provided in the instruction for new tags. Do not modify, reformat, or adjust them in any way. This is critical.\n - Ensure that the final list does not exceed **10 tags**. If adding a tag would exceed this limit, do not add it and clarify this in the \"explanation\".\n - If a tag exceeds **100 characters**, do not add it and state this in the \"explanation\".\n - Ensure all tags remain **unique** (no duplicates).\n - The updated list should first retain all unchanged tags, followed by any new additions.\n\n - **Unaffected Tags:**\n - Tags that are not affected by the modification instructions must remain unchanged, including spacing and formatting.\n\n 3. **Generate Output**\n - Return a JSON object containing:\n - \"updatedTags\": The final array of tags after modifications.\n - \"explanation\": A single, concise sentence summarizing all tag modifications, including the reasoning behind changes or lack thereof. Do not include statements about the total number of tags.\n\n ### Input\n existingTags: {existingTags}\n instructions: {instructions}\n">, any>;
2
+ export declare const systemPrompt: ChatPromptTemplate<import("@langchain/core/prompts").ParamsFromFString<"\n You are a clinical data manager with expert knowledge of Elation Patient Tags, which help care teams organize patient care (e.g., grouping, reporting, or identifying patients for care).\n\n Your task is to manage a single patient's tags based on the provided instructions.\n\n You will receive:\n - existing_tags: An array of the patient's current tags.\n - instruction: A directive specifying which tags to add, update, or remove. Ensure to follow them diligently.\n\n ### Step-by-Step Approach:\n 1. **Review the Instruction**\n - Identify the required tag modifications: additions, updates, or removals.\n\n 2. **Apply Modifications**\n - **Removing Tags:**\n - Only remove tags if explicitly stated in the instruction.\n - Match existing tags for removal, allowing minor variations (e.g., capitalization, spacing).\n - If unsure, do not remove the tag.\n\n - **Adding Tags:**\n - Use the exact wording and formatting provided in the instruction for new tags. Do not modify, reformat, or adjust them in any way. This is critical.\n - When extracting tag names from instructions:\n - If the tag is in quotes: use exactly what's in the quotes, but if the quoted text contains the word \"tag\" (e.g., 'MH-T tag', \"CCM 2 tag\"), remove the word \"tag\" and keep only the tag name ('MH-T', \"CCM 2\")\n - If there are no quotes but the word \"tag\" follows the intended tag name (e.g., \"add MH-T tag\"), extract only the tag name (\"MH-T\") without the word \"tag\"\n - Always preserve all spaces, punctuation, and capitalization exactly as specified\n - If a tag exceeds **100 characters**, do not add it and state this in the \"explanation\".\n - Ensure all tags remain **unique** (no duplicates).\n - The updated list should first retain all unchanged tags, followed by any new additions.\n\n - **Unaffected Tags:**\n - Tags that are not affected by the modification instructions must remain unchanged, including spacing and formatting.\n\n 3. **Generate Output**\n - Return a JSON object containing:\n - \"updatedTags\": The final array of tags after modifications.\n - \"explanation\": A single, concise sentence summarizing all tag modifications, including the reasoning behind changes or lack thereof. Refrain from including statements about the total number of tags.\n\n ### Input\n existingTags: {existingTags}\n instructions: {instructions}\n">, any>;
@@ -23,7 +23,10 @@ exports.systemPrompt = prompts_1.ChatPromptTemplate.fromTemplate(`
23
23
 
24
24
  - **Adding Tags:**
25
25
  - Use the exact wording and formatting provided in the instruction for new tags. Do not modify, reformat, or adjust them in any way. This is critical.
26
- - Ensure that the final list does not exceed **10 tags**. If adding a tag would exceed this limit, do not add it and clarify this in the "explanation".
26
+ - When extracting tag names from instructions:
27
+ - If the tag is in quotes: use exactly what's in the quotes, but if the quoted text contains the word "tag" (e.g., 'MH-T tag', "CCM 2 tag"), remove the word "tag" and keep only the tag name ('MH-T', "CCM 2")
28
+ - If there are no quotes but the word "tag" follows the intended tag name (e.g., "add MH-T tag"), extract only the tag name ("MH-T") without the word "tag"
29
+ - Always preserve all spaces, punctuation, and capitalization exactly as specified
27
30
  - If a tag exceeds **100 characters**, do not add it and state this in the "explanation".
28
31
  - Ensure all tags remain **unique** (no duplicates).
29
32
  - The updated list should first retain all unchanged tags, followed by any new additions.
@@ -34,7 +37,7 @@ exports.systemPrompt = prompts_1.ChatPromptTemplate.fromTemplate(`
34
37
  3. **Generate Output**
35
38
  - Return a JSON object containing:
36
39
  - "updatedTags": The final array of tags after modifications.
37
- - "explanation": A single, concise sentence summarizing all tag modifications, including the reasoning behind changes or lack thereof. Do not include statements about the total number of tags.
40
+ - "explanation": A single, concise sentence summarizing all tag modifications, including the reasoning behind changes or lack thereof. Refrain from including statements about the total number of tags.
38
41
 
39
42
  ### Input
40
43
  existingTags: {existingTags}
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../../../extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAE/C,QAAA,YAAY,GAAG,4BAAkB,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC3D,CAAC,CAAA"}
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../../../extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAE/C,QAAA,YAAY,GAAG,4BAAkB,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC3D,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "2.0.236",
3
+ "version": "2.0.237",
4
4
  "packageManager": "yarn@4.5.3",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {