cencori 1.8.3 → 1.9.0
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 +1 -1
- package/dist/ai/index.d.mts +14 -1
- package/dist/ai/index.d.ts +14 -1
- package/dist/ai/index.js +43 -3
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +43 -3
- 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 +50 -9
- package/dist/index.d.ts +50 -9
- package/dist/index.js +67 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -13
- 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/storage/index.d.mts +5 -7
- package/dist/storage/index.d.ts +5 -7
- package/dist/storage/index.js +6 -8
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/index.mjs +6 -8
- package/dist/storage/index.mjs.map +1 -1
- package/dist/telemetry/index.d.mts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/{types-CAhDuNTz.d.mts → types-D91o22Gb.d.mts} +28 -1
- package/dist/{types-CAhDuNTz.d.ts → types-D91o22Gb.d.ts} +28 -1
- 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/judgment/index.d.ts
CHANGED
package/dist/memory/index.d.mts
CHANGED
package/dist/memory/index.d.ts
CHANGED
package/dist/storage/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VectorSearchOptions } from '../types-
|
|
1
|
+
import { V as VectorSearchOptions } from '../types-D91o22Gb.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Storage Namespace - Vector Database, Knowledge Base, RAG
|
|
@@ -35,15 +35,13 @@ declare class VectorsNamespace {
|
|
|
35
35
|
}
|
|
36
36
|
declare class KnowledgeNamespace {
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* 🚧 Coming Soon - This feature is not yet available.
|
|
38
|
+
* @deprecated Never implemented. Use `cencori.knowledge.search()`, or
|
|
39
|
+
* ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.
|
|
41
40
|
*/
|
|
42
41
|
query(question: string): Promise<never>;
|
|
43
42
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* 🚧 Coming Soon - This feature is not yet available.
|
|
43
|
+
* @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`
|
|
44
|
+
* or `cencori.knowledge.addFileSource()`.
|
|
47
45
|
*/
|
|
48
46
|
add(documents: {
|
|
49
47
|
content: string;
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VectorSearchOptions } from '../types-
|
|
1
|
+
import { V as VectorSearchOptions } from '../types-D91o22Gb.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Storage Namespace - Vector Database, Knowledge Base, RAG
|
|
@@ -35,15 +35,13 @@ declare class VectorsNamespace {
|
|
|
35
35
|
}
|
|
36
36
|
declare class KnowledgeNamespace {
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* 🚧 Coming Soon - This feature is not yet available.
|
|
38
|
+
* @deprecated Never implemented. Use `cencori.knowledge.search()`, or
|
|
39
|
+
* ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.
|
|
41
40
|
*/
|
|
42
41
|
query(question: string): Promise<never>;
|
|
43
42
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* 🚧 Coming Soon - This feature is not yet available.
|
|
43
|
+
* @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`
|
|
44
|
+
* or `cencori.knowledge.addFileSource()`.
|
|
47
45
|
*/
|
|
48
46
|
add(documents: {
|
|
49
47
|
content: string;
|
package/dist/storage/index.js
CHANGED
|
@@ -57,23 +57,21 @@ var VectorsNamespace = class {
|
|
|
57
57
|
};
|
|
58
58
|
var KnowledgeNamespace = class {
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* 🚧 Coming Soon - This feature is not yet available.
|
|
60
|
+
* @deprecated Never implemented. Use `cencori.knowledge.search()`, or
|
|
61
|
+
* ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.
|
|
63
62
|
*/
|
|
64
63
|
async query(question) {
|
|
65
64
|
throw new Error(
|
|
66
|
-
`cencori.storage.knowledge.query() is
|
|
65
|
+
`cencori.storage.knowledge.query() is not available. Use cencori.knowledge.search(kbId, { query }), or cencori.ai.chat({ knowledgeBases: [kbId], ... }).`
|
|
67
66
|
);
|
|
68
67
|
}
|
|
69
68
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* 🚧 Coming Soon - This feature is not yet available.
|
|
69
|
+
* @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`
|
|
70
|
+
* or `cencori.knowledge.addFileSource()`.
|
|
73
71
|
*/
|
|
74
72
|
async add(documents) {
|
|
75
73
|
throw new Error(
|
|
76
|
-
`cencori.storage.knowledge.add() is
|
|
74
|
+
`cencori.storage.knowledge.add() is not available. Use cencori.knowledge.addInlineSource(kbId, text) or cencori.knowledge.addFileSource(kbId, file).`
|
|
77
75
|
);
|
|
78
76
|
}
|
|
79
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/storage/index.ts"],"sourcesContent":["/**\n * Storage Namespace - Vector Database, Knowledge Base, RAG\n * \n * 🚧 Coming Soon\n * \n * @example\n * const results = await cencori.storage.vectors.search('query', { limit: 5 });\n */\n\nimport type { VectorSearchOptions } from '../types';\n\nclass VectorsNamespace {\n /**\n * Search vectors by query\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async search(query: string, options?: VectorSearchOptions): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.search() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Upsert vectors\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upsert(vectors: { id: string; values: number[]; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.upsert() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Delete vectors by ID\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async delete(ids: string[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.delete() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nclass KnowledgeNamespace {\n /**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/storage/index.ts"],"sourcesContent":["/**\n * Storage Namespace - Vector Database, Knowledge Base, RAG\n * \n * 🚧 Coming Soon\n * \n * @example\n * const results = await cencori.storage.vectors.search('query', { limit: 5 });\n */\n\nimport type { VectorSearchOptions } from '../types';\n\nclass VectorsNamespace {\n /**\n * Search vectors by query\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async search(query: string, options?: VectorSearchOptions): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.search() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Upsert vectors\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upsert(vectors: { id: string; values: number[]; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.upsert() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Delete vectors by ID\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async delete(ids: string[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.delete() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nclass KnowledgeNamespace {\n /**\n * @deprecated Never implemented. Use `cencori.knowledge.search()`, or\n * ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.\n */\n async query(question: string): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.query() is not available. ` +\n `Use cencori.knowledge.search(kbId, { query }), or cencori.ai.chat({ knowledgeBases: [kbId], ... }).`\n );\n }\n\n /**\n * @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`\n * or `cencori.knowledge.addFileSource()`.\n */\n async add(documents: { content: string; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.add() is not available. ` +\n `Use cencori.knowledge.addInlineSource(kbId, text) or cencori.knowledge.addFileSource(kbId, file).`\n );\n }\n}\n\nclass FilesNamespace {\n /**\n * Upload a file\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upload(file: Blob | Buffer, name: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.upload() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Process a file (extract text, OCR, etc.)\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async process(fileId: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.process() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nexport class StorageNamespace {\n /**\n * Vector database operations\n */\n readonly vectors = new VectorsNamespace();\n\n /**\n * Knowledge base operations (RAG)\n */\n readonly knowledge = new KnowledgeNamespace();\n\n /**\n * File storage and processing\n */\n readonly files = new FilesNamespace();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,IAAM,mBAAN,MAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,MAAM,OAAO,OAAe,SAA+C;AACvE,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,SAAiG;AAC1G,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,KAA+B;AACxC,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,qBAAN,MAAyB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKrB,MAAM,MAAM,UAAkC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,IAAI,WAAsF;AAC5F,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,iBAAN,MAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,MAAM,OAAO,MAAqB,MAA8B;AAC5D,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,QAAQ,QAAgC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEO,IAAM,mBAAN,MAAuB;AAAA,EAAvB;AAIH;AAAA;AAAA;AAAA,SAAS,UAAU,IAAI,iBAAiB;AAKxC;AAAA;AAAA;AAAA,SAAS,YAAY,IAAI,mBAAmB;AAK5C;AAAA;AAAA;AAAA,SAAS,QAAQ,IAAI,eAAe;AAAA;AACxC;","names":[]}
|
package/dist/storage/index.mjs
CHANGED
|
@@ -33,23 +33,21 @@ var VectorsNamespace = class {
|
|
|
33
33
|
};
|
|
34
34
|
var KnowledgeNamespace = class {
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* 🚧 Coming Soon - This feature is not yet available.
|
|
36
|
+
* @deprecated Never implemented. Use `cencori.knowledge.search()`, or
|
|
37
|
+
* ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.
|
|
39
38
|
*/
|
|
40
39
|
async query(question) {
|
|
41
40
|
throw new Error(
|
|
42
|
-
`cencori.storage.knowledge.query() is
|
|
41
|
+
`cencori.storage.knowledge.query() is not available. Use cencori.knowledge.search(kbId, { query }), or cencori.ai.chat({ knowledgeBases: [kbId], ... }).`
|
|
43
42
|
);
|
|
44
43
|
}
|
|
45
44
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* 🚧 Coming Soon - This feature is not yet available.
|
|
45
|
+
* @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`
|
|
46
|
+
* or `cencori.knowledge.addFileSource()`.
|
|
49
47
|
*/
|
|
50
48
|
async add(documents) {
|
|
51
49
|
throw new Error(
|
|
52
|
-
`cencori.storage.knowledge.add() is
|
|
50
|
+
`cencori.storage.knowledge.add() is not available. Use cencori.knowledge.addInlineSource(kbId, text) or cencori.knowledge.addFileSource(kbId, file).`
|
|
53
51
|
);
|
|
54
52
|
}
|
|
55
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/storage/index.ts"],"sourcesContent":["/**\n * Storage Namespace - Vector Database, Knowledge Base, RAG\n * \n * 🚧 Coming Soon\n * \n * @example\n * const results = await cencori.storage.vectors.search('query', { limit: 5 });\n */\n\nimport type { VectorSearchOptions } from '../types';\n\nclass VectorsNamespace {\n /**\n * Search vectors by query\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async search(query: string, options?: VectorSearchOptions): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.search() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Upsert vectors\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upsert(vectors: { id: string; values: number[]; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.upsert() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Delete vectors by ID\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async delete(ids: string[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.delete() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nclass KnowledgeNamespace {\n /**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/storage/index.ts"],"sourcesContent":["/**\n * Storage Namespace - Vector Database, Knowledge Base, RAG\n * \n * 🚧 Coming Soon\n * \n * @example\n * const results = await cencori.storage.vectors.search('query', { limit: 5 });\n */\n\nimport type { VectorSearchOptions } from '../types';\n\nclass VectorsNamespace {\n /**\n * Search vectors by query\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async search(query: string, options?: VectorSearchOptions): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.search() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Upsert vectors\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upsert(vectors: { id: string; values: number[]; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.upsert() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Delete vectors by ID\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async delete(ids: string[]): Promise<never> {\n throw new Error(\n `cencori.storage.vectors.delete() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nclass KnowledgeNamespace {\n /**\n * @deprecated Never implemented. Use `cencori.knowledge.search()`, or\n * ground a chat with `cencori.ai.chat({ knowledgeBases: [...] })`.\n */\n async query(question: string): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.query() is not available. ` +\n `Use cencori.knowledge.search(kbId, { query }), or cencori.ai.chat({ knowledgeBases: [kbId], ... }).`\n );\n }\n\n /**\n * @deprecated Never implemented. Use `cencori.knowledge.addInlineSource()`\n * or `cencori.knowledge.addFileSource()`.\n */\n async add(documents: { content: string; metadata?: Record<string, unknown> }[]): Promise<never> {\n throw new Error(\n `cencori.storage.knowledge.add() is not available. ` +\n `Use cencori.knowledge.addInlineSource(kbId, text) or cencori.knowledge.addFileSource(kbId, file).`\n );\n }\n}\n\nclass FilesNamespace {\n /**\n * Upload a file\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async upload(file: Blob | Buffer, name: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.upload() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n\n /**\n * Process a file (extract text, OCR, etc.)\n * \n * 🚧 Coming Soon - This feature is not yet available.\n */\n async process(fileId: string): Promise<never> {\n throw new Error(\n `cencori.storage.files.process() is coming soon! ` +\n `Join our waitlist at https://cencori.com/memory`\n );\n }\n}\n\nexport class StorageNamespace {\n /**\n * Vector database operations\n */\n readonly vectors = new VectorsNamespace();\n\n /**\n * Knowledge base operations (RAG)\n */\n readonly knowledge = new KnowledgeNamespace();\n\n /**\n * File storage and processing\n */\n readonly files = new FilesNamespace();\n}\n"],"mappings":";AAWA,IAAM,mBAAN,MAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,MAAM,OAAO,OAAe,SAA+C;AACvE,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,SAAiG;AAC1G,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,KAA+B;AACxC,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,qBAAN,MAAyB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKrB,MAAM,MAAM,UAAkC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,IAAI,WAAsF;AAC5F,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEA,IAAM,iBAAN,MAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,MAAM,OAAO,MAAqB,MAA8B;AAC5D,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,QAAQ,QAAgC;AAC1C,UAAM,IAAI;AAAA,MACN;AAAA,IAEJ;AAAA,EACJ;AACJ;AAEO,IAAM,mBAAN,MAAuB;AAAA,EAAvB;AAIH;AAAA;AAAA;AAAA,SAAS,UAAU,IAAI,iBAAiB;AAKxC;AAAA;AAAA;AAAA,SAAS,YAAY,IAAI,mBAAmB;AAK5C;AAAA;AAAA;AAAA,SAAS,QAAQ,IAAI,eAAe;AAAA;AACxC;","names":[]}
|
|
@@ -95,6 +95,28 @@ interface ChatRequest {
|
|
|
95
95
|
/** Template variables to interpolate (e.g. {{tier}} → 'pro') */
|
|
96
96
|
variables?: Record<string, string>;
|
|
97
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* Knowledge base ids (`kb_...`, up to 3) to ground the answer in. The
|
|
100
|
+
* gateway searches them with the latest user message, adds the best
|
|
101
|
+
* passages to the prompt, and the model cites them as `[1]`, `[2]`...
|
|
102
|
+
* Requires a secret key; tenant-scoped bases are queried via Sessions.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* knowledgeBases: ['kb_8f2c...']
|
|
106
|
+
*/
|
|
107
|
+
knowledgeBases?: string[];
|
|
108
|
+
}
|
|
109
|
+
/** A passage the answer was grounded in. `n` matches the model's `[n]` marker. */
|
|
110
|
+
interface KnowledgeCitation {
|
|
111
|
+
n: number;
|
|
112
|
+
chunkId: string;
|
|
113
|
+
sourceId: string;
|
|
114
|
+
/** Chunk position within its source. */
|
|
115
|
+
ord: number | null;
|
|
116
|
+
/** Page number, for paged sources like PDFs. */
|
|
117
|
+
page: number | null;
|
|
118
|
+
/** Similarity to the query, 0–1. */
|
|
119
|
+
score: number;
|
|
98
120
|
}
|
|
99
121
|
interface ChatResponse {
|
|
100
122
|
id: string;
|
|
@@ -125,6 +147,11 @@ interface ChatResponse {
|
|
|
125
147
|
reasons: string[];
|
|
126
148
|
};
|
|
127
149
|
};
|
|
150
|
+
/** Present when `knowledgeBases` was set: which passages were used. */
|
|
151
|
+
knowledge?: {
|
|
152
|
+
knowledgeBases: string[];
|
|
153
|
+
citations: KnowledgeCitation[];
|
|
154
|
+
};
|
|
128
155
|
}
|
|
129
156
|
/**
|
|
130
157
|
* Structured output request with JSON schema
|
|
@@ -407,4 +434,4 @@ interface RequestOptions {
|
|
|
407
434
|
headers?: Record<string, string>;
|
|
408
435
|
}
|
|
409
436
|
|
|
410
|
-
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 };
|
|
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, 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 };
|
|
@@ -95,6 +95,28 @@ interface ChatRequest {
|
|
|
95
95
|
/** Template variables to interpolate (e.g. {{tier}} → 'pro') */
|
|
96
96
|
variables?: Record<string, string>;
|
|
97
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* Knowledge base ids (`kb_...`, up to 3) to ground the answer in. The
|
|
100
|
+
* gateway searches them with the latest user message, adds the best
|
|
101
|
+
* passages to the prompt, and the model cites them as `[1]`, `[2]`...
|
|
102
|
+
* Requires a secret key; tenant-scoped bases are queried via Sessions.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* knowledgeBases: ['kb_8f2c...']
|
|
106
|
+
*/
|
|
107
|
+
knowledgeBases?: string[];
|
|
108
|
+
}
|
|
109
|
+
/** A passage the answer was grounded in. `n` matches the model's `[n]` marker. */
|
|
110
|
+
interface KnowledgeCitation {
|
|
111
|
+
n: number;
|
|
112
|
+
chunkId: string;
|
|
113
|
+
sourceId: string;
|
|
114
|
+
/** Chunk position within its source. */
|
|
115
|
+
ord: number | null;
|
|
116
|
+
/** Page number, for paged sources like PDFs. */
|
|
117
|
+
page: number | null;
|
|
118
|
+
/** Similarity to the query, 0–1. */
|
|
119
|
+
score: number;
|
|
98
120
|
}
|
|
99
121
|
interface ChatResponse {
|
|
100
122
|
id: string;
|
|
@@ -125,6 +147,11 @@ interface ChatResponse {
|
|
|
125
147
|
reasons: string[];
|
|
126
148
|
};
|
|
127
149
|
};
|
|
150
|
+
/** Present when `knowledgeBases` was set: which passages were used. */
|
|
151
|
+
knowledge?: {
|
|
152
|
+
knowledgeBases: string[];
|
|
153
|
+
citations: KnowledgeCitation[];
|
|
154
|
+
};
|
|
128
155
|
}
|
|
129
156
|
/**
|
|
130
157
|
* Structured output request with JSON schema
|
|
@@ -407,4 +434,4 @@ interface RequestOptions {
|
|
|
407
434
|
headers?: Record<string, string>;
|
|
408
435
|
}
|
|
409
436
|
|
|
410
|
-
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 };
|
|
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, 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/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.
|
|
4
|
+
"version": "1.9.0",
|
|
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",
|