@promptbook/fake-llm 0.105.0-3 → 0.105.0-4

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": "@promptbook/fake-llm",
3
- "version": "0.105.0-3",
3
+ "version": "0.105.0-4",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -96,7 +96,7 @@
96
96
  "module": "./esm/index.es.js",
97
97
  "typings": "./esm/typings/src/_packages/fake-llm.index.d.ts",
98
98
  "peerDependencies": {
99
- "@promptbook/core": "0.105.0-3"
99
+ "@promptbook/core": "0.105.0-4"
100
100
  },
101
101
  "dependencies": {
102
102
  "crypto": "1.0.1",
package/umd/index.umd.js CHANGED
@@ -22,7 +22,7 @@
22
22
  * @generated
23
23
  * @see https://github.com/webgptorg/promptbook
24
24
  */
25
- const PROMPTBOOK_ENGINE_VERSION = '0.105.0-3';
25
+ const PROMPTBOOK_ENGINE_VERSION = '0.105.0-4';
26
26
  /**
27
27
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
28
28
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -6332,7 +6332,12 @@
6332
6332
  description: 'Get the current date and time in ISO 8601 format.',
6333
6333
  parameters: {
6334
6334
  type: 'object',
6335
- properties: {},
6335
+ properties: {
6336
+ timezone: {
6337
+ type: 'string',
6338
+ description: 'Optional timezone name (e.g. "Europe/Prague", "UTC", "America/New_York").',
6339
+ },
6340
+ },
6336
6341
  required: [],
6337
6342
  },
6338
6343
  },
@@ -6352,9 +6357,36 @@
6352
6357
  */
6353
6358
  getToolFunctions() {
6354
6359
  return {
6355
- async get_current_time() {
6356
- console.log('!!!! [Tool] get_current_time called');
6357
- return new Date().toISOString();
6360
+ async get_current_time(args) {
6361
+ var _a;
6362
+ console.log('!!!! [Tool] get_current_time called', { args });
6363
+ const { timezone } = args;
6364
+ if (!timezone) {
6365
+ return new Date().toISOString();
6366
+ }
6367
+ try {
6368
+ // Note: Returning ISO 8601 string but in the requested timezone
6369
+ const formatter = new Intl.DateTimeFormat('en-CA', {
6370
+ timeZone: timezone,
6371
+ year: 'numeric',
6372
+ month: '2-digit',
6373
+ day: '2-digit',
6374
+ hour: '2-digit',
6375
+ minute: '2-digit',
6376
+ second: '2-digit',
6377
+ hour12: false,
6378
+ timeZoneName: 'shortOffset',
6379
+ });
6380
+ const parts = formatter.formatToParts(new Date());
6381
+ const part = (type) => { var _a; return (_a = parts.find((p) => p.type === type)) === null || _a === void 0 ? void 0 : _a.value; };
6382
+ // en-CA format is YYYY-MM-DD
6383
+ const isoString = `${part('year')}-${part('month')}-${part('day')}T${part('hour')}:${part('minute')}:${part('second')}${(_a = part('timeZoneName')) === null || _a === void 0 ? void 0 : _a.replace('GMT', '')}`;
6384
+ return isoString;
6385
+ }
6386
+ catch (error) {
6387
+ // Fallback to UTC if timezone is invalid
6388
+ return new Date().toISOString();
6389
+ }
6358
6390
  },
6359
6391
  };
6360
6392
  }