@christianriedl/utils 1.0.122 → 1.0.124

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.
Files changed (2) hide show
  1. package/dist/iOpenAI.d.ts +54 -4
  2. package/package.json +1 -1
package/dist/iOpenAI.d.ts CHANGED
@@ -18,17 +18,67 @@ export interface ISchema {
18
18
  name: string;
19
19
  schema?: Dictionary<unknown>;
20
20
  }
21
+ export interface ITool {
22
+ type: 'mcp' | 'file_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'function';
23
+ label: string;
24
+ }
25
+ export interface IMcpTool extends ITool {
26
+ type: 'mcp';
27
+ server_label: string;
28
+ server_url: string;
29
+ allowed_tools?: string[];
30
+ require_approval?: 'always' | 'never' | null;
31
+ server_description?: string;
32
+ }
33
+ export interface IFileSearchTool extends ITool {
34
+ type: 'file_search';
35
+ vector_store_ids: string[];
36
+ vector_store_names: string[];
37
+ filters?: any;
38
+ max_num_results?: number;
39
+ }
40
+ export interface IWebSearchLocation {
41
+ type: 'approximate';
42
+ city?: string | null;
43
+ country?: string | null;
44
+ region?: string | null;
45
+ }
46
+ export interface IWebSearchTool extends ITool {
47
+ type: 'web_search_preview' | 'web_search_preview_2025_03_11';
48
+ search_context_size?: 'low' | 'medium' | 'high';
49
+ user_location?: IWebSearchLocation | null;
50
+ }
51
+ export interface IFunctionTool {
52
+ type: 'function';
53
+ name: string;
54
+ parameters: Dictionary<unknown> | null;
55
+ strict: boolean | null;
56
+ description?: string | null;
57
+ }
58
+ export interface IOpenAIOptions {
59
+ model: string;
60
+ instructions?: string | null;
61
+ outputFormat: 'text' | 'markdown' | 'html';
62
+ reasoning_effort_level: 'minimum' | 'low' | 'medium' | 'high';
63
+ max_output_tokens?: number | null;
64
+ save?: boolean | null;
65
+ store?: boolean | null;
66
+ temperature?: number | null;
67
+ top_p?: number | null;
68
+ }
21
69
  export interface IOpenAIService {
22
70
  log: ILogger;
71
+ options: IOpenAIOptions;
23
72
  response(prompt: string | string[], tools?: string[], imageUrl?: string, json?: ISchema): Promise<IResponseResult>;
24
73
  clearContext(): void;
25
74
  }
26
75
  export type ToolFunction = (input: Dictionary<unknown>) => Promise<Dictionary<any>>;
27
76
  export interface IOpenAIServiceWithTools extends IOpenAIService {
28
- addMcpTool(label: string, url: string, desc: string, allowedTools?: string[]): void;
29
- addFileSearchTool(label: string, vectorStore: string): boolean;
30
- addWebSearchTool(label: string, country?: string, city?: string, region?: string): void;
31
- addFunctionTool(functionName: string, description: string, parameters: Dictionary<unknown>, toolFunction: ToolFunction): void;
77
+ aiTools: Dictionary<ITool>;
78
+ addMcpTool(tool: IMcpTool): void;
79
+ addFileSearchTool(label: string, tool: IFileSearchTool): boolean;
80
+ addWebSearchTool(label: string, tool: IWebSearchTool): void;
81
+ addFunctionTool(tool: IFunctionTool, toolFunction: ToolFunction): void;
32
82
  }
33
83
  export interface IVectorStore {
34
84
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christianriedl/utils",
3
- "version": "1.0.122",
3
+ "version": "1.0.124",
4
4
  "description": "Interfaces, local storage, service worker, configuration, application state",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",