@ryanfw/prompt-orchestration-pipeline 0.17.0 → 0.17.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanfw/prompt-orchestration-pipeline",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "A Prompt-orchestration pipeline (POP) is a framework for building, running, and experimenting with complex chains of LLM tasks.",
5
5
  "type": "module",
6
6
  "main": "src/ui/server.js",
@@ -27,7 +27,12 @@ export const validateWithSchema = (schema, data) => {
27
27
  }
28
28
  }
29
29
 
30
- const validateFunction = ajv.compile(schema);
30
+ // Check if schema already exists, otherwise compile and cache it
31
+ let validateFunction = schema.$id ? ajv.getSchema(schema.$id) : null;
32
+ if (!validateFunction) {
33
+ validateFunction = ajv.compile(schema);
34
+ }
35
+
31
36
  const isValid = validateFunction(parsedData);
32
37
 
33
38
  if (isValid) {