@ontos-ai/knowhere-sdk 2.4.0 → 2.4.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/README.md +2 -2
- package/dist/index.d.mts +17 -8
- package/dist/index.d.ts +17 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -311,8 +311,8 @@ const response = await client.retrieval.query({
|
|
|
311
311
|
|
|
312
312
|
console.log(response.answerText); // LLM-generated answer
|
|
313
313
|
console.log(response.referencedChunks); // cited evidence chunks
|
|
314
|
-
console.log(response.evidence); //
|
|
315
|
-
console.log(response.evidenceText); //
|
|
314
|
+
console.log(response.evidence); // grouped [E n] parts (text/HTML and inline images)
|
|
315
|
+
console.log(response.evidenceText); // deprecated; always empty. Use evidence.
|
|
316
316
|
console.log(response.stopReason); // agentic termination reason, when returned
|
|
317
317
|
console.log(response.failureReason); // no-answer reason, when returned
|
|
318
318
|
|
package/dist/index.d.mts
CHANGED
|
@@ -199,14 +199,23 @@ interface Manifest {
|
|
|
199
199
|
interface ConnectTo {
|
|
200
200
|
/** Target chunk_id */
|
|
201
201
|
target: string;
|
|
202
|
-
/**
|
|
203
|
-
|
|
202
|
+
/**
|
|
203
|
+
* Relationship type.
|
|
204
|
+
* - `embeds`: body chunk -> inline image/table asset
|
|
205
|
+
* - `embedded_by`: image/table asset -> owning body chunk (reverse of `embeds`)
|
|
206
|
+
* - `related`: same-page body chunk -> asset
|
|
207
|
+
* - `cross_doc_entity` / `intra_doc_ref`: reserved, not produced yet
|
|
208
|
+
*/
|
|
209
|
+
relation: 'embeds' | 'embedded_by' | 'related' | 'cross_doc_entity' | 'intra_doc_ref';
|
|
210
|
+
/** Reserved for cross-document targets; omitted for same-document edges */
|
|
211
|
+
targetDocumentId?: string;
|
|
204
212
|
/** Placeholder ref in content, e.g. '[images/a.png]' (embeds only) */
|
|
205
213
|
ref?: string;
|
|
206
|
-
/**
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
214
|
+
/** Character offsets of `ref` in the body content (embeds only) */
|
|
215
|
+
position?: {
|
|
216
|
+
start: number;
|
|
217
|
+
end: number;
|
|
218
|
+
};
|
|
210
219
|
}
|
|
211
220
|
/**
|
|
212
221
|
* A single image or table resource entry in ``doc_nav.json``.
|
|
@@ -949,7 +958,7 @@ interface RetrievalReferencedChunk {
|
|
|
949
958
|
*
|
|
950
959
|
* Downstream agents consume:
|
|
951
960
|
* - `evidence`: composed parts (text/HTML and inline images)
|
|
952
|
-
* - `evidenceText`:
|
|
961
|
+
* - `evidenceText`: deprecated; always empty. Use `evidence`.
|
|
953
962
|
* - `results`: raw path chunks for debug
|
|
954
963
|
* - `decisionTrace`: per-step navigation decisions (includes stop/failure)
|
|
955
964
|
* - `referencedChunks`: structured chunk citations for follow-up queries
|
|
@@ -967,7 +976,7 @@ interface RetrievalQueryResponse {
|
|
|
967
976
|
answerText: string | null;
|
|
968
977
|
/** Cited evidence chunks with asset URLs when available */
|
|
969
978
|
referencedChunks: RetrievalReferencedChunk[];
|
|
970
|
-
/**
|
|
979
|
+
/** Deprecated. Always empty. Use evidence. */
|
|
971
980
|
evidenceText?: string | null;
|
|
972
981
|
/** Reason why the agentic run stopped (e.g. answer_done, not_found) */
|
|
973
982
|
stopReason?: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -199,14 +199,23 @@ interface Manifest {
|
|
|
199
199
|
interface ConnectTo {
|
|
200
200
|
/** Target chunk_id */
|
|
201
201
|
target: string;
|
|
202
|
-
/**
|
|
203
|
-
|
|
202
|
+
/**
|
|
203
|
+
* Relationship type.
|
|
204
|
+
* - `embeds`: body chunk -> inline image/table asset
|
|
205
|
+
* - `embedded_by`: image/table asset -> owning body chunk (reverse of `embeds`)
|
|
206
|
+
* - `related`: same-page body chunk -> asset
|
|
207
|
+
* - `cross_doc_entity` / `intra_doc_ref`: reserved, not produced yet
|
|
208
|
+
*/
|
|
209
|
+
relation: 'embeds' | 'embedded_by' | 'related' | 'cross_doc_entity' | 'intra_doc_ref';
|
|
210
|
+
/** Reserved for cross-document targets; omitted for same-document edges */
|
|
211
|
+
targetDocumentId?: string;
|
|
204
212
|
/** Placeholder ref in content, e.g. '[images/a.png]' (embeds only) */
|
|
205
213
|
ref?: string;
|
|
206
|
-
/**
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
214
|
+
/** Character offsets of `ref` in the body content (embeds only) */
|
|
215
|
+
position?: {
|
|
216
|
+
start: number;
|
|
217
|
+
end: number;
|
|
218
|
+
};
|
|
210
219
|
}
|
|
211
220
|
/**
|
|
212
221
|
* A single image or table resource entry in ``doc_nav.json``.
|
|
@@ -949,7 +958,7 @@ interface RetrievalReferencedChunk {
|
|
|
949
958
|
*
|
|
950
959
|
* Downstream agents consume:
|
|
951
960
|
* - `evidence`: composed parts (text/HTML and inline images)
|
|
952
|
-
* - `evidenceText`:
|
|
961
|
+
* - `evidenceText`: deprecated; always empty. Use `evidence`.
|
|
953
962
|
* - `results`: raw path chunks for debug
|
|
954
963
|
* - `decisionTrace`: per-step navigation decisions (includes stop/failure)
|
|
955
964
|
* - `referencedChunks`: structured chunk citations for follow-up queries
|
|
@@ -967,7 +976,7 @@ interface RetrievalQueryResponse {
|
|
|
967
976
|
answerText: string | null;
|
|
968
977
|
/** Cited evidence chunks with asset URLs when available */
|
|
969
978
|
referencedChunks: RetrievalReferencedChunk[];
|
|
970
|
-
/**
|
|
979
|
+
/** Deprecated. Always empty. Use evidence. */
|
|
971
980
|
evidenceText?: string | null;
|
|
972
981
|
/** Reason why the agentic run stopped (e.g. answer_done, not_found) */
|
|
973
982
|
stopReason?: string | null;
|