@christianriedl/utils 1.0.151 → 1.0.153

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/iOpenAI.d.ts CHANGED
@@ -30,6 +30,7 @@ export interface IResponseResult {
30
30
  text?: string;
31
31
  error?: string;
32
32
  image?: string;
33
+ imageFormat?: string;
33
34
  json?: any;
34
35
  usage?: {
35
36
  inputTokens: number;
@@ -43,7 +44,7 @@ export interface ISchema {
43
44
  schema?: Dictionary<unknown>;
44
45
  }
45
46
  export interface ITool {
46
- type: 'mcp' | 'file_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'function' | 'image_generation';
47
+ type: 'mcp' | 'file_search' | 'web_search' | 'function' | 'image_generation';
47
48
  }
48
49
  export interface IMcpTool extends ITool {
49
50
  type: 'mcp';
@@ -76,7 +77,8 @@ export interface IImageGenerationTool extends ITool {
76
77
  size?: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
77
78
  }
78
79
  export interface IWebSearchTool extends ITool {
79
- type: 'web_search_preview' | 'web_search_preview_2025_03_11';
80
+ type: 'web_search';
81
+ allowed_domains?: string;
80
82
  search_context_size?: 'low' | 'medium' | 'high';
81
83
  user_location?: IWebSearchLocation | null;
82
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christianriedl/utils",
3
- "version": "1.0.151",
3
+ "version": "1.0.153",
4
4
  "description": "Interfaces, local storage, service worker, configuration, application state",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -65,7 +65,10 @@
65
65
  }
66
66
  }
67
67
  if (answer && answer.image) {
68
- imageSrc.value = 'data:image/jpeg;base64, ' + answer.image;
68
+ if (answer.imageFormat)
69
+ imageSrc.value = `data:image/${answer.imageFormat};base64, ` + answer.image;
70
+ else
71
+ imageSrc.value = 'data:image/jpeg;base64, ' + answer.image;
69
72
  }
70
73
  if (answer && answer.text) {
71
74
  emits('result', answer.text);
@@ -67,7 +67,7 @@
67
67
  }
68
68
  fileSearch[key] = names;
69
69
  }
70
- else if (tool.type.startsWith("web_search")) {
70
+ else if (tool.type === "web_search") {
71
71
  tool.user_location = Object.assign({}, tool.user_location);
72
72
  }
73
73
  }
@@ -458,19 +458,22 @@
458
458
  <v-checkbox v-model="use[key]" label="Use" hide-details density="compact" @update:modelValue="onUseChange"></v-checkbox>
459
459
  </v-col>
460
460
  </v-row>
461
- <v-row v-if="tool.type.startsWith('web_search')" dense align="center">
461
+ <v-row v-if="tool.type == 'web_search'" dense align="center">
462
462
  <v-col cols="1">
463
- <v-text-field :model-value="key" type="string" hide-details disabled label="file_search" density="compact" @change="onToolChange"></v-text-field>
463
+ <v-text-field :model-value="key" type="string" hide-details disabled label="web_search" density="compact" @change="onToolChange"></v-text-field>
464
464
  </v-col>
465
465
  <v-col cols="2">
466
466
  <v-text-field v-model="tool.user_location.country" type="string" hide-details :clearable="canClear" label="Country" density="compact" @change="onToolChange"></v-text-field>
467
467
  </v-col>
468
- <v-col cols="3">
468
+ <v-col cols="2">
469
469
  <v-text-field v-model="tool.user_location.city" type="string" hide-details :clearable="canClear" label="City" density="compact" @change="onToolChange"></v-text-field>
470
470
  </v-col>
471
- <v-col cols="4">
471
+ <v-col cols="2">
472
472
  <v-text-field v-model="tool.user_location.region" type="string" hide-details :clearable="canClear" label="Region" density="compact" @change="onToolChange"></v-text-field>
473
473
  </v-col>
474
+ <v-col cols="3">
475
+ <v-text-field v-model="tool.allowed_domains" type="string" hide-details :clearable="canClear" label="Allowed domains" density="compact" @change="onToolChange"></v-text-field>
476
+ </v-col>
474
477
  <v-col cols="1">
475
478
  <v-btn icon="$delete" variant="tonal" @click.stop.prevent="onDelete(key)"></v-btn>
476
479
  </v-col>