forked from dipseth/dataproc-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqdrant-payload.ts
More file actions
100 lines (84 loc) · 2.25 KB
/
qdrant-payload.ts
File metadata and controls
100 lines (84 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
* Enhanced Qdrant payload structure types
* Supports structured data storage with compression and backward compatibility
*/
export interface QdrantPayloadBase {
// Metadata fields
toolName: string;
timestamp: string;
projectId: string;
region: string;
clusterName: string;
responseType: string;
type: string;
storedAt: string;
// Token optimization fields
originalTokenCount?: number;
filteredTokenCount?: number;
compressionRatio?: number;
// Index signature for Qdrant compatibility
[key: string]: unknown;
}
export interface QdrantQueryResultPayload extends QdrantPayloadBase {
// Query-specific metadata
jobId: string;
contentType: string;
totalRows: number;
schemaFields: number;
dataSize: number;
// Structured data fields (instead of single "data" key)
schema?: any;
rows?: any[];
summary?: string;
searchableContent?: string;
// Compression support
isCompressed?: boolean;
compressionType?: 'gzip' | 'deflate';
originalSize?: number;
compressedSize?: number;
// Legacy support - will be phased out
data?: string;
}
export interface QdrantClusterPayload extends QdrantPayloadBase {
// Cluster-specific data
clusterConfig?: any;
machineTypes?: any;
networkConfig?: any;
softwareConfig?: any;
// Compression support
isCompressed?: boolean;
compressionType?: 'gzip' | 'deflate';
originalSize?: number;
compressedSize?: number;
// Legacy support
data?: string;
}
export interface QdrantJobPayload extends QdrantPayloadBase {
// Job-specific data
jobId: string;
jobType: string;
status: string;
submissionTime: string;
duration?: number;
query?: string;
results?: any;
error?: any;
// Compression support
isCompressed?: boolean;
compressionType?: 'gzip' | 'deflate';
originalSize?: number;
compressedSize?: number;
// Legacy support
data?: string;
}
export type QdrantPayload = QdrantQueryResultPayload | QdrantClusterPayload | QdrantJobPayload;
export interface CompressionConfig {
threshold: number; // Size threshold in bytes for compression
type: 'gzip' | 'deflate';
level?: number; // Compression level (1-9)
}
export const DEFAULT_COMPRESSION_CONFIG: CompressionConfig = {
threshold: 10240, // 10KB threshold
type: 'gzip',
level: 6,
};