Skip to content

Commit

Permalink
Fix graph search result enum
Browse files Browse the repository at this point in the history
  • Loading branch information
NolanTrem committed Dec 5, 2024
1 parent b916121 commit f05456c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion js/sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "r2r-js",
"version": "0.4.1",
"version": "0.4.2",
"description": "",
"main": "dist/index.js",
"browser": "dist/index.browser.js",
Expand Down
18 changes: 10 additions & 8 deletions js/sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,19 @@ export interface VectorSearchResult {
metadata?: Record<string, any>;
}

export interface KGSearchResult {
method: string;
content: string;
result_type?: string;
chunks_ids?: string[];
metadata?: Record<string, any>;
type KGSearchResultType = "entity" | "relationship" | "community" | "global";

interface GraphSearchResult {
content: any;
result_type?: KGSearchResultType;
chunk_ids?: string[];
metadata: Record<string, any>;
score?: number;
}

export interface CombinedSearchResponse {
vector_search_results: VectorSearchResult[];
graph_search_results?: KGSearchResult[];
chunk_search_results: VectorSearchResult[];
graph_search_results?: GraphSearchResult[];
}

// System types
Expand Down

0 comments on commit f05456c

Please sign in to comment.