cencori 1.16.0 → 1.16.2
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/agents/index.d.mts +5 -0
- package/dist/agents/index.d.ts +5 -0
- package/dist/agents/index.js +9 -2
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/index.mjs +9 -2
- package/dist/agents/index.mjs.map +1 -1
- package/dist/ai/index.d.mts +15 -2
- package/dist/ai/index.d.ts +15 -2
- package/dist/ai/index.js +69 -2
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +69 -2
- 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/documents/index.d.mts +1 -1
- package/dist/documents/index.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +69 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -2
- package/dist/index.mjs.map +1 -1
- package/dist/judgment/index.d.mts +1 -1
- package/dist/judgment/index.d.ts +1 -1
- package/dist/memory/index.d.mts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs.map +1 -1
- package/dist/storage/index.d.mts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/telemetry/index.d.mts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/{types-D91o22Gb.d.mts → types-9nSEJEk2.d.mts} +90 -3
- package/dist/{types-D91o22Gb.d.ts → types-9nSEJEk2.d.ts} +90 -3
- package/dist/vision/index.d.mts +1 -1
- package/dist/vision/index.d.ts +1 -1
- package/dist/voice/index.d.mts +1 -1
- package/dist/voice/index.d.ts +1 -1
- package/dist/web/index.d.mts +1 -1
- package/dist/web/index.d.ts +1 -1
- package/dist/workflow/index.d.mts +1 -1
- package/dist/workflow/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/storage/index.d.mts
CHANGED
package/dist/storage/index.d.ts
CHANGED
|
@@ -204,6 +204,93 @@ interface EmbeddingResponse {
|
|
|
204
204
|
totalTokens: number;
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
+
type ModerationInputPart = {
|
|
208
|
+
type: 'text';
|
|
209
|
+
text: string;
|
|
210
|
+
} | {
|
|
211
|
+
type: 'image_url';
|
|
212
|
+
image_url: {
|
|
213
|
+
url: string;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
interface ModerationRequest {
|
|
217
|
+
/** A string, up to 100 strings (one result each), or text/image parts (one result). */
|
|
218
|
+
input: string | string[] | ModerationInputPart[];
|
|
219
|
+
/** OpenAI model for the standard categories. Defaults to 'omni-moderation-latest'. */
|
|
220
|
+
model?: string;
|
|
221
|
+
/** Which layers to run. Default all three. ['rules'] alone is fastest and free. */
|
|
222
|
+
layers?: Array<'rules' | 'openai' | 'llm'>;
|
|
223
|
+
/** Flag thresholds per category (0–1); '*' sets the default. Default 0.5. */
|
|
224
|
+
thresholds?: Record<string, number>;
|
|
225
|
+
/** Score at which the recommended action becomes 'block'. Default 0.8. */
|
|
226
|
+
blockThreshold?: number;
|
|
227
|
+
/** When the paid model layer runs: 'auto' (unclear items and custom categories), 'always' or 'never'. */
|
|
228
|
+
escalate?: 'auto' | 'always' | 'never';
|
|
229
|
+
/** Model for the llm layer. Default 'deepseek-v4.1-flash'. */
|
|
230
|
+
llmModel?: string;
|
|
231
|
+
/** Your own categories, judged by the model and returned as 'custom/<name>'. */
|
|
232
|
+
customCategories?: Array<{
|
|
233
|
+
name: string;
|
|
234
|
+
description: string;
|
|
235
|
+
threshold?: number;
|
|
236
|
+
}>;
|
|
237
|
+
/** Terms that always block (category 'custom/blocklist'). */
|
|
238
|
+
blocklist?: string[];
|
|
239
|
+
/** Your own terms that look like scam words, removed before the rules run. */
|
|
240
|
+
allowlist?: string[];
|
|
241
|
+
/** Your brand and product names, to catch people posing as your staff. */
|
|
242
|
+
brandNames?: string[];
|
|
243
|
+
/** One or two sentences about your platform, given to the model layer. */
|
|
244
|
+
context?: string;
|
|
245
|
+
/**
|
|
246
|
+
* Earlier messages in the same conversation, oldest first, so the model can
|
|
247
|
+
* tell banter from a real ask. One array (or null) per input string, or a
|
|
248
|
+
* flat array when the input is a single string.
|
|
249
|
+
*/
|
|
250
|
+
previousMessages?: (string[] | null)[] | string[];
|
|
251
|
+
/**
|
|
252
|
+
* Strongest action a category may lead to. By default fraud/romance,
|
|
253
|
+
* fraud/off_platform_contact, harassment, hate and custom categories only
|
|
254
|
+
* go to review, because banter is common there.
|
|
255
|
+
*/
|
|
256
|
+
categoryActions?: Record<string, 'review' | 'block'>;
|
|
257
|
+
}
|
|
258
|
+
interface ModerationMatch {
|
|
259
|
+
layer: 'rules' | 'openai' | 'llm';
|
|
260
|
+
category: string;
|
|
261
|
+
score: number;
|
|
262
|
+
rule?: string;
|
|
263
|
+
text?: string;
|
|
264
|
+
/** The model's one-line reason, for llm matches. */
|
|
265
|
+
reason?: string;
|
|
266
|
+
}
|
|
267
|
+
interface ModerationResult {
|
|
268
|
+
flagged: boolean;
|
|
269
|
+
/** Recommended handling: allow, send to human review, or block. */
|
|
270
|
+
action: 'allow' | 'review' | 'block';
|
|
271
|
+
categories: Record<string, boolean>;
|
|
272
|
+
categoryScores: Record<string, number>;
|
|
273
|
+
flaggedCategories: string[];
|
|
274
|
+
matches: ModerationMatch[];
|
|
275
|
+
layersApplied: Array<'rules' | 'openai' | 'llm'>;
|
|
276
|
+
}
|
|
277
|
+
interface ModerationResponse {
|
|
278
|
+
id: string;
|
|
279
|
+
model: string;
|
|
280
|
+
/** True when any result is flagged. */
|
|
281
|
+
flagged: boolean;
|
|
282
|
+
results: ModerationResult[];
|
|
283
|
+
layers: Partial<Record<'rules' | 'openai' | 'llm', 'ok' | 'skipped' | 'error'>>;
|
|
284
|
+
usage: {
|
|
285
|
+
llmItems: number;
|
|
286
|
+
llmCachedItems: number;
|
|
287
|
+
llmCalls: number;
|
|
288
|
+
llmModel: string | null;
|
|
289
|
+
/** What this request cost. Only the llm layer is billed. */
|
|
290
|
+
costUsd: number;
|
|
291
|
+
};
|
|
292
|
+
errors?: string[];
|
|
293
|
+
}
|
|
207
294
|
/**
|
|
208
295
|
* Image generation request
|
|
209
296
|
*/
|
|
@@ -212,9 +299,9 @@ interface ImageGenerationRequest {
|
|
|
212
299
|
prompt: string;
|
|
213
300
|
/**
|
|
214
301
|
* Model to use. Supported models:
|
|
215
|
-
* - OpenAI: 'gpt-image-1.5', '
|
|
302
|
+
* - OpenAI: 'gpt-image-2', 'gpt-image-1.5', 'gpt-image-1', 'gpt-image-1-mini'
|
|
216
303
|
* - Google: 'gemini-3-pro-image', 'imagen-3'
|
|
217
|
-
* Default: '
|
|
304
|
+
* Default: 'gpt-image-1'
|
|
218
305
|
*/
|
|
219
306
|
model?: string;
|
|
220
307
|
/** Number of images to generate (default: 1) */
|
|
@@ -434,4 +521,4 @@ interface RequestOptions {
|
|
|
434
521
|
headers?: Record<string, string>;
|
|
435
522
|
}
|
|
436
523
|
|
|
437
|
-
export type { CencoriConfig as C, EmbeddingRequest as E, FileSearchTool as F, GenerateObjectRequest as G, ImageGenerationRequest as I, KnowledgeCitation as K, 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,
|
|
524
|
+
export type { CencoriConfig as C, EmbeddingRequest as E, FileSearchTool as F, GenerateObjectRequest as G, ImageGenerationRequest as I, KnowledgeCitation as K, ModerationRequest as M, 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, ModerationResponse as e, GenerateObjectResponse as f, ImageGenerationResponse as g, ResponsesResponse as h, ComputeRunOptions as i, RequestOptions as j, ChatMessage as k, ModerationResult as l, ModerationMatch as m, ModerationInputPart as n, ResponsesOutputItem as o, ResponseInputItem as p, ResponsesTool as q, WebSearchTool as r, CodeInterpreterTool as s };
|
|
@@ -204,6 +204,93 @@ interface EmbeddingResponse {
|
|
|
204
204
|
totalTokens: number;
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
+
type ModerationInputPart = {
|
|
208
|
+
type: 'text';
|
|
209
|
+
text: string;
|
|
210
|
+
} | {
|
|
211
|
+
type: 'image_url';
|
|
212
|
+
image_url: {
|
|
213
|
+
url: string;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
interface ModerationRequest {
|
|
217
|
+
/** A string, up to 100 strings (one result each), or text/image parts (one result). */
|
|
218
|
+
input: string | string[] | ModerationInputPart[];
|
|
219
|
+
/** OpenAI model for the standard categories. Defaults to 'omni-moderation-latest'. */
|
|
220
|
+
model?: string;
|
|
221
|
+
/** Which layers to run. Default all three. ['rules'] alone is fastest and free. */
|
|
222
|
+
layers?: Array<'rules' | 'openai' | 'llm'>;
|
|
223
|
+
/** Flag thresholds per category (0–1); '*' sets the default. Default 0.5. */
|
|
224
|
+
thresholds?: Record<string, number>;
|
|
225
|
+
/** Score at which the recommended action becomes 'block'. Default 0.8. */
|
|
226
|
+
blockThreshold?: number;
|
|
227
|
+
/** When the paid model layer runs: 'auto' (unclear items and custom categories), 'always' or 'never'. */
|
|
228
|
+
escalate?: 'auto' | 'always' | 'never';
|
|
229
|
+
/** Model for the llm layer. Default 'deepseek-v4.1-flash'. */
|
|
230
|
+
llmModel?: string;
|
|
231
|
+
/** Your own categories, judged by the model and returned as 'custom/<name>'. */
|
|
232
|
+
customCategories?: Array<{
|
|
233
|
+
name: string;
|
|
234
|
+
description: string;
|
|
235
|
+
threshold?: number;
|
|
236
|
+
}>;
|
|
237
|
+
/** Terms that always block (category 'custom/blocklist'). */
|
|
238
|
+
blocklist?: string[];
|
|
239
|
+
/** Your own terms that look like scam words, removed before the rules run. */
|
|
240
|
+
allowlist?: string[];
|
|
241
|
+
/** Your brand and product names, to catch people posing as your staff. */
|
|
242
|
+
brandNames?: string[];
|
|
243
|
+
/** One or two sentences about your platform, given to the model layer. */
|
|
244
|
+
context?: string;
|
|
245
|
+
/**
|
|
246
|
+
* Earlier messages in the same conversation, oldest first, so the model can
|
|
247
|
+
* tell banter from a real ask. One array (or null) per input string, or a
|
|
248
|
+
* flat array when the input is a single string.
|
|
249
|
+
*/
|
|
250
|
+
previousMessages?: (string[] | null)[] | string[];
|
|
251
|
+
/**
|
|
252
|
+
* Strongest action a category may lead to. By default fraud/romance,
|
|
253
|
+
* fraud/off_platform_contact, harassment, hate and custom categories only
|
|
254
|
+
* go to review, because banter is common there.
|
|
255
|
+
*/
|
|
256
|
+
categoryActions?: Record<string, 'review' | 'block'>;
|
|
257
|
+
}
|
|
258
|
+
interface ModerationMatch {
|
|
259
|
+
layer: 'rules' | 'openai' | 'llm';
|
|
260
|
+
category: string;
|
|
261
|
+
score: number;
|
|
262
|
+
rule?: string;
|
|
263
|
+
text?: string;
|
|
264
|
+
/** The model's one-line reason, for llm matches. */
|
|
265
|
+
reason?: string;
|
|
266
|
+
}
|
|
267
|
+
interface ModerationResult {
|
|
268
|
+
flagged: boolean;
|
|
269
|
+
/** Recommended handling: allow, send to human review, or block. */
|
|
270
|
+
action: 'allow' | 'review' | 'block';
|
|
271
|
+
categories: Record<string, boolean>;
|
|
272
|
+
categoryScores: Record<string, number>;
|
|
273
|
+
flaggedCategories: string[];
|
|
274
|
+
matches: ModerationMatch[];
|
|
275
|
+
layersApplied: Array<'rules' | 'openai' | 'llm'>;
|
|
276
|
+
}
|
|
277
|
+
interface ModerationResponse {
|
|
278
|
+
id: string;
|
|
279
|
+
model: string;
|
|
280
|
+
/** True when any result is flagged. */
|
|
281
|
+
flagged: boolean;
|
|
282
|
+
results: ModerationResult[];
|
|
283
|
+
layers: Partial<Record<'rules' | 'openai' | 'llm', 'ok' | 'skipped' | 'error'>>;
|
|
284
|
+
usage: {
|
|
285
|
+
llmItems: number;
|
|
286
|
+
llmCachedItems: number;
|
|
287
|
+
llmCalls: number;
|
|
288
|
+
llmModel: string | null;
|
|
289
|
+
/** What this request cost. Only the llm layer is billed. */
|
|
290
|
+
costUsd: number;
|
|
291
|
+
};
|
|
292
|
+
errors?: string[];
|
|
293
|
+
}
|
|
207
294
|
/**
|
|
208
295
|
* Image generation request
|
|
209
296
|
*/
|
|
@@ -212,9 +299,9 @@ interface ImageGenerationRequest {
|
|
|
212
299
|
prompt: string;
|
|
213
300
|
/**
|
|
214
301
|
* Model to use. Supported models:
|
|
215
|
-
* - OpenAI: 'gpt-image-1.5', '
|
|
302
|
+
* - OpenAI: 'gpt-image-2', 'gpt-image-1.5', 'gpt-image-1', 'gpt-image-1-mini'
|
|
216
303
|
* - Google: 'gemini-3-pro-image', 'imagen-3'
|
|
217
|
-
* Default: '
|
|
304
|
+
* Default: 'gpt-image-1'
|
|
218
305
|
*/
|
|
219
306
|
model?: string;
|
|
220
307
|
/** Number of images to generate (default: 1) */
|
|
@@ -434,4 +521,4 @@ interface RequestOptions {
|
|
|
434
521
|
headers?: Record<string, string>;
|
|
435
522
|
}
|
|
436
523
|
|
|
437
|
-
export type { CencoriConfig as C, EmbeddingRequest as E, FileSearchTool as F, GenerateObjectRequest as G, ImageGenerationRequest as I, KnowledgeCitation as K, 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,
|
|
524
|
+
export type { CencoriConfig as C, EmbeddingRequest as E, FileSearchTool as F, GenerateObjectRequest as G, ImageGenerationRequest as I, KnowledgeCitation as K, ModerationRequest as M, 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, ModerationResponse as e, GenerateObjectResponse as f, ImageGenerationResponse as g, ResponsesResponse as h, ComputeRunOptions as i, RequestOptions as j, ChatMessage as k, ModerationResult as l, ModerationMatch as m, ModerationInputPart as n, ResponsesOutputItem as o, ResponseInputItem as p, ResponsesTool as q, WebSearchTool as r, CodeInterpreterTool as s };
|
package/dist/vision/index.d.mts
CHANGED
package/dist/vision/index.d.ts
CHANGED
package/dist/voice/index.d.mts
CHANGED
package/dist/voice/index.d.ts
CHANGED
package/dist/web/index.d.mts
CHANGED
package/dist/web/index.d.ts
CHANGED
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.16.
|
|
4
|
+
"version": "1.16.2",
|
|
5
5
|
"description": "Cencori - The unified infrastructure layer for AI applications. One SDK for AI Gateway, Agents, Compute, Workflow, and Storage.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.mjs",
|