@hitc/netsuite-types 2026.1.4 → 2026.1.6
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/N/format/i18n.d.ts +2 -2
- package/N/llm.d.ts +350 -43
- package/N/ui/serverWidget.d.ts +2 -2
- package/package.json +1 -1
package/N/format/i18n.d.ts
CHANGED
|
@@ -45,9 +45,9 @@ export function getCurrencyFormatter(options: GetCurrencyFormatterOptions): Curr
|
|
|
45
45
|
/** Create format.NumberFormatter object to format numbers into strings. Costs 10 governance units. */
|
|
46
46
|
export function getNumberFormatter(options?: GetNumberFormatterOptions): NumberFormatter;
|
|
47
47
|
|
|
48
|
-
export function getPhoneNumberFormatter(options: {
|
|
48
|
+
export function getPhoneNumberFormatter(options: { formatType: PhoneNumberFormatType }): PhoneNumberFormatter;
|
|
49
49
|
|
|
50
|
-
export function getPhoneNumberParser(options: { defaultCountry: Country }): PhoneNumberParser;
|
|
50
|
+
export function getPhoneNumberParser(options: { defaultCountry: Country }): PhoneNumberParser;
|
|
51
51
|
|
|
52
52
|
interface GetCurrencyFormatterOptions {
|
|
53
53
|
/** Code of the currency that is used by formatter. */
|
package/N/llm.d.ts
CHANGED
|
@@ -31,19 +31,140 @@ interface Citation {
|
|
|
31
31
|
|
|
32
32
|
/** The response returned from LLM. Use the llm.generateText(options) or the llm.generateText.promise(options) method to retrieve a response from the LLM. */
|
|
33
33
|
interface Response {
|
|
34
|
+
/** List of chat messages. */
|
|
35
|
+
readonly chatHistory: ChatMessage[];
|
|
36
|
+
/** List of citations used to generate the response. */
|
|
34
37
|
readonly citations: Citation[];
|
|
38
|
+
/** List of documents used to generate the response. */
|
|
35
39
|
readonly documents: Document[];
|
|
36
|
-
|
|
40
|
+
/** Model used to produce the LLM response. */
|
|
37
41
|
readonly model: string;
|
|
38
|
-
|
|
42
|
+
/** Text returned by the LLM. */
|
|
43
|
+
readonly text: string;
|
|
44
|
+
/** Tool calls requested by the LLM. @since 2025.2 */
|
|
45
|
+
readonly toolCalls: ToolCall[];
|
|
46
|
+
/** Token usage for a request to the LLM. @since 2025.2 */
|
|
47
|
+
readonly usage: Usage;
|
|
39
48
|
}
|
|
40
49
|
|
|
50
|
+
/**
|
|
51
|
+
* The streamed response returned from the LLM.
|
|
52
|
+
* Use llm.generateTextStreamed(options) or llm.evaluatePromptStreamed(options) (or their promise versions) to retrieve a streamed response.
|
|
53
|
+
*
|
|
54
|
+
* You can access the partial response (using the StreamedResponse.text property) before the entire response has been generated, as well as StreamedResponse.model.
|
|
55
|
+
* Other properties (such as StreamedResponse.documents and StreamedResponse.citations) are accessible only after the entire response has been generated.
|
|
56
|
+
*/
|
|
41
57
|
interface StreamedResponse {
|
|
58
|
+
/** List of chat messages. */
|
|
59
|
+
readonly chatHistory: ChatMessage[];
|
|
60
|
+
/** List of citations used to generate the streamed response. */
|
|
42
61
|
readonly citations: Citation[];
|
|
62
|
+
/** List of documents used to generate the streamed response. */
|
|
43
63
|
readonly documents: Document[];
|
|
44
|
-
|
|
64
|
+
/** Model used to produce the streamed response. */
|
|
45
65
|
readonly model: string;
|
|
46
|
-
|
|
66
|
+
/** Text returned by the LLM. While streaming, this contains the partial response received so far. */
|
|
67
|
+
readonly text: string;
|
|
68
|
+
/** Tool calls requested by the LLM. @since 2025.2 */
|
|
69
|
+
readonly toolCalls: ToolCall[];
|
|
70
|
+
/**
|
|
71
|
+
* Returns an iterator that lets you examine each token returned by the LLM as it is generated.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* const response = llm.generateTextStreamed({ prompt: 'Hello World' });
|
|
75
|
+
* const iter = response.iterator();
|
|
76
|
+
* iter.each((token) => {
|
|
77
|
+
* log.debug('token.value: ' + token.value);
|
|
78
|
+
* log.debug('response.text: ' + response.text); // Partial response up to and including this token
|
|
79
|
+
* return true;
|
|
80
|
+
* });
|
|
81
|
+
*/
|
|
82
|
+
iterator(): StreamedResponseIterator;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface StreamedResponseIterator {
|
|
86
|
+
/** Iterates over each token returned by the LLM. Return true from the callback to continue iterating, or false to stop. */
|
|
87
|
+
each(callback: (token: { value: string }) => boolean): void;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* A tool the LLM can request. Created using llm.createTool(options).
|
|
92
|
+
*
|
|
93
|
+
* Tools are callable operations that the LLM can request to augment its responses.
|
|
94
|
+
* They are custom utilities that you define, and they let the LLM retrieve external data (such as data from NetSuite using SuiteQL),
|
|
95
|
+
* perform calculations, or trigger business logic as part of an LLM interaction.
|
|
96
|
+
*
|
|
97
|
+
* Provide tools to llm.generateText(options) or llm.generateTextStreamed(options) using the options.tools parameter.
|
|
98
|
+
* @since 2025.2
|
|
99
|
+
*/
|
|
100
|
+
interface Tool {
|
|
101
|
+
/** The description of the tool. Helps the LLM understand when to request the tool. */
|
|
102
|
+
readonly description: string;
|
|
103
|
+
/** The name of the tool. Used when the LLM refers to this tool in tool call requests. */
|
|
104
|
+
readonly name: string;
|
|
105
|
+
/** The parameters of the tool. */
|
|
106
|
+
readonly parameters: ToolParameter[];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A tool call request from the LLM, returned as part of the response from llm.generateText(options) or llm.generateTextStreamed(options)
|
|
111
|
+
* through the Response.toolCalls or StreamedResponse.toolCalls property.
|
|
112
|
+
*
|
|
113
|
+
* The LLM generates a tool call request when it determines that running a particular tool may help provide a more accurate or useful response to your prompt.
|
|
114
|
+
* Your SuiteScript code is responsible for iterating over these tool calls, running the appropriate handler logic with the provided parameters,
|
|
115
|
+
* and returning the results to the LLM (as llm.ToolResult objects created using llm.createToolResult(options)).
|
|
116
|
+
* @since 2025.2
|
|
117
|
+
*/
|
|
118
|
+
interface ToolCall {
|
|
119
|
+
/** The name of the requested tool. */
|
|
120
|
+
readonly name: string;
|
|
121
|
+
/**
|
|
122
|
+
* The parameters of the requested tool as key-value pairs for each input parameter required by the tool, as specified in the tool definition.
|
|
123
|
+
*
|
|
124
|
+
* Note: The N/llm Module Members table lists this property's type as llm.ToolParameter[], but the llm.ToolCall object description and the
|
|
125
|
+
* examples in "Tooling in the N/llm Module" show a plain object of key-value pairs (e.g. TOOL_HANDLERS[call.name](call.parameters) where
|
|
126
|
+
* the handler reads options.userName).
|
|
127
|
+
*/
|
|
128
|
+
readonly parameters: { [name: string]: any };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* A parameter for a tool. Created using llm.createToolParameter(options).
|
|
133
|
+
*
|
|
134
|
+
* Tool parameters define the individual input values that the LLM must provide when requesting a tool call.
|
|
135
|
+
* @since 2025.2
|
|
136
|
+
*/
|
|
137
|
+
interface ToolParameter {
|
|
138
|
+
/** The description of the tool parameter. Helps the LLM prompt for and fill in the value correctly. */
|
|
139
|
+
readonly description: string;
|
|
140
|
+
/** The name of the tool parameter. Used when the LLM refers to this specific input in tool call requests. */
|
|
141
|
+
readonly name: string;
|
|
142
|
+
/** The type of the tool parameter. Values are from the llm.ToolParameterType enum. */
|
|
143
|
+
readonly type: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* A tool result to send back to the LLM. Created using llm.createToolResult(options).
|
|
148
|
+
*
|
|
149
|
+
* Tool results let you send the output of a tool (such as the result of a SuiteQL query or a business operation) back to the LLM
|
|
150
|
+
* by providing them to subsequent llm.generateText(options) or llm.generateTextStreamed(options) calls using the options.toolResults parameter.
|
|
151
|
+
* @since 2025.2
|
|
152
|
+
*/
|
|
153
|
+
interface ToolResult {
|
|
154
|
+
/** The originating tool call request from the LLM. */
|
|
155
|
+
readonly call: ToolCall;
|
|
156
|
+
/** The outputs from running the tool specified in the tool call request. */
|
|
157
|
+
readonly outputs: object[];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Token usage for a request to the LLM. Returned through the Response.usage property. @since 2025.2 */
|
|
161
|
+
interface Usage {
|
|
162
|
+
/** The number of tokens in the response from the LLM. */
|
|
163
|
+
readonly completionTokens: number;
|
|
164
|
+
/** The number of tokens in the request to the LLM. */
|
|
165
|
+
readonly promptTokens: number;
|
|
166
|
+
/** The total number of tokens for the entire request to the LLM. */
|
|
167
|
+
readonly totalTokens: number;
|
|
47
168
|
}
|
|
48
169
|
|
|
49
170
|
/**
|
|
@@ -65,7 +186,64 @@ export function createChatMessage(options: { role: string, text: string }): Chat
|
|
|
65
186
|
*/
|
|
66
187
|
export function createDocument(options: { data: string, id: string }): Document;
|
|
67
188
|
|
|
68
|
-
|
|
189
|
+
/**
|
|
190
|
+
* Creates a tool definition that you can provide when calling llm.generateText(options) or llm.generateTextStreamed(options) using the options.tools parameter.
|
|
191
|
+
*
|
|
192
|
+
* Tools are callable operations that the LLM can request to augment its responses. They are custom utilities that you define, and they let the LLM
|
|
193
|
+
* retrieve external data (such as data from NetSuite using SuiteQL), perform calculations, or trigger business logic as part of an LLM interaction.
|
|
194
|
+
* You can create and provide multiple tool definitions based on your use cases.
|
|
195
|
+
* @governance none
|
|
196
|
+
* @since 2025.2
|
|
197
|
+
*/
|
|
198
|
+
export function createTool(options: {
|
|
199
|
+
/** A description of what the tool does. This parameter helps the LLM understand when to request the tool. */
|
|
200
|
+
description: string,
|
|
201
|
+
/** A unique identifier for the tool. Used when the LLM refers to this tool in tool call requests (which are represented as llm.ToolCall objects). */
|
|
202
|
+
name: string,
|
|
203
|
+
/** An array of tool parameters, which are created using llm.createToolParameter(options). These parameters specify the input values required to run the tool. */
|
|
204
|
+
parameters: ToolParameter[],
|
|
205
|
+
}): Tool;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Creates a tool parameter that you can provide when creating a tool using llm.createTool(options).
|
|
209
|
+
*
|
|
210
|
+
* Tool parameters define the individual input values that the LLM must provide when requesting a tool call.
|
|
211
|
+
* These parameters help the LLM understand how to call the tool accurately and ensure that tool call requests include all necessary and correctly typed data.
|
|
212
|
+
* @governance none
|
|
213
|
+
* @since 2025.2
|
|
214
|
+
*/
|
|
215
|
+
export function createToolParameter(options: {
|
|
216
|
+
/** A description of what data the tool parameter represents. This parameter helps the LLM prompt for and fill in the value correctly. */
|
|
217
|
+
description: string,
|
|
218
|
+
/** A unique identifier for the tool parameter. Used when the LLM refers to this specific input in tool call requests. */
|
|
219
|
+
name: string,
|
|
220
|
+
/** The data type of the parameter. Use values from the llm.ToolParameterType enum to set this parameter. */
|
|
221
|
+
type: ToolParameterType | string,
|
|
222
|
+
}): ToolParameter;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Creates a tool result that you can provide when calling llm.generateText(options) or llm.generateTextStreamed(options) using the options.toolResults parameter.
|
|
226
|
+
*
|
|
227
|
+
* Tool results let you send the output of a tool (such as the result of a SuiteQL query or a business operation) back to the LLM.
|
|
228
|
+
* You generate tool results in your SuiteScript code after handling a tool call request, which is represented by a llm.ToolCall object.
|
|
229
|
+
* @governance none
|
|
230
|
+
* @since 2025.2
|
|
231
|
+
*/
|
|
232
|
+
export function createToolResult(options: {
|
|
233
|
+
/** The original tool call request from the LLM. This parameter links the result to a specific tool call request. */
|
|
234
|
+
call: ToolCall,
|
|
235
|
+
/** An array of output objects representing the results of running the tool. Each output object typically includes a result property (or another relevant property) that contains the value to send back to the LLM. */
|
|
236
|
+
outputs: object[],
|
|
237
|
+
}): ToolResult;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Returns the embeddings from the LLM for a given input.
|
|
241
|
+
*
|
|
242
|
+
* You can use embeddings to compare the similarity of a set of inputs, which is useful for finding similar items based on item attributes,
|
|
243
|
+
* implementing semantic search, and applying text classification or text clustering.
|
|
244
|
+
* @governance 50
|
|
245
|
+
*/
|
|
246
|
+
export const embed: IEmbedFunction;
|
|
69
247
|
|
|
70
248
|
/**
|
|
71
249
|
* Takes the ID of an existing prompt and values for variables used in the prompt and returns the response from the LLM.
|
|
@@ -77,31 +255,55 @@ export const embed: IEmbededFunction
|
|
|
77
255
|
* When unlimited usage mode is used, this method accepts the OCI configuration parameters.
|
|
78
256
|
* You can also specify OCI configuration parameters on the SuiteScript tab of the AI Preferences page.
|
|
79
257
|
* For more information, see Using Your Own OCI Configuration for SuiteScript Generative AI APIs.
|
|
258
|
+
* @governance 100
|
|
80
259
|
*/
|
|
81
260
|
export const evaluatePrompt: IEvaluatePromptFunction;
|
|
82
261
|
|
|
262
|
+
/** Alias for llm.evaluatePrompt(options). Uses the same parameters and can throw the same errors. */
|
|
263
|
+
export const executePrompt: IEvaluatePromptFunction;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Takes the ID of an existing prompt and values for variables used in the prompt and returns the streamed response from the LLM.
|
|
267
|
+
* When you're using unlimited usage mode, this method also accepts the OCI configuration parameters.
|
|
268
|
+
* @governance 100
|
|
269
|
+
*/
|
|
83
270
|
export const evaluatePromptStreamed: IEvaluatePromptStreamedFunction;
|
|
84
271
|
|
|
272
|
+
/** Alias for llm.evaluatePromptStreamed(options). Uses the same parameters and can throw the same errors. */
|
|
273
|
+
export const executePromptStreamed: IEvaluatePromptStreamedFunction;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Takes a prompt and parameters for the LLM and returns the response from the LLM.
|
|
277
|
+
* When you're using unlimited usage mode, this method also accepts the OCI configuration parameters.
|
|
278
|
+
* @governance 100
|
|
279
|
+
*/
|
|
85
280
|
export const generateText: GenerateTextFunction;
|
|
86
281
|
|
|
282
|
+
/** Alias for llm.generateText(options). Uses the same parameters and can throw the same errors. */
|
|
283
|
+
export const chat: GenerateTextFunction;
|
|
284
|
+
|
|
87
285
|
/**
|
|
88
286
|
* Returns the streamed response from the LLM for a given prompt.
|
|
89
287
|
*
|
|
90
288
|
* This method is similar to llm.generateText(options) but returns the LLM response as a stream.
|
|
91
289
|
* After calling this method, you can access the partial response (using the StreamedResponse.text property of the returned llm.StreamedResponse object) before the entire response has been generated.
|
|
92
290
|
* You can also use an iterator to examine each token returned by the LLM.
|
|
291
|
+
* @governance 100
|
|
93
292
|
*/
|
|
94
293
|
export const generateTextStreamed: GenerateTextStreamedFunction;
|
|
95
294
|
|
|
295
|
+
/** Alias for llm.generateTextStreamed(options). Uses the same parameters and can throw the same errors. */
|
|
296
|
+
export const chatStreamed: GenerateTextStreamedFunction;
|
|
297
|
+
|
|
96
298
|
/** Returns the number of free requests in the current month. */
|
|
97
299
|
export const getRemainingFreeUsage: GetRemainingFreeUsageFunction;
|
|
98
300
|
|
|
99
301
|
/** Returns the number of free embeddings requests in the current month. This method tracks free requests for embed API calls, such as llm.embed(options). To track free requests for non-embed API calls (such as llm.generateText(options)), use llm.getRemainingFreeUsage() instead. */
|
|
100
302
|
export const getRemainingFreeEmbedUsage: GetRemainingFreeUsageFunction;
|
|
101
303
|
|
|
102
|
-
interface
|
|
103
|
-
(options: IEmbedOptions):
|
|
104
|
-
promise(options: IEmbedOptions): Promise<
|
|
304
|
+
interface IEmbedFunction {
|
|
305
|
+
(options: IEmbedOptions): EmbedResponse;
|
|
306
|
+
promise(options: IEmbedOptions): Promise<EmbedResponse>;
|
|
105
307
|
}
|
|
106
308
|
|
|
107
309
|
interface IEvaluatePromptFunction {
|
|
@@ -115,13 +317,13 @@ interface IEvaluatePromptStreamedFunction {
|
|
|
115
317
|
}
|
|
116
318
|
|
|
117
319
|
interface GenerateTextFunction {
|
|
118
|
-
(options: IGenerateTextOptions): Response;
|
|
119
|
-
promise(options: IGenerateTextOptions): Promise<Response>;
|
|
320
|
+
(options: IGenerateTextOptions | IGenerateTextToolResultsOptions): Response;
|
|
321
|
+
promise(options: IGenerateTextOptions | IGenerateTextToolResultsOptions): Promise<Response>;
|
|
120
322
|
}
|
|
121
323
|
|
|
122
324
|
interface GenerateTextStreamedFunction {
|
|
123
|
-
(options:
|
|
124
|
-
promise(options:
|
|
325
|
+
(options: IGenerateTextStreamedOptions | IGenerateTextStreamedToolResultsOptions): StreamedResponse;
|
|
326
|
+
promise(options: IGenerateTextStreamedOptions | IGenerateTextStreamedToolResultsOptions): Promise<StreamedResponse>;
|
|
125
327
|
}
|
|
126
328
|
|
|
127
329
|
interface GetRemainingFreeUsageFunction {
|
|
@@ -129,7 +331,9 @@ interface GetRemainingFreeUsageFunction {
|
|
|
129
331
|
promise(): Promise<number>;
|
|
130
332
|
}
|
|
131
333
|
|
|
132
|
-
|
|
334
|
+
/** The embeddings response returned from the LLM. */
|
|
335
|
+
interface EmbedResponse {
|
|
336
|
+
/** The embeddings returned from the LLM. */
|
|
133
337
|
readonly embeddings: number[];
|
|
134
338
|
/** The list of inputs used to generate the embeddings response. */
|
|
135
339
|
readonly inputs: string[];
|
|
@@ -138,20 +342,33 @@ interface EmbeddedResponse {
|
|
|
138
342
|
}
|
|
139
343
|
|
|
140
344
|
interface IEmbedOptions {
|
|
141
|
-
/** An array of inputs to get embeddings for. */
|
|
345
|
+
/** An array of inputs to get embeddings for. You can provide a maximum of 96 inputs in a single call. */
|
|
142
346
|
inputs: string[] | readonly string[];
|
|
143
|
-
/**
|
|
144
|
-
|
|
347
|
+
/**
|
|
348
|
+
* The number of dimensions of the returned embeddings array.
|
|
349
|
+
*
|
|
350
|
+
* You can use this parameter to limit the number of dimensions in the returned embeddings.
|
|
351
|
+
* The embed model that's currently supported, Cohere Embed v4.0, returns embeddings with 1536 dimensions.
|
|
352
|
+
* If you generated embeddings using previously supported models and stored these embeddings for later use,
|
|
353
|
+
* you should regenerate those embeddings using the currently supported embed model with the additional supported dimensions.
|
|
354
|
+
*
|
|
355
|
+
* The supported range of values for this parameter is 1 - 1536. The default value is 1536.
|
|
356
|
+
* @since 2025.2
|
|
357
|
+
*/
|
|
358
|
+
dimensions?: number;
|
|
359
|
+
/** The embed model family to use. Use values from llm.EmbedModelFamily to set this value. If not specified, the Cohere Embed model (cohere.embed-v4.0) is used. */
|
|
360
|
+
embedModelFamily?: EmbedModelFamily | string;
|
|
145
361
|
/** Configuration needed for unlimited usage through OCI Generative AI Service. Required only when accessing the LLM through an Oracle Cloud Account and the OCI Generative AI Service. SuiteApps installed to target accounts are prevented from using the free usage pool for N/llm and must use the OCI configuration. */
|
|
146
362
|
ociConfig?: IOCIConfig;
|
|
147
363
|
/** The amount of time to wait for a response from the LLM, in milliseconds. If not specified, the default value is 30,000. */
|
|
148
364
|
timeout?: number;
|
|
149
365
|
/** The truncation method to use when embeddings input exceeds 512 tokens. Use values from llm.Truncate to set this value. If not specified, no truncation method is used. */
|
|
150
|
-
truncate?: string;
|
|
366
|
+
truncate?: Truncate | string;
|
|
151
367
|
}
|
|
152
368
|
|
|
153
369
|
interface IEvaluatePromptOptions {
|
|
154
|
-
|
|
370
|
+
/** ID of the prompt to evaluate. */
|
|
371
|
+
id: string | number;
|
|
155
372
|
/**
|
|
156
373
|
* Configuration needed for unlimited usage through OCI Generative AI Service.
|
|
157
374
|
* Required only when accessing the LLM through an Oracle Cloud Account and the OCI Generative AI Service.
|
|
@@ -176,23 +393,17 @@ interface IEvaluatePromptOptions {
|
|
|
176
393
|
variables?: object;
|
|
177
394
|
}
|
|
178
395
|
|
|
179
|
-
interface
|
|
180
|
-
/** Prompt for the LLM. */
|
|
181
|
-
prompt: string;
|
|
396
|
+
interface IGenerateTextBaseOptions {
|
|
182
397
|
/** Chat history to be taken into consideration. */
|
|
183
398
|
chatHistory?: ChatMessage[];
|
|
184
|
-
/** A list of documents to provide additional context for the LLM to generate the response. */
|
|
185
|
-
documents?: Document[];
|
|
186
399
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
* - Detailed description of an image
|
|
190
|
-
* - Answers to questions about an image
|
|
191
|
-
* - Information about charts and graphs in an image
|
|
400
|
+
* A list of documents to provide additional context for the LLM to generate the response.
|
|
401
|
+
* This parameter is supported only for Cohere models.
|
|
192
402
|
*/
|
|
193
|
-
|
|
194
|
-
/** Specifies the LLM to use. Use llm.ModelFamily to set the value. If not specified, the Cohere Command
|
|
403
|
+
documents?: Document[];
|
|
404
|
+
/** Specifies the LLM to use. Use llm.ModelFamily to set the value. If not specified, the Cohere Command A model (cohere.command-a-03-2025) is used. */
|
|
195
405
|
modelFamily?: ModelFamily;
|
|
406
|
+
/** Parameters of the model. For more information about the model parameters, refer to Offered Pretrained Foundational Models in Generative AI in the Oracle Cloud Infrastructure Documentation. */
|
|
196
407
|
modelParameters?: IModelParameters;
|
|
197
408
|
/**
|
|
198
409
|
* Configuration needed for unlimited usage through OCI Generative AI Service.
|
|
@@ -200,10 +411,78 @@ interface IGenerateTextOptions {
|
|
|
200
411
|
* SuiteApps installed to target accounts are prevented from using the free usage pool for N/llm and must use the OCI configuration.
|
|
201
412
|
*/
|
|
202
413
|
ociConfig?: IOCIConfig;
|
|
203
|
-
/** Preamble override for the LLM. A preamble is the
|
|
414
|
+
/** Preamble override for the LLM. A preamble is the initial context or guiding message for an LLM. For more details about using a preamble, refer to Offered Pretrained Foundational Models in Generative AI in the Oracle Cloud Infrastructure Documentation. */
|
|
204
415
|
preamble?: string;
|
|
416
|
+
/**
|
|
417
|
+
* Specifies the safety mode to use. Safety mode is available for Cohere models only.
|
|
418
|
+
* Use values from the llm.SafetyMode enum to set the value of this parameter. If not specified, the llm.SafetyMode.STRICT mode is used by default.
|
|
419
|
+
* @since 2025.1
|
|
420
|
+
*/
|
|
421
|
+
safetyMode?: SafetyMode | string;
|
|
205
422
|
/** Timeout in milliseconds, defaults to 30,000. */
|
|
206
423
|
timeout?: number;
|
|
424
|
+
/**
|
|
425
|
+
* The tools that are available for the LLM to request. Create tools using llm.createTool(options).
|
|
426
|
+
* When the LLM determines that running a tool may help its response, tool call requests are returned in the Response.toolCalls (or StreamedResponse.toolCalls) property.
|
|
427
|
+
* @since 2025.2
|
|
428
|
+
*/
|
|
429
|
+
tools?: Tool[];
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
interface IGenerateTextOptions extends IGenerateTextBaseOptions {
|
|
433
|
+
/** Prompt for the LLM. Required if options.toolResults is not specified. */
|
|
434
|
+
prompt: string;
|
|
435
|
+
/**
|
|
436
|
+
* A JSON schema specifying the format of the response.
|
|
437
|
+
*
|
|
438
|
+
* Use this parameter to direct the LLM to return its response in a structured JSON format.
|
|
439
|
+
* You can provide an object that represents a valid JSON schema, and the response will contain keys and values as defined in your schema that are populated by the generated content.
|
|
440
|
+
* You can then parse the response (Response.text) as JSON content.
|
|
441
|
+
*
|
|
442
|
+
* This parameter is supported for Cohere models only, and cannot be used with the documents, tools, or toolResults parameters (MUTUALLY_EXCLUSIVE_ARGUMENTS).
|
|
443
|
+
* @since 2025.1
|
|
444
|
+
*/
|
|
445
|
+
responseFormat?: object;
|
|
446
|
+
/**
|
|
447
|
+
* @deprecated As of 2025.1 this parameter is no longer included in the Help documentation for llm.generateText(options),
|
|
448
|
+
* and the Meta Llama (vision-capable) model family is no longer listed in llm.ModelFamily.
|
|
449
|
+
*/
|
|
450
|
+
image?: File;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Options for a follow-up llm.generateText(options) call that provides tool results back to the LLM.
|
|
455
|
+
* When toolResults is specified, any prompt provided is ignored — the LLM uses only the specified tool results (and chat history, if available) to generate a follow-up response.
|
|
456
|
+
* @since 2025.2
|
|
457
|
+
*/
|
|
458
|
+
interface IGenerateTextToolResultsOptions extends IGenerateTextBaseOptions {
|
|
459
|
+
/** Prompt for the LLM. Ignored when options.toolResults is specified. */
|
|
460
|
+
prompt?: string;
|
|
461
|
+
/**
|
|
462
|
+
* The tool results to use to generate a follow-up response. Create tool results using llm.createToolResult(options).
|
|
463
|
+
* When you specify a value for this parameter, any prompt you provide using the options.prompt parameter is ignored.
|
|
464
|
+
*/
|
|
465
|
+
toolResults: ToolResult[];
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
interface IGenerateTextStreamedOptions extends IGenerateTextBaseOptions {
|
|
469
|
+
/** Prompt for the LLM. Required if options.toolResults is not specified. */
|
|
470
|
+
prompt: string;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Options for a follow-up llm.generateTextStreamed(options) call that provides tool results back to the LLM.
|
|
475
|
+
* When toolResults is specified, any prompt provided is ignored — the LLM uses only the specified tool results (and chat history, if available) to generate a follow-up response.
|
|
476
|
+
* @since 2025.2
|
|
477
|
+
*/
|
|
478
|
+
interface IGenerateTextStreamedToolResultsOptions extends IGenerateTextBaseOptions {
|
|
479
|
+
/** Prompt for the LLM. Ignored when options.toolResults is specified. */
|
|
480
|
+
prompt?: string;
|
|
481
|
+
/**
|
|
482
|
+
* The tool results to use to generate a follow-up response. Create tool results using llm.createToolResult(options).
|
|
483
|
+
* When you specify a value for this parameter, any prompt you provide using the options.prompt parameter is ignored.
|
|
484
|
+
*/
|
|
485
|
+
toolResults: ToolResult[];
|
|
207
486
|
}
|
|
208
487
|
|
|
209
488
|
interface Document {
|
|
@@ -269,22 +548,50 @@ declare enum ChatRole {
|
|
|
269
548
|
CHATBOT = "CHATBOT"
|
|
270
549
|
}
|
|
271
550
|
|
|
272
|
-
/** The large language model to be used to generate embeddings. */
|
|
551
|
+
/** The large language model to be used to generate embeddings. Use this enum to set the value of the options.embedModelFamily parameter in llm.embed(options). */
|
|
273
552
|
declare enum EmbedModelFamily {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
/** Light versions of embedding models might generate embeddings faster than regular embedding models, but the output might not be as accurate. */
|
|
279
|
-
COHERE_EMBED_MULTILINGUAL_LIGHT = 'cohere.embed-multilingual-light-v3.0'
|
|
553
|
+
/** Cohere Embed v4.0. This is the default when the options.embedModelFamily parameter is omitted. */
|
|
554
|
+
COHERE_EMBED = 'cohere.embed-v4.0',
|
|
555
|
+
/** Always uses the latest supported Cohere Embed model. */
|
|
556
|
+
COHERE_EMBED_LATEST = 'cohere.embed-v4.0'
|
|
280
557
|
}
|
|
281
558
|
|
|
282
|
-
/** The large language model to be used. */
|
|
559
|
+
/** The large language model to be used. Use this enum to set the value of the options.modelFamily parameter in llm.generateText(options) and llm.generateTextStreamed(options). */
|
|
283
560
|
declare enum ModelFamily {
|
|
284
|
-
/**
|
|
285
|
-
COHERE_COMMAND = 'cohere.command-
|
|
286
|
-
/** Always uses the latest supported
|
|
287
|
-
|
|
561
|
+
/** Cohere Command A. Supports RAG (documents) and preambles. This is the default when the options.modelFamily parameter is omitted. */
|
|
562
|
+
COHERE_COMMAND = 'cohere.command-a-03-2025',
|
|
563
|
+
/** Always uses the latest supported Cohere Command model. Supports RAG (documents) and preambles. */
|
|
564
|
+
COHERE_COMMAND_LATEST = 'cohere.command-a-03-2025',
|
|
565
|
+
/** OpenAI gpt-oss 120B. Supports preambles; does not support RAG (documents). */
|
|
566
|
+
GPT_OSS = 'openai.gpt-oss-120b',
|
|
567
|
+
/** Always uses the latest supported OpenAI gpt-oss model. Supports preambles; does not support RAG (documents). */
|
|
568
|
+
GPT_OSS_LATEST = 'openai.gpt-oss-120b'
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* The safety mode to be used for LLM requests.
|
|
573
|
+
*
|
|
574
|
+
* Safety mode is available for Cohere models only and is designed to help filter and moderate content generated by the LLM.
|
|
575
|
+
* When using strict mode or contextual mode, the LLM may refuse to provide certain responses that include sensitive, harmful, or illegal suggestions.
|
|
576
|
+
*
|
|
577
|
+
* Use this enum to set the value of the options.safetyMode parameter in llm.generateText(options) and llm.generateTextStreamed(options).
|
|
578
|
+
* @since 2025.1
|
|
579
|
+
*/
|
|
580
|
+
declare enum SafetyMode {
|
|
581
|
+
/** This mode offers a less restrictive approach than strict mode but still rejects harmful or illegal suggestions. This mode is suited for creative, entertainment, or academic purposes. */
|
|
582
|
+
CONTEXTUAL = 'CONTEXTUAL',
|
|
583
|
+
/** This mode aims to avoid sensitive topics entirely and is suited for corporate communications and customer service. This is the default mode when calling llm.generateText(options) or llm.generateTextStreamed(options). */
|
|
584
|
+
STRICT = 'STRICT'
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/** The data type for a tool parameter. Use this enum to set the value of the options.type parameter in llm.createToolParameter(options). @since 2025.2 */
|
|
588
|
+
declare enum ToolParameterType {
|
|
589
|
+
ARRAY = 'ARRAY',
|
|
590
|
+
BOOLEAN = 'BOOLEAN',
|
|
591
|
+
FLOAT = 'FLOAT',
|
|
592
|
+
INTEGER = 'INTEGER',
|
|
593
|
+
OBJECT = 'OBJECT',
|
|
594
|
+
STRING = 'STRING'
|
|
288
595
|
}
|
|
289
596
|
|
|
290
597
|
/** The truncation method to use when embeddings input exceeds 512 tokens. Use this enum to set the value of the options.truncate parameter in llm.embed(options). */
|
package/N/ui/serverWidget.d.ts
CHANGED
|
@@ -234,8 +234,8 @@ interface SublistSetSublistValueOptions {
|
|
|
234
234
|
id: string;
|
|
235
235
|
/** The line number for this field (starts at 0). */
|
|
236
236
|
line: number;
|
|
237
|
-
/** The value for the field being set. */
|
|
238
|
-
value: string;
|
|
237
|
+
/** The value for the field being set. Use null instead of an empty string. */
|
|
238
|
+
value: string|null;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
interface SetSplashOptions {
|