@mate-academy/llm-gateway 2.1.6 → 2.1.8

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.
@@ -35,7 +35,7 @@ type ConditionalValue = RegularValue | boolean | undefined | null;
35
35
  type ExtractAllVariables<T extends string> = T extends `${string}{{${infer Key}}}${infer Rest}` ? Key extends `${infer CleanKey}` ? CleanKey | ExtractAllVariables<Rest> : never : never;
36
36
  type ExtractSectionVariables<T extends string> = T extends `${string}{{#${infer Key}}}${infer Rest}` ? Key | ExtractSectionVariables<Rest> : T extends `${string}{{/${infer Key}}}${infer Rest}` ? Key | ExtractSectionVariables<Rest> : never;
37
37
  type ExtractRegularVariables<T extends string> = ExtractAllVariables<T> extends infer All ? All extends string ? All extends `#${string}` | `/${string}` ? never : All : never : never;
38
- type CreateVariableRecord<T extends string> = ExtractRegularVariables<T> extends never ? ExtractSectionVariables<T> extends never ? Record<string, never> : Record<ExtractSectionVariables<T>, RegularValue> : ExtractSectionVariables<T> extends never ? Record<ExtractRegularVariables<T>, RegularValue> : Record<ExtractRegularVariables<T>, RegularValue> & Record<ExtractSectionVariables<T>, ConditionalValue>;
38
+ type CreateVariableRecord<T extends string> = ExtractRegularVariables<T> extends never ? ExtractSectionVariables<T> extends never ? Record<string, never> : Record<ExtractSectionVariables<T>, RegularValue> : ExtractSectionVariables<T> extends never ? Record<ExtractRegularVariables<T>, RegularValue> : Omit<Record<ExtractRegularVariables<T>, RegularValue>, ExtractSectionVariables<T>> & Record<ExtractSectionVariables<T>, ConditionalValue>;
39
39
  type HasVariables<T extends string> = ExtractAllVariables<T> extends never ? false : true;
40
40
  /**
41
41
  * Creates a prompt template function that can be used to generate prompts with dynamic replacements and conditional sections.
@@ -1 +1 @@
1
- {"version":3,"file":"promptBuilder.js","sourceRoot":"","sources":["../src/promptBuilder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;AAkHH,oDAQC;A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AM,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAE5C,6CAA6C;IAC7C,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAElC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAmB,QAAW;IAChE,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,EAAO,CAAC;IAE7C,OAAO,CACL,GAAG,IAEqC,EAChC,EAAE,CAAC,aAAa,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC,CAAC;AACvD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mate-academy/llm-gateway",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "description": "A gateway package for LLM services.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -49,29 +49,30 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@mate-academy/ts-config": "^1.0.5",
52
- "@types/glob": "^8.1.0",
52
+ "@types/glob": "^9.0.0",
53
53
  "@types/inquirer": "^9.0.8",
54
54
  "@types/jest": "^30.0.0",
55
55
  "@types/mime-types": "^3.0.1",
56
- "@typescript-eslint/eslint-plugin": "^8.33.1",
57
- "dotenv": "^16.5.0",
58
- "eslint": "^9.29.0",
56
+ "@typescript-eslint/eslint-plugin": "^8.36.0",
57
+ "dotenv": "^17.1.0",
58
+ "eslint": "^9.30.1",
59
+ "eslint-plugin-no-only-tests": "^3.3.0",
59
60
  "glob": "^11.0.3",
60
- "inquirer": "^12.6.3",
61
- "jest": "^30.0.2",
61
+ "inquirer": "^12.7.0",
62
+ "jest": "^30.0.4",
62
63
  "terser": "^5.43.1",
63
64
  "ts-jest": "^29.4.0",
64
65
  "tsc-alias": "^1.8.16",
65
66
  "typescript": "^5.8.3",
66
- "typescript-eslint": "^8.34.1"
67
+ "typescript-eslint": "^8.36.0"
67
68
  },
68
69
  "dependencies": {
69
- "@google/genai": "^1.6.0",
70
+ "@google/genai": "^1.8.0",
70
71
  "@mate-academy/core": "^1.10.4",
71
72
  "axios": "^1.10.0",
72
73
  "js-tiktoken": "^1.0.20",
73
74
  "mime-types": "^3.0.1",
74
- "openai": "^5.6.0",
75
+ "openai": "^5.8.2",
75
76
  "uuid": "^11.1.0"
76
77
  }
77
78
  }