Spaces:
Sleeping
Sleeping
Download lib/knowledge/types.ts from zimejin/deeptrust-v2: direct link, hf CLI and curl.
- Browser
- Download file 754 Bytes
-
https://huggingface.co/spaces/zimejin/deeptrust-v2/resolve/main/lib/knowledge/types.ts
- Command line
-
hf download hf://spaces/zimejin/deeptrust-v2/lib/knowledge/types.ts
-
curl -L -o types.ts https://huggingface.co/spaces/zimejin/deeptrust-v2/resolve/main/lib/knowledge/types.ts
754 Bytes
| /** | |
| * Client-side knowledge store types. | |
| * Documents and chunks are persisted in IndexedDB. | |
| */ | |
| export type DocumentType = "file" | "url" | "note"; | |
| export interface KnowledgeDocument { | |
| id: string; | |
| type: DocumentType; | |
| label: string; | |
| url?: string; | |
| createdAt: string; | |
| } | |
| export interface KnowledgeChunk { | |
| id: string; | |
| documentId: string; | |
| text: string; | |
| embedding: number[]; | |
| startIndex: number; | |
| endIndex: number; | |
| } | |
| /** UI-facing item (matches existing KnowledgeItem shape). */ | |
| export interface KnowledgeItemMeta { | |
| id: string; | |
| type: DocumentType; | |
| label: string; | |
| meta?: string; | |
| status?: "pending" | "indexing" | "indexed" | "error"; | |
| } | |
| export interface RetrieveResult { | |
| retrievedContext: string; | |
| contextUrls: string[]; | |
| } | |