@peopl-health/nexus 5.10.0-dev.1060 → 5.10.0-dev.1062
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.
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
const { registerTool } = require('../../services/toolRegistryService');
|
|
1
|
+
const { registerTool, unregisterTool } = require('../../services/toolRegistryService');
|
|
2
|
+
const { patternConsultLive } = require('../flags/patternConsultFlags');
|
|
3
|
+
const requestPatternConsultTool = require('./requestPatternConsultTool');
|
|
4
|
+
const analyzeSymptomPatternsTool = require('./analyzeSymptomPatternsTool');
|
|
2
5
|
|
|
3
6
|
const TOOLS = [
|
|
4
7
|
require('./extractClinicalInfoTool'),
|
|
@@ -11,7 +14,6 @@ const TOOLS = [
|
|
|
11
14
|
require('./openClusterHypothesisTool'),
|
|
12
15
|
require('./updateClusterHypothesisTool'),
|
|
13
16
|
require('./submitRoutingDecisionTool'),
|
|
14
|
-
require('./analyzeSymptomPatternsTool'),
|
|
15
17
|
require('./openConditionTool'),
|
|
16
18
|
require('./recordClinicalImpressionTool'),
|
|
17
19
|
require('./getActiveSymptomLandscapeTool'),
|
|
@@ -25,7 +27,10 @@ const TOOLS = [
|
|
|
25
27
|
];
|
|
26
28
|
|
|
27
29
|
function registerClinicalTools() {
|
|
28
|
-
|
|
30
|
+
const patternTool = patternConsultLive() ? requestPatternConsultTool : analyzeSymptomPatternsTool;
|
|
31
|
+
unregisterTool(requestPatternConsultTool.definition.name);
|
|
32
|
+
unregisterTool(analyzeSymptomPatternsTool.definition.name);
|
|
33
|
+
for (const tool of [...TOOLS, patternTool]) {
|
|
29
34
|
registerTool({
|
|
30
35
|
name: tool.definition.name,
|
|
31
36
|
description: tool.definition.description,
|
|
@@ -55,6 +55,10 @@ async function executeTool(name, args, context = {}) {
|
|
|
55
55
|
return await tool.execute(args, context);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
function unregisterTool(name) {
|
|
59
|
+
return registry.delete(name);
|
|
60
|
+
}
|
|
61
|
+
|
|
58
62
|
function hasTool(name) {
|
|
59
63
|
return registry.has(name);
|
|
60
64
|
}
|
|
@@ -69,6 +73,7 @@ function clearRegistry() {
|
|
|
69
73
|
|
|
70
74
|
module.exports = {
|
|
71
75
|
registerTool,
|
|
76
|
+
unregisterTool,
|
|
72
77
|
getToolSchemas,
|
|
73
78
|
executeTool,
|
|
74
79
|
hasTool,
|