cencori 1.1.0 → 1.2.1
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/README.md +3 -51
- package/dist/ai/index.d.mts +32 -1
- package/dist/ai/index.d.ts +32 -1
- package/dist/ai/index.js +142 -8
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +142 -8
- package/dist/ai/index.mjs.map +1 -1
- package/dist/compute/index.d.mts +1 -1
- package/dist/compute/index.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +149 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +149 -15
- package/dist/index.mjs.map +1 -1
- package/dist/memory/index.d.mts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/storage/index.d.mts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.js +7 -7
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/index.mjs +7 -7
- package/dist/storage/index.mjs.map +1 -1
- package/dist/tanstack/index.d.mts +1 -1
- package/dist/tanstack/index.d.ts +1 -1
- package/dist/tanstack/index.js +17 -1
- package/dist/tanstack/index.js.map +1 -1
- package/dist/tanstack/index.mjs +17 -1
- package/dist/tanstack/index.mjs.map +1 -1
- package/dist/telemetry/index.d.mts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/{types-Azq6TqIA.d.mts → types-kh1whvNH.d.mts} +149 -1
- package/dist/{types-Azq6TqIA.d.ts → types-kh1whvNH.d.ts} +149 -1
- package/dist/workflow/index.d.mts +1 -1
- package/dist/workflow/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -81,6 +81,20 @@ interface ChatRequest {
|
|
|
81
81
|
tools?: ToolDefinition[];
|
|
82
82
|
/** How the model chooses to call tools */
|
|
83
83
|
toolChoice?: ToolChoice;
|
|
84
|
+
/**
|
|
85
|
+
* Reference a named prompt from the Cencori Prompt Registry.
|
|
86
|
+
* When provided, the gateway resolves the active version and
|
|
87
|
+
* injects it as the system message — no need to hardcode prompts.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* prompt: { name: 'support-agent', variables: { tier: 'pro' } }
|
|
91
|
+
*/
|
|
92
|
+
prompt?: {
|
|
93
|
+
/** Prompt name or slug as shown in the dashboard */
|
|
94
|
+
name: string;
|
|
95
|
+
/** Template variables to interpolate (e.g. {{tier}} → 'pro') */
|
|
96
|
+
variables?: Record<string, string>;
|
|
97
|
+
};
|
|
84
98
|
}
|
|
85
99
|
interface ChatResponse {
|
|
86
100
|
id: string;
|
|
@@ -185,6 +199,132 @@ interface ImageGenerationResponse {
|
|
|
185
199
|
model: string;
|
|
186
200
|
provider: string;
|
|
187
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* A response input item for the Responses API.
|
|
204
|
+
* Can be a message, function call, or function call output.
|
|
205
|
+
*/
|
|
206
|
+
type ResponseInputItem = {
|
|
207
|
+
type: 'message';
|
|
208
|
+
role: 'user' | 'assistant' | 'system';
|
|
209
|
+
content: string;
|
|
210
|
+
} | {
|
|
211
|
+
type: 'function_call';
|
|
212
|
+
id: string;
|
|
213
|
+
call_id: string;
|
|
214
|
+
name: string;
|
|
215
|
+
arguments: string;
|
|
216
|
+
status?: string;
|
|
217
|
+
} | {
|
|
218
|
+
type: 'function_call_output';
|
|
219
|
+
call_id: string;
|
|
220
|
+
output: string;
|
|
221
|
+
} | {
|
|
222
|
+
type: 'file';
|
|
223
|
+
filename: string;
|
|
224
|
+
content: string;
|
|
225
|
+
mime_type?: string;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Built-in tool types for the Responses API
|
|
229
|
+
*/
|
|
230
|
+
type WebSearchTool = {
|
|
231
|
+
type: 'web_search_preview';
|
|
232
|
+
search_context_size?: 'low' | 'medium' | 'high';
|
|
233
|
+
user_location?: {
|
|
234
|
+
type: 'approximate';
|
|
235
|
+
country?: string;
|
|
236
|
+
city?: string;
|
|
237
|
+
region?: string;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
type FileSearchTool = {
|
|
241
|
+
type: 'file_search';
|
|
242
|
+
max_num_results?: number;
|
|
243
|
+
filters?: Record<string, unknown>;
|
|
244
|
+
};
|
|
245
|
+
type CodeInterpreterTool = {
|
|
246
|
+
type: 'code_interpreter';
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* A tool in the Responses API
|
|
250
|
+
*/
|
|
251
|
+
type ResponsesTool = WebSearchTool | FileSearchTool | CodeInterpreterTool | ToolDefinition;
|
|
252
|
+
/**
|
|
253
|
+
* Request for the Responses API
|
|
254
|
+
*/
|
|
255
|
+
interface ResponsesRequest {
|
|
256
|
+
model: string;
|
|
257
|
+
input: string | ResponseInputItem[];
|
|
258
|
+
instructions?: string;
|
|
259
|
+
tools?: ResponsesTool[];
|
|
260
|
+
tool_choice?: 'auto' | 'none' | 'required' | {
|
|
261
|
+
type: 'function';
|
|
262
|
+
name: string;
|
|
263
|
+
};
|
|
264
|
+
temperature?: number;
|
|
265
|
+
max_output_tokens?: number;
|
|
266
|
+
top_p?: number;
|
|
267
|
+
store?: boolean;
|
|
268
|
+
metadata?: Record<string, string>;
|
|
269
|
+
previous_response_id?: string;
|
|
270
|
+
parallel_tool_calls?: boolean;
|
|
271
|
+
truncation?: 'auto' | 'disabled';
|
|
272
|
+
response_format?: {
|
|
273
|
+
type: 'text' | 'json_object' | 'json_schema';
|
|
274
|
+
json_schema?: {
|
|
275
|
+
name: string;
|
|
276
|
+
description?: string;
|
|
277
|
+
schema: Record<string, unknown>;
|
|
278
|
+
strict?: boolean;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
include?: string[];
|
|
282
|
+
stream?: boolean;
|
|
283
|
+
user?: string;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* A single output item from a Responses API response
|
|
287
|
+
*/
|
|
288
|
+
type UrlCitation = {
|
|
289
|
+
type: 'url_citation';
|
|
290
|
+
start_index: number;
|
|
291
|
+
end_index: number;
|
|
292
|
+
url: string;
|
|
293
|
+
title?: string;
|
|
294
|
+
};
|
|
295
|
+
interface ResponsesOutputItem {
|
|
296
|
+
id: string;
|
|
297
|
+
type: 'message' | 'function_call' | 'web_search_call' | 'file_search_call' | 'code_interpreter_call' | 'reasoning';
|
|
298
|
+
status?: 'completed' | 'failed' | 'in_progress';
|
|
299
|
+
role?: 'assistant';
|
|
300
|
+
content?: Array<{
|
|
301
|
+
type: 'output_text' | 'refusal';
|
|
302
|
+
text?: string;
|
|
303
|
+
annotations?: UrlCitation[];
|
|
304
|
+
}>;
|
|
305
|
+
call_id?: string;
|
|
306
|
+
name?: string;
|
|
307
|
+
arguments?: string;
|
|
308
|
+
output?: Record<string, unknown>;
|
|
309
|
+
error?: string;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Response from the Responses API
|
|
313
|
+
*/
|
|
314
|
+
interface ResponsesResponse {
|
|
315
|
+
id: string;
|
|
316
|
+
object: 'response';
|
|
317
|
+
created: number;
|
|
318
|
+
model: string;
|
|
319
|
+
output: ResponsesOutputItem[];
|
|
320
|
+
usage: {
|
|
321
|
+
input_tokens: number;
|
|
322
|
+
output_tokens: number;
|
|
323
|
+
total_tokens: number;
|
|
324
|
+
};
|
|
325
|
+
status: 'completed' | 'failed' | 'in_progress';
|
|
326
|
+
metadata?: Record<string, string>;
|
|
327
|
+
}
|
|
188
328
|
interface ComputeRunOptions {
|
|
189
329
|
input?: Record<string, unknown>;
|
|
190
330
|
timeout?: number;
|
|
@@ -205,5 +345,13 @@ interface RequestOptions {
|
|
|
205
345
|
body?: string;
|
|
206
346
|
headers?: Record<string, string>;
|
|
207
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* Options for generic API requests
|
|
350
|
+
*/
|
|
351
|
+
interface RequestOptions {
|
|
352
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
353
|
+
body?: string;
|
|
354
|
+
headers?: Record<string, string>;
|
|
355
|
+
}
|
|
208
356
|
|
|
209
|
-
export type { CencoriConfig as C, EmbeddingRequest as E, GenerateObjectRequest as G, ImageGenerationRequest as I,
|
|
357
|
+
export type { CencoriConfig as C, EmbeddingRequest as E, FileSearchTool as F, GenerateObjectRequest as G, ImageGenerationRequest as I, ResponsesRequest as R, ToolCall as T, UrlCitation as U, VectorSearchOptions as V, WorkflowTriggerOptions as W, ChatRequest as a, ChatResponse as b, CompletionRequest as c, EmbeddingResponse as d, GenerateObjectResponse as e, ImageGenerationResponse as f, ResponsesResponse as g, ComputeRunOptions as h, RequestOptions as i, ChatMessage as j, ResponsesOutputItem as k, ResponseInputItem as l, ResponsesTool as m, WebSearchTool as n, CodeInterpreterTool as o };
|
package/dist/workflow/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "cencori",
|
|
4
|
-
"version": "1.1
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"description": "Cencori - The unified infrastructure layer for AI applications. One SDK for AI Gateway, Compute, Workflow, and Storage.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.mjs",
|