Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/connect-to-embedded-by.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ontos-ai/knowhere-sdk": patch
---

Align `ConnectTo.relation` with the API schema: add `embedded_by` (and reserved relation values), `targetDocumentId`, and `position`. Drop unused `score`/`keywords` fields that the API no longer emits.
18 changes: 12 additions & 6 deletions src/types/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,20 @@ export interface Manifest {
export interface ConnectTo {
/** Target chunk_id */
target: string;
/** Relationship type */
relation: 'embeds' | 'related';
/**
* Relationship type.
* - `embeds`: body chunk -> inline image/table asset
* - `embedded_by`: image/table asset -> owning body chunk (reverse of `embeds`)
* - `related`: same-page body chunk -> asset
* - `cross_doc_entity` / `intra_doc_ref`: reserved, not produced yet
*/
relation: 'embeds' | 'embedded_by' | 'related' | 'cross_doc_entity' | 'intra_doc_ref';
/** Reserved for cross-document targets; omitted for same-document edges */
targetDocumentId?: string;
/** Placeholder ref in content, e.g. '[images/a.png]' (embeds only) */
ref?: string;
/** Semantic similarity score (related only) */
score?: number;
/** Shared keywords (related only) */
keywords?: string[];
/** Character offsets of `ref` in the body content (embeds only) */
position?: { start: number; end: number };
}

/**
Expand Down
Loading