@nebula-ai/sdk 1.1.29 → 1.1.30
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/dist/index.d.mts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -145,7 +145,7 @@ interface ActivatedKnowledge {
|
|
|
145
145
|
resolved_at?: string;
|
|
146
146
|
source_nodegroup_ids?: string[];
|
|
147
147
|
}
|
|
148
|
-
interface
|
|
148
|
+
interface GroundedSource {
|
|
149
149
|
id?: string;
|
|
150
150
|
text: string;
|
|
151
151
|
activation_score: number;
|
|
@@ -175,7 +175,7 @@ interface MemoryResponse {
|
|
|
175
175
|
entities: ActivatedEntity[];
|
|
176
176
|
knowledge: ActivatedKnowledge[];
|
|
177
177
|
episodes?: ActivatedEpisode[];
|
|
178
|
-
|
|
178
|
+
sources: GroundedSource[];
|
|
179
179
|
total_traversal_time_ms?: number;
|
|
180
180
|
token_count?: number;
|
|
181
181
|
}
|
|
@@ -303,16 +303,16 @@ declare class Nebula {
|
|
|
303
303
|
};
|
|
304
304
|
};
|
|
305
305
|
}>;
|
|
306
|
-
/** Delete a specific
|
|
307
|
-
|
|
308
|
-
/** Update a specific
|
|
309
|
-
|
|
306
|
+
/** Delete a specific source within a memory */
|
|
307
|
+
deleteSource(sourceId: string): Promise<boolean>;
|
|
308
|
+
/** Update a specific source within a memory */
|
|
309
|
+
updateSource(sourceId: string, content: string, metadata?: Record<string, unknown>): Promise<boolean>;
|
|
310
310
|
/**
|
|
311
311
|
* Update memory-level properties including name, metadata, and collection associations.
|
|
312
312
|
*
|
|
313
313
|
* This method allows updating properties of an entire memory (document or conversation)
|
|
314
|
-
* without modifying its content. For updating individual
|
|
315
|
-
* use
|
|
314
|
+
* without modifying its content. For updating individual sources within a memory,
|
|
315
|
+
* use updateSource(). For updating content, use storeMemory() to append.
|
|
316
316
|
*
|
|
317
317
|
* @param options - Update configuration
|
|
318
318
|
* @param options.memoryId - The ID of the memory to update
|
|
@@ -545,4 +545,4 @@ type MemoryFactory = {
|
|
|
545
545
|
declare const Memory: MemoryFactory;
|
|
546
546
|
type Memory = Memory$1;
|
|
547
547
|
|
|
548
|
-
export { type ActivatedEntity, type ActivatedEpisode, type ActivatedFacet, type ActivatedKnowledge, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type
|
|
548
|
+
export { type ActivatedEntity, type ActivatedEpisode, type ActivatedFacet, type ActivatedKnowledge, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedSource, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ interface ActivatedKnowledge {
|
|
|
145
145
|
resolved_at?: string;
|
|
146
146
|
source_nodegroup_ids?: string[];
|
|
147
147
|
}
|
|
148
|
-
interface
|
|
148
|
+
interface GroundedSource {
|
|
149
149
|
id?: string;
|
|
150
150
|
text: string;
|
|
151
151
|
activation_score: number;
|
|
@@ -175,7 +175,7 @@ interface MemoryResponse {
|
|
|
175
175
|
entities: ActivatedEntity[];
|
|
176
176
|
knowledge: ActivatedKnowledge[];
|
|
177
177
|
episodes?: ActivatedEpisode[];
|
|
178
|
-
|
|
178
|
+
sources: GroundedSource[];
|
|
179
179
|
total_traversal_time_ms?: number;
|
|
180
180
|
token_count?: number;
|
|
181
181
|
}
|
|
@@ -303,16 +303,16 @@ declare class Nebula {
|
|
|
303
303
|
};
|
|
304
304
|
};
|
|
305
305
|
}>;
|
|
306
|
-
/** Delete a specific
|
|
307
|
-
|
|
308
|
-
/** Update a specific
|
|
309
|
-
|
|
306
|
+
/** Delete a specific source within a memory */
|
|
307
|
+
deleteSource(sourceId: string): Promise<boolean>;
|
|
308
|
+
/** Update a specific source within a memory */
|
|
309
|
+
updateSource(sourceId: string, content: string, metadata?: Record<string, unknown>): Promise<boolean>;
|
|
310
310
|
/**
|
|
311
311
|
* Update memory-level properties including name, metadata, and collection associations.
|
|
312
312
|
*
|
|
313
313
|
* This method allows updating properties of an entire memory (document or conversation)
|
|
314
|
-
* without modifying its content. For updating individual
|
|
315
|
-
* use
|
|
314
|
+
* without modifying its content. For updating individual sources within a memory,
|
|
315
|
+
* use updateSource(). For updating content, use storeMemory() to append.
|
|
316
316
|
*
|
|
317
317
|
* @param options - Update configuration
|
|
318
318
|
* @param options.memoryId - The ID of the memory to update
|
|
@@ -545,4 +545,4 @@ type MemoryFactory = {
|
|
|
545
545
|
declare const Memory: MemoryFactory;
|
|
546
546
|
type Memory = Memory$1;
|
|
547
547
|
|
|
548
|
-
export { type ActivatedEntity, type ActivatedEpisode, type ActivatedFacet, type ActivatedKnowledge, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type
|
|
548
|
+
export { type ActivatedEntity, type ActivatedEpisode, type ActivatedFacet, type ActivatedKnowledge, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedSource, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };
|
package/dist/index.js
CHANGED
|
@@ -578,30 +578,30 @@ var _Nebula = class _Nebula {
|
|
|
578
578
|
throw new NebulaClientException(`Unknown error: ${String(error)}`);
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
/** Delete a specific
|
|
582
|
-
async
|
|
581
|
+
/** Delete a specific source within a memory */
|
|
582
|
+
async deleteSource(sourceId) {
|
|
583
583
|
try {
|
|
584
|
-
await this._makeRequest("DELETE", `/v1/
|
|
584
|
+
await this._makeRequest("DELETE", `/v1/sources/${sourceId}`);
|
|
585
585
|
return true;
|
|
586
586
|
} catch (error) {
|
|
587
587
|
if (error instanceof NebulaException && error.statusCode === 404) {
|
|
588
|
-
throw new NebulaNotFoundException(
|
|
588
|
+
throw new NebulaNotFoundException(sourceId, "Source");
|
|
589
589
|
}
|
|
590
590
|
throw error;
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
|
-
/** Update a specific
|
|
594
|
-
async
|
|
593
|
+
/** Update a specific source within a memory */
|
|
594
|
+
async updateSource(sourceId, content, metadata) {
|
|
595
595
|
const payload = { content };
|
|
596
596
|
if (metadata !== void 0) {
|
|
597
597
|
payload.metadata = metadata;
|
|
598
598
|
}
|
|
599
599
|
try {
|
|
600
|
-
await this._makeRequest("PATCH", `/v1/
|
|
600
|
+
await this._makeRequest("PATCH", `/v1/sources/${sourceId}`, payload);
|
|
601
601
|
return true;
|
|
602
602
|
} catch (error) {
|
|
603
603
|
if (error instanceof NebulaException && error.statusCode === 404) {
|
|
604
|
-
throw new NebulaNotFoundException(
|
|
604
|
+
throw new NebulaNotFoundException(sourceId, "Source");
|
|
605
605
|
}
|
|
606
606
|
throw error;
|
|
607
607
|
}
|
|
@@ -610,8 +610,8 @@ var _Nebula = class _Nebula {
|
|
|
610
610
|
* Update memory-level properties including name, metadata, and collection associations.
|
|
611
611
|
*
|
|
612
612
|
* This method allows updating properties of an entire memory (document or conversation)
|
|
613
|
-
* without modifying its content. For updating individual
|
|
614
|
-
* use
|
|
613
|
+
* without modifying its content. For updating individual sources within a memory,
|
|
614
|
+
* use updateSource(). For updating content, use storeMemory() to append.
|
|
615
615
|
*
|
|
616
616
|
* @param options - Update configuration
|
|
617
617
|
* @param options.memoryId - The ID of the memory to update
|
|
@@ -847,9 +847,9 @@ var _Nebula = class _Nebula {
|
|
|
847
847
|
const memoryResponse = {
|
|
848
848
|
query: memoryResponseData.query || options.query,
|
|
849
849
|
entities: memoryResponseData.entities || [],
|
|
850
|
-
knowledge: memoryResponseData.knowledge ??
|
|
850
|
+
knowledge: memoryResponseData.knowledge ?? [],
|
|
851
851
|
episodes: memoryResponseData.episodes || [],
|
|
852
|
-
|
|
852
|
+
sources: memoryResponseData.sources || memoryResponseData.utterances || [],
|
|
853
853
|
total_traversal_time_ms: memoryResponseData.total_traversal_time_ms,
|
|
854
854
|
token_count: memoryResponseData.token_count
|
|
855
855
|
};
|