@discomedia/utils 1.0.14 → 1.0.16
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/dist/index-frontend.cjs +8 -10
- package/dist/index-frontend.cjs.map +1 -1
- package/dist/index-frontend.mjs +8 -10
- package/dist/index-frontend.mjs.map +1 -1
- package/dist/index.cjs +9 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +9 -11
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/test.js +8 -8
- package/dist/test.js.map +1 -1
- package/dist/types/llm-openai.d.ts +1 -8
- package/dist/types/llm-openai.d.ts.map +1 -1
- package/dist/types/market-time.d.ts +0 -1
- package/dist/types/market-time.d.ts.map +1 -1
- package/dist/types/types/llm-types.d.ts +7 -0
- package/dist/types/types/llm-types.d.ts.map +1 -1
- package/dist/types-frontend/llm-openai.d.ts +1 -8
- package/dist/types-frontend/llm-openai.d.ts.map +1 -1
- package/dist/types-frontend/market-time.d.ts +0 -1
- package/dist/types-frontend/market-time.d.ts.map +1 -1
- package/dist/types-frontend/types/llm-types.d.ts +7 -0
- package/dist/types-frontend/types/llm-types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -309,12 +309,10 @@ class TimeFormatter {
|
|
|
309
309
|
*/
|
|
310
310
|
class MarketTimeCalculator {
|
|
311
311
|
calendar;
|
|
312
|
-
formatter;
|
|
313
312
|
timezone;
|
|
314
313
|
constructor(timezone = MARKET_CONFIG.TIMEZONE) {
|
|
315
314
|
this.timezone = timezone;
|
|
316
315
|
this.calendar = new MarketCalendar(timezone);
|
|
317
|
-
this.formatter = new TimeFormatter(timezone);
|
|
318
316
|
}
|
|
319
317
|
/**
|
|
320
318
|
* Get market open/close times for a date
|
|
@@ -804,7 +802,7 @@ function getTradingStartAndEndDates(options = {}) {
|
|
|
804
802
|
}
|
|
805
803
|
return { startDate, endDate: endMarketClose };
|
|
806
804
|
}
|
|
807
|
-
// Export the
|
|
805
|
+
// Export the MARKET_TIMES constant for backward compatibility
|
|
808
806
|
const MARKET_TIMES = {
|
|
809
807
|
TIMEZONE: MARKET_CONFIG.TIMEZONE,
|
|
810
808
|
PRE: {
|
|
@@ -9401,7 +9399,7 @@ const makeResponsesAPICall = async (input, options = {}) => {
|
|
|
9401
9399
|
* });
|
|
9402
9400
|
*/
|
|
9403
9401
|
async function makeLLMCall(input, options = {}) {
|
|
9404
|
-
const { apiKey, model = DEFAULT_MODEL$1, responseFormat = 'text', tools, useCodeInterpreter = false, useWebSearch = false, imageBase64, imageDetail = 'high', context } = options;
|
|
9402
|
+
const { apiKey, model = DEFAULT_MODEL$1, responseFormat = 'text', tools, useCodeInterpreter = false, useWebSearch = false, imageBase64, imageDetail = 'high', context, } = options;
|
|
9405
9403
|
// Validate model
|
|
9406
9404
|
const normalizedModel = normalizeModelName(model);
|
|
9407
9405
|
if (!isSupportedModel(normalizedModel)) {
|
|
@@ -9417,7 +9415,7 @@ async function makeLLMCall(input, options = {}) {
|
|
|
9417
9415
|
conversationMessages.push({
|
|
9418
9416
|
role: contextMsg.role,
|
|
9419
9417
|
content: contextMsg.content,
|
|
9420
|
-
type: 'message'
|
|
9418
|
+
type: 'message',
|
|
9421
9419
|
});
|
|
9422
9420
|
}
|
|
9423
9421
|
// Add current input message
|
|
@@ -9431,9 +9429,9 @@ async function makeLLMCall(input, options = {}) {
|
|
|
9431
9429
|
type: 'input_image',
|
|
9432
9430
|
detail: imageDetail,
|
|
9433
9431
|
image_url: imageBase64.startsWith('data:') ? imageBase64 : `data:image/webp;base64,${imageBase64}`,
|
|
9434
|
-
}
|
|
9432
|
+
},
|
|
9435
9433
|
],
|
|
9436
|
-
type: 'message'
|
|
9434
|
+
type: 'message',
|
|
9437
9435
|
});
|
|
9438
9436
|
}
|
|
9439
9437
|
else {
|
|
@@ -9441,7 +9439,7 @@ async function makeLLMCall(input, options = {}) {
|
|
|
9441
9439
|
conversationMessages.push({
|
|
9442
9440
|
role: 'user',
|
|
9443
9441
|
content: input,
|
|
9444
|
-
type: 'message'
|
|
9442
|
+
type: 'message',
|
|
9445
9443
|
});
|
|
9446
9444
|
}
|
|
9447
9445
|
processedInput = conversationMessages;
|
|
@@ -9457,10 +9455,10 @@ async function makeLLMCall(input, options = {}) {
|
|
|
9457
9455
|
type: 'input_image',
|
|
9458
9456
|
detail: imageDetail,
|
|
9459
9457
|
image_url: imageBase64.startsWith('data:') ? imageBase64 : `data:image/webp;base64,${imageBase64}`,
|
|
9460
|
-
}
|
|
9458
|
+
},
|
|
9461
9459
|
],
|
|
9462
|
-
type: 'message'
|
|
9463
|
-
}
|
|
9460
|
+
type: 'message',
|
|
9461
|
+
},
|
|
9464
9462
|
];
|
|
9465
9463
|
}
|
|
9466
9464
|
else {
|