@discomedia/utils 1.0.64 → 1.0.65

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.0.64",
6
+ "version": "1.0.65",
7
7
  "author": "Disco Media",
8
8
  "description": "Utility functions used in Disco Media apps",
9
9
  "always-build-npm": true,
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "dotenv": "^17.3.1",
36
- "openai": "^6.31.0",
36
+ "openai": "^6.32.0",
37
37
  "p-limit": "^7.3.0",
38
38
  "tslib": "^2.8.1",
39
39
  "ws": "^8.19.0",
package/dist/test.js CHANGED
@@ -1146,6 +1146,7 @@ function isOpenRouterModel(model) {
1146
1146
  const openRouterModels = [
1147
1147
  'openai/gpt-5',
1148
1148
  'openai/gpt-5-mini',
1149
+ 'openai/gpt-5.4-mini',
1149
1150
  'openai/gpt-5-nano',
1150
1151
  'openai/gpt-5.1',
1151
1152
  'openai/gpt-5.4',
@@ -1614,7 +1615,7 @@ const safeJSON = (text) => {
1614
1615
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1615
1616
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
1616
1617
 
1617
- const VERSION = '6.31.0'; // x-release-please-version
1618
+ const VERSION = '6.32.0'; // x-release-please-version
1618
1619
 
1619
1620
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1620
1621
  const isRunningInBrowser = () => {
@@ -14960,6 +14961,11 @@ const openAiModelCosts = {
14960
14961
  cacheHitCost: 0.025 / 1_000_000,
14961
14962
  outputCost: 2 / 1_000_000,
14962
14963
  },
14964
+ 'gpt-5.4-mini': {
14965
+ inputCost: 0.25 / 1_000_000,
14966
+ cacheHitCost: 0.025 / 1_000_000,
14967
+ outputCost: 2 / 1_000_000,
14968
+ },
14963
14969
  'gpt-5-nano': {
14964
14970
  inputCost: 0.05 / 1_000_000,
14965
14971
  cacheHitCost: 0.005 / 1_000_000,
@@ -15470,6 +15476,7 @@ const isSupportedModel = (model) => {
15470
15476
  'gpt-4.1-nano',
15471
15477
  'gpt-5',
15472
15478
  'gpt-5-mini',
15479
+ 'gpt-5.4-mini',
15473
15480
  'gpt-5-nano',
15474
15481
  'gpt-5.1',
15475
15482
  'gpt-5.4',
@@ -15498,6 +15505,7 @@ function supportsTemperature(model) {
15498
15505
  'o3',
15499
15506
  'gpt-5',
15500
15507
  'gpt-5-mini',
15508
+ 'gpt-5.4-mini',
15501
15509
  'gpt-5-nano',
15502
15510
  'gpt-5.1',
15503
15511
  'gpt-5.4',
@@ -15527,6 +15535,7 @@ function isGPT5Model(model) {
15527
15535
  const gpt5Models = [
15528
15536
  'gpt-5',
15529
15537
  'gpt-5-mini',
15538
+ 'gpt-5.4-mini',
15530
15539
  'gpt-5-nano',
15531
15540
  'gpt-5.1',
15532
15541
  'gpt-5.4',
@@ -15836,6 +15845,7 @@ const MULTIMODAL_VISION_MODELS = new Set([
15836
15845
  'gpt-4o',
15837
15846
  'gpt-5',
15838
15847
  'gpt-5-mini',
15848
+ 'gpt-5.4-mini',
15839
15849
  'gpt-5-nano',
15840
15850
  'gpt-5.1',
15841
15851
  'gpt-5.4',
@@ -24994,6 +25004,48 @@ const disco = {
24994
25004
 
24995
25005
  // Test file for context functionality
24996
25006
  process.env['DEBUG'] === 'true' || false;
25007
+ async function testLLM() {
25008
+ //const models: LLMModel[] = ['gpt-5', 'gpt-5-mini', 'gpt-5.4-mini', 'gpt-5-nano'];
25009
+ const models = ['gpt-5.4-mini'];
25010
+ for (const model of models) {
25011
+ console.log(`\nTesting model: ${model}`);
25012
+ // 1. Basic call
25013
+ try {
25014
+ const basic = await disco.llm.call('What is the capital of France?', { model });
25015
+ if (!basic || !basic.response) {
25016
+ throw new Error('No response from LLM');
25017
+ }
25018
+ console.log(`Response: ${basic.response}`);
25019
+ }
25020
+ catch (e) {
25021
+ console.error(` Basic call error:`, e);
25022
+ }
25023
+ // 2. JSON call
25024
+ try {
25025
+ const jsonPrompt = 'Return a JSON object with keys country and capital for France.';
25026
+ const json = await disco.llm.call(jsonPrompt, { model, responseFormat: 'json' });
25027
+ if (!json || !json.response) {
25028
+ throw new Error('No response from LLM');
25029
+ }
25030
+ console.log(`Response: ${JSON.stringify(json.response)}`);
25031
+ }
25032
+ catch (e) {
25033
+ console.error(` JSON call error:`, e);
25034
+ }
25035
+ // 3. Web search
25036
+ try {
25037
+ const searchPrompt = 'What is the latest news about artificial intelligence? Respond with 3 sentences max.';
25038
+ const tool = await disco.llm.call(searchPrompt, { model, useWebSearch: true });
25039
+ if (!tool || !tool.response) {
25040
+ throw new Error('No response from LLM');
25041
+ }
25042
+ console.log(`Response: ${tool.response}`);
25043
+ }
25044
+ catch (e) {
25045
+ console.error(` Web search error:`, e);
25046
+ }
25047
+ }
25048
+ }
24997
25049
  async function testLLMStructuredOutputWithZod() {
24998
25050
  if (!process.env.OPENAI_API_KEY) {
24999
25051
  console.log('Skipping OpenAI structured output Zod test: OPENAI_API_KEY not set');
@@ -25008,7 +25060,7 @@ async function testLLMStructuredOutputWithZod() {
25008
25060
  try {
25009
25061
  const prompt = 'Return details for France using the exact schema.';
25010
25062
  const result = await disco.llm.call(prompt, {
25011
- model: 'gpt-5-mini',
25063
+ model: 'gpt-5.4-mini',
25012
25064
  schema: structuredSchema,
25013
25065
  schemaName: 'capital_response',
25014
25066
  schemaDescription: 'Country and capital metadata',
@@ -25039,7 +25091,6 @@ async function testLLMStructuredOutputWithZod() {
25039
25091
  // testGetPortfolioDailyHistory();
25040
25092
  // testWebSocketConnectAndDisconnect();
25041
25093
  // testGetAssetsShortableFilter();
25042
- // testLLM();
25043
25094
  // testImageModelDefaults();
25044
25095
  // testGetTradingDaysBack();
25045
25096
  // testMOOAndMOCOrders();
@@ -25049,5 +25100,6 @@ async function testLLMStructuredOutputWithZod() {
25049
25100
  // testMarketDataSubscription('SPY');
25050
25101
  // testMarketDataSubscription('FAKEPACA');
25051
25102
  // testGetTradingDate();
25103
+ testLLM();
25052
25104
  testLLMStructuredOutputWithZod();
25053
25105
  //# sourceMappingURL=test.js.map