cortexdb-client 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,84 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: cortexdb/v1/graphrag.proto
5
+ # Protobuf Python Version: 6.33.5
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 33,
16
+ 5,
17
+ '',
18
+ 'cortexdb/v1/graphrag.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from cortexdb_client._pb.cortexdb.v1 import common_pb2 as cortexdb_dot_v1_dot_common__pb2
26
+
27
+
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x63ortexdb/v1/graphrag.proto\x12\x0b\x63ortexdb.v1\x1a\x18\x63ortexdb/v1/common.proto\"\x81\x02\n\x1aInsertGraphDocumentRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\x12G\n\x08metadata\x18\x04 \x03(\x0b\x32\x35.cortexdb.v1.InsertGraphDocumentRequest.MetadataEntry\x12\x12\n\ncollection\x18\x05 \x01(\t\x12\x12\n\nchunk_size\x18\x06 \x01(\x05\x12\x15\n\rchunk_overlap\x18\x07 \x01(\x05\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"h\n\x1bInsertGraphDocumentResponse\x12\x18\n\x10\x64ocument_node_id\x18\x01 \x01(\t\x12\x16\n\x0e\x63hunk_node_ids\x18\x02 \x03(\t\x12\x17\n\x0f\x65ntity_node_ids\x18\x03 \x03(\t\"\xe2\x03\n\x15SearchGraphRagRequest\x12\r\n\x05query\x18\x01 \x01(\t\x12\x12\n\ncollection\x18\x02 \x01(\t\x12\r\n\x05top_k\x18\x03 \x01(\x05\x12\x10\n\x08max_hops\x18\x04 \x01(\x05\x12\x1a\n\x12max_related_chunks\x18\x05 \x01(\x05\x12\x1a\n\x12max_context_chunks\x18\x06 \x01(\x05\x12\x19\n\x11max_context_chars\x18\x07 \x01(\x05\x12\x1a\n\x12per_document_limit\x18\x08 \x01(\x05\x12\x0e\n\x06rerank\x18\t \x01(\x08\x12\x16\n\x0e\x64isable_rerank\x18\n \x01(\x08\x12\x18\n\x10\x64iversity_lambda\x18\x0b \x01(\x01\x12\x15\n\rdisable_graph\x18\x0c \x01(\x08\x12\x16\n\x0eretrieval_mode\x18\r \x01(\t\x12\x13\n\x0bgraph_light\x18\x0e \x01(\x08\x12\x1b\n\x13max_expansion_seeds\x18\x0f \x01(\x05\x12\x1b\n\x13max_traversal_nodes\x18\x10 \x01(\x05\x12\x1e\n\x16max_entities_per_chunk\x18\x11 \x01(\x05\x12-\n\x04plan\x18\x12 \x01(\x0b\x32\x1a.cortexdb.v1.RetrievalPlanH\x00\x88\x01\x01\x42\x07\n\x05_plan\"\xd8\x01\n\x16SearchGraphRagResponse\x12\r\n\x05query\x18\x01 \x01(\t\x12(\n\x04plan\x18\x02 \x01(\x0b\x32\x1a.cortexdb.v1.RetrievalPlan\x12\x30\n\x08\x64\x65\x63ision\x18\x03 \x01(\x0b\x32\x1e.cortexdb.v1.RetrievalDecision\x12\x30\n\x06\x63hunks\x18\x04 \x03(\x0b\x32 .cortexdb.v1.GraphRagChunkResult\x12\x10\n\x08\x65ntities\x18\x05 \x03(\t\x12\x0f\n\x07\x63ontext\x18\x06 \x01(\t\"\x9e\x01\n\x11InsertTextRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04text\x18\x02 \x01(\t\x12>\n\x08metadata\x18\x03 \x03(\x0b\x32,.cortexdb.v1.InsertTextRequest.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x14\n\x12InsertTextResponse\"\xfb\x01\n\x16InsertTextBatchRequest\x12=\n\x05texts\x18\x01 \x03(\x0b\x32..cortexdb.v1.InsertTextBatchRequest.TextsEntry\x12\x43\n\x08metadata\x18\x02 \x03(\x0b\x32\x31.cortexdb.v1.InsertTextBatchRequest.MetadataEntry\x1a,\n\nTextsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x19\n\x17InsertTextBatchResponse\"\xc6\x01\n\nScoredText\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x12\x0e\n\x06\x64oc_id\x18\x03 \x01(\t\x12\x12\n\ncollection\x18\x04 \x01(\t\x12\x37\n\x08metadata\x18\x05 \x03(\x0b\x32%.cortexdb.v1.ScoredText.MetadataEntry\x12\r\n\x05score\x18\x06 \x01(\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x11SearchTextRequest\x12\r\n\x05query\x18\x01 \x01(\t\x12\x12\n\ncollection\x18\x02 \x01(\t\x12\r\n\x05top_k\x18\x03 \x01(\x05\">\n\x12SearchTextResponse\x12(\n\x07results\x18\x01 \x03(\x0b\x32\x17.cortexdb.v1.ScoredText\"7\n\x17HybridSearchTextRequest\x12\r\n\x05query\x18\x01 \x01(\t\x12\r\n\x05top_k\x18\x02 \x01(\x05\"D\n\x18HybridSearchTextResponse\x12(\n\x07results\x18\x01 \x03(\x0b\x32\x17.cortexdb.v1.ScoredText2\xb3\x04\n\x0fGraphRagService\x12h\n\x13InsertGraphDocument\x12\'.cortexdb.v1.InsertGraphDocumentRequest\x1a(.cortexdb.v1.InsertGraphDocumentResponse\x12Y\n\x0eSearchGraphRag\x12\".cortexdb.v1.SearchGraphRagRequest\x1a#.cortexdb.v1.SearchGraphRagResponse\x12M\n\nInsertText\x12\x1e.cortexdb.v1.InsertTextRequest\x1a\x1f.cortexdb.v1.InsertTextResponse\x12\\\n\x0fInsertTextBatch\x12#.cortexdb.v1.InsertTextBatchRequest\x1a$.cortexdb.v1.InsertTextBatchResponse\x12M\n\nSearchText\x12\x1e.cortexdb.v1.SearchTextRequest\x1a\x1f.cortexdb.v1.SearchTextResponse\x12_\n\x10HybridSearchText\x12$.cortexdb.v1.HybridSearchTextRequest\x1a%.cortexdb.v1.HybridSearchTextResponseB4Z2github.com/liliang-cn/cortexdb/v2/pkg/rpc/v1;rpcv1b\x06proto3')
29
+
30
+ _globals = globals()
31
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cortexdb.v1.graphrag_pb2', _globals)
33
+ if not _descriptor._USE_C_DESCRIPTORS:
34
+ _globals['DESCRIPTOR']._loaded_options = None
35
+ _globals['DESCRIPTOR']._serialized_options = b'Z2github.com/liliang-cn/cortexdb/v2/pkg/rpc/v1;rpcv1'
36
+ _globals['_INSERTGRAPHDOCUMENTREQUEST_METADATAENTRY']._loaded_options = None
37
+ _globals['_INSERTGRAPHDOCUMENTREQUEST_METADATAENTRY']._serialized_options = b'8\001'
38
+ _globals['_INSERTTEXTREQUEST_METADATAENTRY']._loaded_options = None
39
+ _globals['_INSERTTEXTREQUEST_METADATAENTRY']._serialized_options = b'8\001'
40
+ _globals['_INSERTTEXTBATCHREQUEST_TEXTSENTRY']._loaded_options = None
41
+ _globals['_INSERTTEXTBATCHREQUEST_TEXTSENTRY']._serialized_options = b'8\001'
42
+ _globals['_INSERTTEXTBATCHREQUEST_METADATAENTRY']._loaded_options = None
43
+ _globals['_INSERTTEXTBATCHREQUEST_METADATAENTRY']._serialized_options = b'8\001'
44
+ _globals['_SCOREDTEXT_METADATAENTRY']._loaded_options = None
45
+ _globals['_SCOREDTEXT_METADATAENTRY']._serialized_options = b'8\001'
46
+ _globals['_INSERTGRAPHDOCUMENTREQUEST']._serialized_start=70
47
+ _globals['_INSERTGRAPHDOCUMENTREQUEST']._serialized_end=327
48
+ _globals['_INSERTGRAPHDOCUMENTREQUEST_METADATAENTRY']._serialized_start=280
49
+ _globals['_INSERTGRAPHDOCUMENTREQUEST_METADATAENTRY']._serialized_end=327
50
+ _globals['_INSERTGRAPHDOCUMENTRESPONSE']._serialized_start=329
51
+ _globals['_INSERTGRAPHDOCUMENTRESPONSE']._serialized_end=433
52
+ _globals['_SEARCHGRAPHRAGREQUEST']._serialized_start=436
53
+ _globals['_SEARCHGRAPHRAGREQUEST']._serialized_end=918
54
+ _globals['_SEARCHGRAPHRAGRESPONSE']._serialized_start=921
55
+ _globals['_SEARCHGRAPHRAGRESPONSE']._serialized_end=1137
56
+ _globals['_INSERTTEXTREQUEST']._serialized_start=1140
57
+ _globals['_INSERTTEXTREQUEST']._serialized_end=1298
58
+ _globals['_INSERTTEXTREQUEST_METADATAENTRY']._serialized_start=280
59
+ _globals['_INSERTTEXTREQUEST_METADATAENTRY']._serialized_end=327
60
+ _globals['_INSERTTEXTRESPONSE']._serialized_start=1300
61
+ _globals['_INSERTTEXTRESPONSE']._serialized_end=1320
62
+ _globals['_INSERTTEXTBATCHREQUEST']._serialized_start=1323
63
+ _globals['_INSERTTEXTBATCHREQUEST']._serialized_end=1574
64
+ _globals['_INSERTTEXTBATCHREQUEST_TEXTSENTRY']._serialized_start=1481
65
+ _globals['_INSERTTEXTBATCHREQUEST_TEXTSENTRY']._serialized_end=1525
66
+ _globals['_INSERTTEXTBATCHREQUEST_METADATAENTRY']._serialized_start=280
67
+ _globals['_INSERTTEXTBATCHREQUEST_METADATAENTRY']._serialized_end=327
68
+ _globals['_INSERTTEXTBATCHRESPONSE']._serialized_start=1576
69
+ _globals['_INSERTTEXTBATCHRESPONSE']._serialized_end=1601
70
+ _globals['_SCOREDTEXT']._serialized_start=1604
71
+ _globals['_SCOREDTEXT']._serialized_end=1802
72
+ _globals['_SCOREDTEXT_METADATAENTRY']._serialized_start=280
73
+ _globals['_SCOREDTEXT_METADATAENTRY']._serialized_end=327
74
+ _globals['_SEARCHTEXTREQUEST']._serialized_start=1804
75
+ _globals['_SEARCHTEXTREQUEST']._serialized_end=1873
76
+ _globals['_SEARCHTEXTRESPONSE']._serialized_start=1875
77
+ _globals['_SEARCHTEXTRESPONSE']._serialized_end=1937
78
+ _globals['_HYBRIDSEARCHTEXTREQUEST']._serialized_start=1939
79
+ _globals['_HYBRIDSEARCHTEXTREQUEST']._serialized_end=1994
80
+ _globals['_HYBRIDSEARCHTEXTRESPONSE']._serialized_start=1996
81
+ _globals['_HYBRIDSEARCHTEXTRESPONSE']._serialized_end=2064
82
+ _globals['_GRAPHRAGSERVICE']._serialized_start=2067
83
+ _globals['_GRAPHRAGSERVICE']._serialized_end=2630
84
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,312 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ from cortexdb_client._pb.cortexdb.v1 import graphrag_pb2 as cortexdb_dot_v1_dot_graphrag__pb2
7
+
8
+ GRPC_GENERATED_VERSION = '1.81.0'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + ' but the generated code in cortexdb/v1/graphrag_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
27
+
28
+ class GraphRagServiceStub:
29
+ """Missing associated documentation comment in .proto file."""
30
+
31
+ def __init__(self, channel):
32
+ """Constructor.
33
+
34
+ Args:
35
+ channel: A grpc.Channel.
36
+ """
37
+ self.InsertGraphDocument = channel.unary_unary(
38
+ '/cortexdb.v1.GraphRagService/InsertGraphDocument',
39
+ request_serializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertGraphDocumentRequest.SerializeToString,
40
+ response_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertGraphDocumentResponse.FromString,
41
+ _registered_method=True)
42
+ self.SearchGraphRag = channel.unary_unary(
43
+ '/cortexdb.v1.GraphRagService/SearchGraphRag',
44
+ request_serializer=cortexdb_dot_v1_dot_graphrag__pb2.SearchGraphRagRequest.SerializeToString,
45
+ response_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.SearchGraphRagResponse.FromString,
46
+ _registered_method=True)
47
+ self.InsertText = channel.unary_unary(
48
+ '/cortexdb.v1.GraphRagService/InsertText',
49
+ request_serializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertTextRequest.SerializeToString,
50
+ response_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertTextResponse.FromString,
51
+ _registered_method=True)
52
+ self.InsertTextBatch = channel.unary_unary(
53
+ '/cortexdb.v1.GraphRagService/InsertTextBatch',
54
+ request_serializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertTextBatchRequest.SerializeToString,
55
+ response_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertTextBatchResponse.FromString,
56
+ _registered_method=True)
57
+ self.SearchText = channel.unary_unary(
58
+ '/cortexdb.v1.GraphRagService/SearchText',
59
+ request_serializer=cortexdb_dot_v1_dot_graphrag__pb2.SearchTextRequest.SerializeToString,
60
+ response_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.SearchTextResponse.FromString,
61
+ _registered_method=True)
62
+ self.HybridSearchText = channel.unary_unary(
63
+ '/cortexdb.v1.GraphRagService/HybridSearchText',
64
+ request_serializer=cortexdb_dot_v1_dot_graphrag__pb2.HybridSearchTextRequest.SerializeToString,
65
+ response_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.HybridSearchTextResponse.FromString,
66
+ _registered_method=True)
67
+
68
+
69
+ class GraphRagServiceServicer:
70
+ """Missing associated documentation comment in .proto file."""
71
+
72
+ def InsertGraphDocument(self, request, context):
73
+ """Missing associated documentation comment in .proto file."""
74
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
75
+ context.set_details('Method not implemented!')
76
+ raise NotImplementedError('Method not implemented!')
77
+
78
+ def SearchGraphRag(self, request, context):
79
+ """Missing associated documentation comment in .proto file."""
80
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
81
+ context.set_details('Method not implemented!')
82
+ raise NotImplementedError('Method not implemented!')
83
+
84
+ def InsertText(self, request, context):
85
+ """Missing associated documentation comment in .proto file."""
86
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
87
+ context.set_details('Method not implemented!')
88
+ raise NotImplementedError('Method not implemented!')
89
+
90
+ def InsertTextBatch(self, request, context):
91
+ """Missing associated documentation comment in .proto file."""
92
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
93
+ context.set_details('Method not implemented!')
94
+ raise NotImplementedError('Method not implemented!')
95
+
96
+ def SearchText(self, request, context):
97
+ """Missing associated documentation comment in .proto file."""
98
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
99
+ context.set_details('Method not implemented!')
100
+ raise NotImplementedError('Method not implemented!')
101
+
102
+ def HybridSearchText(self, request, context):
103
+ """Missing associated documentation comment in .proto file."""
104
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
105
+ context.set_details('Method not implemented!')
106
+ raise NotImplementedError('Method not implemented!')
107
+
108
+
109
+ def add_GraphRagServiceServicer_to_server(servicer, server):
110
+ rpc_method_handlers = {
111
+ 'InsertGraphDocument': grpc.unary_unary_rpc_method_handler(
112
+ servicer.InsertGraphDocument,
113
+ request_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertGraphDocumentRequest.FromString,
114
+ response_serializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertGraphDocumentResponse.SerializeToString,
115
+ ),
116
+ 'SearchGraphRag': grpc.unary_unary_rpc_method_handler(
117
+ servicer.SearchGraphRag,
118
+ request_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.SearchGraphRagRequest.FromString,
119
+ response_serializer=cortexdb_dot_v1_dot_graphrag__pb2.SearchGraphRagResponse.SerializeToString,
120
+ ),
121
+ 'InsertText': grpc.unary_unary_rpc_method_handler(
122
+ servicer.InsertText,
123
+ request_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertTextRequest.FromString,
124
+ response_serializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertTextResponse.SerializeToString,
125
+ ),
126
+ 'InsertTextBatch': grpc.unary_unary_rpc_method_handler(
127
+ servicer.InsertTextBatch,
128
+ request_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertTextBatchRequest.FromString,
129
+ response_serializer=cortexdb_dot_v1_dot_graphrag__pb2.InsertTextBatchResponse.SerializeToString,
130
+ ),
131
+ 'SearchText': grpc.unary_unary_rpc_method_handler(
132
+ servicer.SearchText,
133
+ request_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.SearchTextRequest.FromString,
134
+ response_serializer=cortexdb_dot_v1_dot_graphrag__pb2.SearchTextResponse.SerializeToString,
135
+ ),
136
+ 'HybridSearchText': grpc.unary_unary_rpc_method_handler(
137
+ servicer.HybridSearchText,
138
+ request_deserializer=cortexdb_dot_v1_dot_graphrag__pb2.HybridSearchTextRequest.FromString,
139
+ response_serializer=cortexdb_dot_v1_dot_graphrag__pb2.HybridSearchTextResponse.SerializeToString,
140
+ ),
141
+ }
142
+ generic_handler = grpc.method_handlers_generic_handler(
143
+ 'cortexdb.v1.GraphRagService', rpc_method_handlers)
144
+ server.add_generic_rpc_handlers((generic_handler,))
145
+ server.add_registered_method_handlers('cortexdb.v1.GraphRagService', rpc_method_handlers)
146
+
147
+
148
+ # This class is part of an EXPERIMENTAL API.
149
+ class GraphRagService:
150
+ """Missing associated documentation comment in .proto file."""
151
+
152
+ @staticmethod
153
+ def InsertGraphDocument(request,
154
+ target,
155
+ options=(),
156
+ channel_credentials=None,
157
+ call_credentials=None,
158
+ insecure=False,
159
+ compression=None,
160
+ wait_for_ready=None,
161
+ timeout=None,
162
+ metadata=None):
163
+ return grpc.experimental.unary_unary(
164
+ request,
165
+ target,
166
+ '/cortexdb.v1.GraphRagService/InsertGraphDocument',
167
+ cortexdb_dot_v1_dot_graphrag__pb2.InsertGraphDocumentRequest.SerializeToString,
168
+ cortexdb_dot_v1_dot_graphrag__pb2.InsertGraphDocumentResponse.FromString,
169
+ options,
170
+ channel_credentials,
171
+ insecure,
172
+ call_credentials,
173
+ compression,
174
+ wait_for_ready,
175
+ timeout,
176
+ metadata,
177
+ _registered_method=True)
178
+
179
+ @staticmethod
180
+ def SearchGraphRag(request,
181
+ target,
182
+ options=(),
183
+ channel_credentials=None,
184
+ call_credentials=None,
185
+ insecure=False,
186
+ compression=None,
187
+ wait_for_ready=None,
188
+ timeout=None,
189
+ metadata=None):
190
+ return grpc.experimental.unary_unary(
191
+ request,
192
+ target,
193
+ '/cortexdb.v1.GraphRagService/SearchGraphRag',
194
+ cortexdb_dot_v1_dot_graphrag__pb2.SearchGraphRagRequest.SerializeToString,
195
+ cortexdb_dot_v1_dot_graphrag__pb2.SearchGraphRagResponse.FromString,
196
+ options,
197
+ channel_credentials,
198
+ insecure,
199
+ call_credentials,
200
+ compression,
201
+ wait_for_ready,
202
+ timeout,
203
+ metadata,
204
+ _registered_method=True)
205
+
206
+ @staticmethod
207
+ def InsertText(request,
208
+ target,
209
+ options=(),
210
+ channel_credentials=None,
211
+ call_credentials=None,
212
+ insecure=False,
213
+ compression=None,
214
+ wait_for_ready=None,
215
+ timeout=None,
216
+ metadata=None):
217
+ return grpc.experimental.unary_unary(
218
+ request,
219
+ target,
220
+ '/cortexdb.v1.GraphRagService/InsertText',
221
+ cortexdb_dot_v1_dot_graphrag__pb2.InsertTextRequest.SerializeToString,
222
+ cortexdb_dot_v1_dot_graphrag__pb2.InsertTextResponse.FromString,
223
+ options,
224
+ channel_credentials,
225
+ insecure,
226
+ call_credentials,
227
+ compression,
228
+ wait_for_ready,
229
+ timeout,
230
+ metadata,
231
+ _registered_method=True)
232
+
233
+ @staticmethod
234
+ def InsertTextBatch(request,
235
+ target,
236
+ options=(),
237
+ channel_credentials=None,
238
+ call_credentials=None,
239
+ insecure=False,
240
+ compression=None,
241
+ wait_for_ready=None,
242
+ timeout=None,
243
+ metadata=None):
244
+ return grpc.experimental.unary_unary(
245
+ request,
246
+ target,
247
+ '/cortexdb.v1.GraphRagService/InsertTextBatch',
248
+ cortexdb_dot_v1_dot_graphrag__pb2.InsertTextBatchRequest.SerializeToString,
249
+ cortexdb_dot_v1_dot_graphrag__pb2.InsertTextBatchResponse.FromString,
250
+ options,
251
+ channel_credentials,
252
+ insecure,
253
+ call_credentials,
254
+ compression,
255
+ wait_for_ready,
256
+ timeout,
257
+ metadata,
258
+ _registered_method=True)
259
+
260
+ @staticmethod
261
+ def SearchText(request,
262
+ target,
263
+ options=(),
264
+ channel_credentials=None,
265
+ call_credentials=None,
266
+ insecure=False,
267
+ compression=None,
268
+ wait_for_ready=None,
269
+ timeout=None,
270
+ metadata=None):
271
+ return grpc.experimental.unary_unary(
272
+ request,
273
+ target,
274
+ '/cortexdb.v1.GraphRagService/SearchText',
275
+ cortexdb_dot_v1_dot_graphrag__pb2.SearchTextRequest.SerializeToString,
276
+ cortexdb_dot_v1_dot_graphrag__pb2.SearchTextResponse.FromString,
277
+ options,
278
+ channel_credentials,
279
+ insecure,
280
+ call_credentials,
281
+ compression,
282
+ wait_for_ready,
283
+ timeout,
284
+ metadata,
285
+ _registered_method=True)
286
+
287
+ @staticmethod
288
+ def HybridSearchText(request,
289
+ target,
290
+ options=(),
291
+ channel_credentials=None,
292
+ call_credentials=None,
293
+ insecure=False,
294
+ compression=None,
295
+ wait_for_ready=None,
296
+ timeout=None,
297
+ metadata=None):
298
+ return grpc.experimental.unary_unary(
299
+ request,
300
+ target,
301
+ '/cortexdb.v1.GraphRagService/HybridSearchText',
302
+ cortexdb_dot_v1_dot_graphrag__pb2.HybridSearchTextRequest.SerializeToString,
303
+ cortexdb_dot_v1_dot_graphrag__pb2.HybridSearchTextResponse.FromString,
304
+ options,
305
+ channel_credentials,
306
+ insecure,
307
+ call_credentials,
308
+ compression,
309
+ wait_for_ready,
310
+ timeout,
311
+ metadata,
312
+ _registered_method=True)
@@ -0,0 +1,77 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: cortexdb/v1/knowledge.proto
5
+ # Protobuf Python Version: 6.33.5
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 33,
16
+ 5,
17
+ '',
18
+ 'cortexdb/v1/knowledge.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
26
+ from cortexdb_client._pb.cortexdb.v1 import common_pb2 as cortexdb_dot_v1_dot_common__pb2
27
+
28
+
29
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x63ortexdb/v1/knowledge.proto\x12\x0b\x63ortexdb.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18\x63ortexdb/v1/common.proto\"\xe9\x02\n\x0fKnowledgeRecord\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\x12\x12\n\nsource_url\x18\x04 \x01(\t\x12\x0e\n\x06\x61uthor\x18\x05 \x01(\t\x12\x12\n\ncollection\x18\x06 \x01(\t\x12<\n\x08metadata\x18\x07 \x03(\x0b\x32*.cortexdb.v1.KnowledgeRecord.MetadataEntry\x12\x11\n\tchunk_ids\x18\x08 \x03(\t\x12\x10\n\x08\x65ntities\x18\t \x03(\t\x12.\n\ncreated_at\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x86\x03\n\x14SaveKnowledgeRequest\x12\x14\n\x0cknowledge_id\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\x12\x12\n\nsource_url\x18\x04 \x01(\t\x12\x0e\n\x06\x61uthor\x18\x05 \x01(\t\x12\x12\n\ncollection\x18\x06 \x01(\t\x12\x12\n\nchunk_size\x18\x07 \x01(\x05\x12\x15\n\rchunk_overlap\x18\x08 \x01(\x05\x12\x41\n\x08metadata\x18\t \x03(\x0b\x32/.cortexdb.v1.SaveKnowledgeRequest.MetadataEntry\x12.\n\x08\x65ntities\x18\n \x03(\x0b\x32\x1c.cortexdb.v1.ToolEntityInput\x12\x31\n\trelations\x18\x0b \x03(\x0b\x32\x1e.cortexdb.v1.ToolRelationInput\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x96\x01\n\x15SaveKnowledgeResponse\x12/\n\tknowledge\x18\x01 \x01(\x0b\x32\x1c.cortexdb.v1.KnowledgeRecord\x12\x18\n\x10\x64ocument_node_id\x18\x02 \x01(\t\x12\x17\n\x0f\x65ntity_node_ids\x18\x03 \x03(\t\x12\x19\n\x11relation_edge_ids\x18\x04 \x03(\t\"\x8d\x04\n\x16UpdateKnowledgeRequest\x12\x14\n\x0cknowledge_id\x18\x01 \x01(\t\x12\x12\n\x05title\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x63ontent\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nsource_url\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x61uthor\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x17\n\ncollection\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x17\n\nchunk_size\x18\x07 \x01(\x05H\x05\x88\x01\x01\x12\x1a\n\rchunk_overlap\x18\x08 \x01(\x05H\x06\x88\x01\x01\x12\x43\n\x08metadata\x18\t \x03(\x0b\x32\x31.cortexdb.v1.UpdateKnowledgeRequest.MetadataEntry\x12.\n\x08\x65ntities\x18\n \x03(\x0b\x32\x1c.cortexdb.v1.ToolEntityInput\x12\x31\n\trelations\x18\x0b \x03(\x0b\x32\x1e.cortexdb.v1.ToolRelationInput\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06_titleB\n\n\x08_contentB\r\n\x0b_source_urlB\t\n\x07_authorB\r\n\x0b_collectionB\r\n\x0b_chunk_sizeB\x10\n\x0e_chunk_overlap\"+\n\x13GetKnowledgeRequest\x12\x14\n\x0cknowledge_id\x18\x01 \x01(\t\"G\n\x14GetKnowledgeResponse\x12/\n\tknowledge\x18\x01 \x01(\x0b\x32\x1c.cortexdb.v1.KnowledgeRecord\".\n\x16\x44\x65leteKnowledgeRequest\x12\x14\n\x0cknowledge_id\x18\x01 \x01(\t\"@\n\x17\x44\x65leteKnowledgeResponse\x12\x14\n\x0cknowledge_id\x18\x01 \x01(\t\x12\x0f\n\x07\x64\x65leted\x18\x02 \x01(\x08\"\x96\x04\n\x16SearchKnowledgeRequest\x12\r\n\x05query\x18\x01 \x01(\t\x12\x12\n\ncollection\x18\x02 \x01(\t\x12\r\n\x05top_k\x18\x03 \x01(\x05\x12\x10\n\x08max_hops\x18\x04 \x01(\x05\x12\x1a\n\x12max_related_chunks\x18\x05 \x01(\x05\x12\x1a\n\x12max_context_chunks\x18\x06 \x01(\x05\x12\x19\n\x11max_context_chars\x18\x07 \x01(\x05\x12\x1a\n\x12per_document_limit\x18\x08 \x01(\x05\x12\x18\n\x10\x64iversity_lambda\x18\t \x01(\x01\x12\x16\n\x0e\x64isable_rerank\x18\n \x01(\x08\x12\x14\n\x0c\x65ntity_names\x18\x0b \x03(\t\x12\x10\n\x08keywords\x18\x0c \x03(\t\x12\x19\n\x11\x61lternate_queries\x18\r \x03(\t\x12\x16\n\x0eretrieval_mode\x18\x0e \x01(\t\x12\x15\n\rdisable_graph\x18\x0f \x01(\x08\x12\x13\n\x0bgraph_light\x18\x10 \x01(\x08\x12\x1b\n\x13max_expansion_seeds\x18\x11 \x01(\x05\x12\x1b\n\x13max_traversal_nodes\x18\x12 \x01(\x05\x12\x1e\n\x16max_entities_per_chunk\x18\x13 \x01(\x05\x12-\n\x04plan\x18\x14 \x01(\x0b\x32\x1a.cortexdb.v1.RetrievalPlanH\x00\x88\x01\x01\x42\x07\n\x05_plan\"\x94\x02\n\x12KnowledgeSearchHit\x12\x14\n\x0cknowledge_id\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x12\n\nsource_url\x18\x03 \x01(\t\x12\x0e\n\x06\x61uthor\x18\x04 \x01(\t\x12\x0f\n\x07snippet\x18\x05 \x01(\t\x12\r\n\x05score\x18\x06 \x01(\x01\x12\x11\n\tchunk_ids\x18\x07 \x03(\t\x12\x10\n\x08\x65ntities\x18\x08 \x03(\t\x12?\n\x08metadata\x18\t \x03(\x0b\x32-.cortexdb.v1.KnowledgeSearchHit.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8b\x02\n\x17SearchKnowledgeResponse\x12\r\n\x05query\x18\x01 \x01(\t\x12(\n\x04plan\x18\x02 \x01(\x0b\x32\x1a.cortexdb.v1.RetrievalPlan\x12\x30\n\x08\x64\x65\x63ision\x18\x03 \x01(\x0b\x32\x1e.cortexdb.v1.RetrievalDecision\x12\x30\n\x07results\x18\x04 \x03(\x0b\x32\x1f.cortexdb.v1.KnowledgeSearchHit\x12\x30\n\x06\x63hunks\x18\x05 \x03(\x0b\x32 .cortexdb.v1.GraphRagChunkResult\x12\x10\n\x08\x65ntities\x18\x06 \x03(\t\x12\x0f\n\x07\x63ontext\x18\x07 \x01(\t2\xd7\x03\n\x10KnowledgeService\x12V\n\rSaveKnowledge\x12!.cortexdb.v1.SaveKnowledgeRequest\x1a\".cortexdb.v1.SaveKnowledgeResponse\x12Z\n\x0fUpdateKnowledge\x12#.cortexdb.v1.UpdateKnowledgeRequest\x1a\".cortexdb.v1.SaveKnowledgeResponse\x12S\n\x0cGetKnowledge\x12 .cortexdb.v1.GetKnowledgeRequest\x1a!.cortexdb.v1.GetKnowledgeResponse\x12\\\n\x0fSearchKnowledge\x12#.cortexdb.v1.SearchKnowledgeRequest\x1a$.cortexdb.v1.SearchKnowledgeResponse\x12\\\n\x0f\x44\x65leteKnowledge\x12#.cortexdb.v1.DeleteKnowledgeRequest\x1a$.cortexdb.v1.DeleteKnowledgeResponseB4Z2github.com/liliang-cn/cortexdb/v2/pkg/rpc/v1;rpcv1b\x06proto3')
30
+
31
+ _globals = globals()
32
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
33
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cortexdb.v1.knowledge_pb2', _globals)
34
+ if not _descriptor._USE_C_DESCRIPTORS:
35
+ _globals['DESCRIPTOR']._loaded_options = None
36
+ _globals['DESCRIPTOR']._serialized_options = b'Z2github.com/liliang-cn/cortexdb/v2/pkg/rpc/v1;rpcv1'
37
+ _globals['_KNOWLEDGERECORD_METADATAENTRY']._loaded_options = None
38
+ _globals['_KNOWLEDGERECORD_METADATAENTRY']._serialized_options = b'8\001'
39
+ _globals['_SAVEKNOWLEDGEREQUEST_METADATAENTRY']._loaded_options = None
40
+ _globals['_SAVEKNOWLEDGEREQUEST_METADATAENTRY']._serialized_options = b'8\001'
41
+ _globals['_UPDATEKNOWLEDGEREQUEST_METADATAENTRY']._loaded_options = None
42
+ _globals['_UPDATEKNOWLEDGEREQUEST_METADATAENTRY']._serialized_options = b'8\001'
43
+ _globals['_KNOWLEDGESEARCHHIT_METADATAENTRY']._loaded_options = None
44
+ _globals['_KNOWLEDGESEARCHHIT_METADATAENTRY']._serialized_options = b'8\001'
45
+ _globals['_KNOWLEDGERECORD']._serialized_start=104
46
+ _globals['_KNOWLEDGERECORD']._serialized_end=465
47
+ _globals['_KNOWLEDGERECORD_METADATAENTRY']._serialized_start=418
48
+ _globals['_KNOWLEDGERECORD_METADATAENTRY']._serialized_end=465
49
+ _globals['_SAVEKNOWLEDGEREQUEST']._serialized_start=468
50
+ _globals['_SAVEKNOWLEDGEREQUEST']._serialized_end=858
51
+ _globals['_SAVEKNOWLEDGEREQUEST_METADATAENTRY']._serialized_start=418
52
+ _globals['_SAVEKNOWLEDGEREQUEST_METADATAENTRY']._serialized_end=465
53
+ _globals['_SAVEKNOWLEDGERESPONSE']._serialized_start=861
54
+ _globals['_SAVEKNOWLEDGERESPONSE']._serialized_end=1011
55
+ _globals['_UPDATEKNOWLEDGEREQUEST']._serialized_start=1014
56
+ _globals['_UPDATEKNOWLEDGEREQUEST']._serialized_end=1539
57
+ _globals['_UPDATEKNOWLEDGEREQUEST_METADATAENTRY']._serialized_start=418
58
+ _globals['_UPDATEKNOWLEDGEREQUEST_METADATAENTRY']._serialized_end=465
59
+ _globals['_GETKNOWLEDGEREQUEST']._serialized_start=1541
60
+ _globals['_GETKNOWLEDGEREQUEST']._serialized_end=1584
61
+ _globals['_GETKNOWLEDGERESPONSE']._serialized_start=1586
62
+ _globals['_GETKNOWLEDGERESPONSE']._serialized_end=1657
63
+ _globals['_DELETEKNOWLEDGEREQUEST']._serialized_start=1659
64
+ _globals['_DELETEKNOWLEDGEREQUEST']._serialized_end=1705
65
+ _globals['_DELETEKNOWLEDGERESPONSE']._serialized_start=1707
66
+ _globals['_DELETEKNOWLEDGERESPONSE']._serialized_end=1771
67
+ _globals['_SEARCHKNOWLEDGEREQUEST']._serialized_start=1774
68
+ _globals['_SEARCHKNOWLEDGEREQUEST']._serialized_end=2308
69
+ _globals['_KNOWLEDGESEARCHHIT']._serialized_start=2311
70
+ _globals['_KNOWLEDGESEARCHHIT']._serialized_end=2587
71
+ _globals['_KNOWLEDGESEARCHHIT_METADATAENTRY']._serialized_start=418
72
+ _globals['_KNOWLEDGESEARCHHIT_METADATAENTRY']._serialized_end=465
73
+ _globals['_SEARCHKNOWLEDGERESPONSE']._serialized_start=2590
74
+ _globals['_SEARCHKNOWLEDGERESPONSE']._serialized_end=2857
75
+ _globals['_KNOWLEDGESERVICE']._serialized_start=2860
76
+ _globals['_KNOWLEDGESERVICE']._serialized_end=3331
77
+ # @@protoc_insertion_point(module_scope)