diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bcdd13ce6..40a92b011 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,4 @@ -exclude: ^weaviate_grpc/ +exclude: ^proto/ repos: - repo: https://github.com/psf/black rev: 22.10.0 diff --git a/ci/docker-compose-azure.yml b/ci/docker-compose-azure.yml index 8f90d62ed..197188fc8 100644 --- a/ci/docker-compose-azure.yml +++ b/ci/docker-compose-azure.yml @@ -10,7 +10,7 @@ services: - --scheme - http - --write-timeout=600s - image: semitechnologies/weaviate:preview-nested-objects-4dc2c30 + image: semitechnologies/weaviate:preview-split-protos-into-v0-and-v1-packages-for-clear-api-break-b4b08ad ports: - 8081:8081 restart: on-failure:0 diff --git a/ci/docker-compose-cluster.yml b/ci/docker-compose-cluster.yml index 7394809f7..518676e4e 100644 --- a/ci/docker-compose-cluster.yml +++ b/ci/docker-compose-cluster.yml @@ -2,7 +2,7 @@ version: '3.4' services: weaviate-node-1: - image: semitechnologies/weaviate:preview-nested-objects-4dc2c30 + image: semitechnologies/weaviate:preview-split-protos-into-v0-and-v1-packages-for-clear-api-break-b4b08ad restart: on-failure:0 ports: - "8087:8080" @@ -25,7 +25,7 @@ services: - '8080' - --scheme - http - image: semitechnologies/weaviate:preview-nested-objects-4dc2c30 + image: semitechnologies/weaviate:preview-split-protos-into-v0-and-v1-packages-for-clear-api-break-b4b08ad ports: - 8088:8080 - 6061:6060 diff --git a/ci/docker-compose-okta-cc.yml b/ci/docker-compose-okta-cc.yml index 90f8bbb10..bc3274d79 100644 --- a/ci/docker-compose-okta-cc.yml +++ b/ci/docker-compose-okta-cc.yml @@ -10,7 +10,7 @@ services: - --scheme - http - --write-timeout=600s - image: semitechnologies/weaviate:preview-nested-objects-4dc2c30 + image: semitechnologies/weaviate:preview-split-protos-into-v0-and-v1-packages-for-clear-api-break-b4b08ad ports: - 8082:8082 restart: on-failure:0 diff --git a/ci/docker-compose-okta-users.yml b/ci/docker-compose-okta-users.yml index 60708b00f..bc533f7da 100644 --- a/ci/docker-compose-okta-users.yml +++ b/ci/docker-compose-okta-users.yml @@ -10,7 +10,7 @@ services: - --scheme - http - --write-timeout=600s - image: semitechnologies/weaviate:preview-nested-objects-4dc2c30 + image: semitechnologies/weaviate:preview-split-protos-into-v0-and-v1-packages-for-clear-api-break-b4b08ad ports: - 8083:8083 restart: on-failure:0 diff --git a/ci/docker-compose-openai.yml b/ci/docker-compose-openai.yml index 1600d0704..670d311b9 100644 --- a/ci/docker-compose-openai.yml +++ b/ci/docker-compose-openai.yml @@ -9,7 +9,7 @@ services: - '8086' - --scheme - http - image: semitechnologies/weaviate:preview-nested-objects-4dc2c30 + image: semitechnologies/weaviate:preview-split-protos-into-v0-and-v1-packages-for-clear-api-break-b4b08ad ports: - 8086:8086 restart: on-failure:0 diff --git a/ci/docker-compose-wcs.yml b/ci/docker-compose-wcs.yml index 247ee9b23..9cadd0394 100644 --- a/ci/docker-compose-wcs.yml +++ b/ci/docker-compose-wcs.yml @@ -10,7 +10,7 @@ services: - --scheme - http - --write-timeout=600s - image: semitechnologies/weaviate:preview-nested-objects-4dc2c30 + image: semitechnologies/weaviate:preview-split-protos-into-v0-and-v1-packages-for-clear-api-break-b4b08ad ports: - 8085:8085 restart: on-failure:0 diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index 0f24c0c6c..cf4a49e7a 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -10,7 +10,7 @@ services: - --scheme - http - --write-timeout=600s - image: semitechnologies/weaviate:preview-nested-objects-4dc2c30 + image: semitechnologies/weaviate:preview-split-protos-into-v0-and-v1-packages-for-clear-api-break-b4b08ad ports: - "8080:8080" - "50051:50051" diff --git a/integration/test_cluster.py b/integration/test_cluster.py index dc95c8554..7ce5f33d8 100644 --- a/integration/test_cluster.py +++ b/integration/test_cluster.py @@ -4,8 +4,8 @@ import weaviate -GIT_HASH = "4dc2c30" -SERVER_VERSION = "1.21.4" +GIT_HASH = "b4b08ad" +SERVER_VERSION = "1.21.6" NODE_NAME = "node1" NUM_OBJECT = 10 diff --git a/proto/__init__.py b/proto/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/proto/v1/__init__.py b/proto/v1/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/proto/v1/base_pb2.py b/proto/v1/base_pb2.py new file mode 100644 index 000000000..d348bae95 --- /dev/null +++ b/proto/v1/base_pb2.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: v1/base.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rv1/base.proto\x12\x0bweaviate.v1\":\n\x15NumberArrayProperties\x12\x0e\n\x06values\x18\x01 \x03(\x01\x12\x11\n\tprop_name\x18\x02 \x01(\t\"7\n\x12IntArrayProperties\x12\x0e\n\x06values\x18\x01 \x03(\x03\x12\x11\n\tprop_name\x18\x02 \x01(\t\"8\n\x13TextArrayProperties\x12\x0e\n\x06values\x18\x01 \x03(\t\x12\x11\n\tprop_name\x18\x02 \x01(\t\";\n\x16\x42ooleanArrayProperties\x12\x0e\n\x06values\x18\x01 \x03(\x08\x12\x11\n\tprop_name\x18\x02 \x01(\t*\x89\x01\n\x10\x43onsistencyLevel\x12!\n\x1d\x43ONSISTENCY_LEVEL_UNSPECIFIED\x10\x00\x12\x19\n\x15\x43ONSISTENCY_LEVEL_ONE\x10\x01\x12\x1c\n\x18\x43ONSISTENCY_LEVEL_QUORUM\x10\x02\x12\x19\n\x15\x43ONSISTENCY_LEVEL_ALL\x10\x03\x42g\n\x1cio.weaviate.grpc.protocol.v1B\x11WeaviateProtoBaseZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'v1.base_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\034io.weaviate.grpc.protocol.v1B\021WeaviateProtoBaseZ4github.com/weaviate/weaviate/grpc/generated;protocol' + _globals['_CONSISTENCYLEVEL']._serialized_start=267 + _globals['_CONSISTENCYLEVEL']._serialized_end=404 + _globals['_NUMBERARRAYPROPERTIES']._serialized_start=30 + _globals['_NUMBERARRAYPROPERTIES']._serialized_end=88 + _globals['_INTARRAYPROPERTIES']._serialized_start=90 + _globals['_INTARRAYPROPERTIES']._serialized_end=145 + _globals['_TEXTARRAYPROPERTIES']._serialized_start=147 + _globals['_TEXTARRAYPROPERTIES']._serialized_end=203 + _globals['_BOOLEANARRAYPROPERTIES']._serialized_start=205 + _globals['_BOOLEANARRAYPROPERTIES']._serialized_end=264 +# @@protoc_insertion_point(module_scope) diff --git a/weaviate_grpc/base_pb2.pyi b/proto/v1/base_pb2.pyi similarity index 100% rename from weaviate_grpc/base_pb2.pyi rename to proto/v1/base_pb2.pyi diff --git a/weaviate_grpc/base_pb2_grpc.py b/proto/v1/base_pb2_grpc.py similarity index 100% rename from weaviate_grpc/base_pb2_grpc.py rename to proto/v1/base_pb2_grpc.py diff --git a/proto/v1/batch_pb2.py b/proto/v1/batch_pb2.py new file mode 100644 index 000000000..087950328 --- /dev/null +++ b/proto/v1/batch_pb2.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: v1/batch.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 +from proto.v1 import base_pb2 as v1_dot_base__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0ev1/batch.proto\x12\x0bweaviate.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\rv1/base.proto\"\x95\x01\n\x13\x42\x61tchObjectsRequest\x12)\n\x07objects\x18\x01 \x03(\x0b\x32\x18.weaviate.v1.BatchObject\x12=\n\x11\x63onsistency_level\x18\x02 \x01(\x0e\x32\x1d.weaviate.v1.ConsistencyLevelH\x00\x88\x01\x01\x42\x14\n\x12_consistency_level\"\x84\x06\n\x0b\x42\x61tchObject\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0e\n\x06vector\x18\x02 \x03(\x02\x12\x37\n\nproperties\x18\x03 \x01(\x0b\x32#.weaviate.v1.BatchObject.Properties\x12\x12\n\ncollection\x18\x04 \x01(\t\x12\x0e\n\x06tenant\x18\x05 \x01(\t\x1a\xeb\x03\n\nProperties\x12\x33\n\x12non_ref_properties\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12N\n\x17single_target_ref_props\x18\x02 \x03(\x0b\x32-.weaviate.v1.BatchObject.SingleTargetRefProps\x12L\n\x16multi_target_ref_props\x18\x03 \x03(\x0b\x32,.weaviate.v1.BatchObject.MultiTargetRefProps\x12\x43\n\x17number_array_properties\x18\x04 \x03(\x0b\x32\".weaviate.v1.NumberArrayProperties\x12=\n\x14int_array_properties\x18\x05 \x03(\x0b\x32\x1f.weaviate.v1.IntArrayProperties\x12?\n\x15text_array_properties\x18\x06 \x03(\x0b\x32 .weaviate.v1.TextArrayProperties\x12\x45\n\x18\x62oolean_array_properties\x18\x07 \x03(\x0b\x32#.weaviate.v1.BooleanArrayProperties\x1a\x38\n\x14SingleTargetRefProps\x12\r\n\x05uuids\x18\x01 \x03(\t\x12\x11\n\tprop_name\x18\x02 \x01(\t\x1aR\n\x13MultiTargetRefProps\x12\r\n\x05uuids\x18\x01 \x03(\t\x12\x11\n\tprop_name\x18\x02 \x01(\t\x12\x19\n\x11target_collection\x18\x03 \x01(\t\"\x88\x01\n\x11\x42\x61tchObjectsReply\x12\x0c\n\x04took\x18\x01 \x01(\x02\x12\x39\n\x06\x65rrors\x18\x02 \x03(\x0b\x32).weaviate.v1.BatchObjectsReply.BatchError\x1a*\n\nBatchError\x12\r\n\x05index\x18\x01 \x01(\x05\x12\r\n\x05\x65rror\x18\x02 \x01(\tBh\n\x1cio.weaviate.grpc.protocol.v1B\x12WeaviateProtoBatchZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'v1.batch_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\034io.weaviate.grpc.protocol.v1B\022WeaviateProtoBatchZ4github.com/weaviate/weaviate/grpc/generated;protocol' + _globals['_BATCHOBJECTSREQUEST']._serialized_start=77 + _globals['_BATCHOBJECTSREQUEST']._serialized_end=226 + _globals['_BATCHOBJECT']._serialized_start=229 + _globals['_BATCHOBJECT']._serialized_end=1001 + _globals['_BATCHOBJECT_PROPERTIES']._serialized_start=368 + _globals['_BATCHOBJECT_PROPERTIES']._serialized_end=859 + _globals['_BATCHOBJECT_SINGLETARGETREFPROPS']._serialized_start=861 + _globals['_BATCHOBJECT_SINGLETARGETREFPROPS']._serialized_end=917 + _globals['_BATCHOBJECT_MULTITARGETREFPROPS']._serialized_start=919 + _globals['_BATCHOBJECT_MULTITARGETREFPROPS']._serialized_end=1001 + _globals['_BATCHOBJECTSREPLY']._serialized_start=1004 + _globals['_BATCHOBJECTSREPLY']._serialized_end=1140 + _globals['_BATCHOBJECTSREPLY_BATCHERROR']._serialized_start=1098 + _globals['_BATCHOBJECTSREPLY_BATCHERROR']._serialized_end=1140 +# @@protoc_insertion_point(module_scope) diff --git a/weaviate_grpc/batch_pb2.pyi b/proto/v1/batch_pb2.pyi similarity index 99% rename from weaviate_grpc/batch_pb2.pyi rename to proto/v1/batch_pb2.pyi index a40e0ca6f..3c4e8e308 100644 --- a/weaviate_grpc/batch_pb2.pyi +++ b/proto/v1/batch_pb2.pyi @@ -1,5 +1,5 @@ -import base_pb2 as _base_pb2 from google.protobuf import struct_pb2 as _struct_pb2 +from v1 import base_pb2 as _base_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/weaviate_grpc/batch_pb2_grpc.py b/proto/v1/batch_pb2_grpc.py similarity index 100% rename from weaviate_grpc/batch_pb2_grpc.py rename to proto/v1/batch_pb2_grpc.py diff --git a/proto/v1/regen.sh b/proto/v1/regen.sh new file mode 100755 index 000000000..61abcd569 --- /dev/null +++ b/proto/v1/regen.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "this script assumes that you have checked out weaviate next to the client" +cd "${0%/*}/.." + + +python3 -m grpc_tools.protoc -I ../../weaviate/grpc/proto --python_out=./ --pyi_out=./ --grpc_python_out=./ ../../weaviate/grpc/proto/v1/*.proto + + +sed -i '' 's/from v1/from proto.v1/g' v1/*.py + +echo "done" + diff --git a/proto/v1/search_get_pb2.py b/proto/v1/search_get_pb2.py new file mode 100644 index 000000000..6d7c3886a --- /dev/null +++ b/proto/v1/search_get_pb2.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: v1/search_get.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 +from proto.v1 import base_pb2 as v1_dot_base__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13v1/search_get.proto\x12\x0bweaviate.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\rv1/base.proto\"\xcb\x08\n\rSearchRequest\x12\x12\n\ncollection\x18\x01 \x01(\t\x12\x0e\n\x06tenant\x18\n \x01(\t\x12=\n\x11\x63onsistency_level\x18\x0b \x01(\x0e\x32\x1d.weaviate.v1.ConsistencyLevelH\x00\x88\x01\x01\x12\x37\n\nproperties\x18\x14 \x01(\x0b\x32\x1e.weaviate.v1.PropertiesRequestH\x01\x88\x01\x01\x12\x33\n\x08metadata\x18\x15 \x01(\x0b\x32\x1c.weaviate.v1.MetadataRequestH\x02\x88\x01\x01\x12+\n\x08group_by\x18\x16 \x01(\x0b\x32\x14.weaviate.v1.GroupByH\x03\x88\x01\x01\x12\r\n\x05limit\x18\x1e \x01(\r\x12\x0e\n\x06offset\x18\x1f \x01(\r\x12\x0f\n\x07\x61utocut\x18 \x01(\r\x12\r\n\x05\x61\x66ter\x18! \x01(\t\x12$\n\x07sort_by\x18\" \x03(\x0b\x32\x13.weaviate.v1.SortBy\x12*\n\x07\x66ilters\x18( \x01(\x0b\x32\x14.weaviate.v1.FiltersH\x04\x88\x01\x01\x12/\n\rhybrid_search\x18) \x01(\x0b\x32\x13.weaviate.v1.HybridH\x05\x88\x01\x01\x12+\n\x0b\x62m25_search\x18* \x01(\x0b\x32\x11.weaviate.v1.BM25H\x06\x88\x01\x01\x12\x31\n\x0bnear_vector\x18+ \x01(\x0b\x32\x17.weaviate.v1.NearVectorH\x07\x88\x01\x01\x12\x31\n\x0bnear_object\x18, \x01(\x0b\x32\x17.weaviate.v1.NearObjectH\x08\x88\x01\x01\x12\x33\n\tnear_text\x18- \x01(\x0b\x32\x1b.weaviate.v1.NearTextSearchH\t\x88\x01\x01\x12\x35\n\nnear_image\x18. \x01(\x0b\x32\x1c.weaviate.v1.NearImageSearchH\n\x88\x01\x01\x12\x35\n\nnear_audio\x18/ \x01(\x0b\x32\x1c.weaviate.v1.NearAudioSearchH\x0b\x88\x01\x01\x12\x35\n\nnear_video\x18\x30 \x01(\x0b\x32\x1c.weaviate.v1.NearVideoSearchH\x0c\x88\x01\x01\x12\x36\n\ngenerative\x18< \x01(\x0b\x32\x1d.weaviate.v1.GenerativeSearchH\r\x88\x01\x01\x42\x14\n\x12_consistency_levelB\r\n\x0b_propertiesB\x0b\n\t_metadataB\x0b\n\t_group_byB\n\n\x08_filtersB\x10\n\x0e_hybrid_searchB\x0e\n\x0c_bm25_searchB\x0e\n\x0c_near_vectorB\x0e\n\x0c_near_objectB\x0c\n\n_near_textB\r\n\x0b_near_imageB\r\n\x0b_near_audioB\r\n\x0b_near_videoB\r\n\x0b_generative\"L\n\x07GroupBy\x12\x0c\n\x04path\x18\x01 \x03(\t\x12\x18\n\x10number_of_groups\x18\x02 \x01(\x05\x12\x19\n\x11objects_per_group\x18\x03 \x01(\x05\")\n\x06SortBy\x12\x11\n\tascending\x18\x01 \x01(\x08\x12\x0c\n\x04path\x18\x02 \x03(\t\"m\n\x10GenerativeSearch\x12\x1e\n\x16single_response_prompt\x18\x01 \x01(\t\x12\x1d\n\x15grouped_response_task\x18\x02 \x01(\t\x12\x1a\n\x12grouped_properties\x18\x03 \x03(\t\"\x1b\n\tTextArray\x12\x0e\n\x06values\x18\x01 \x03(\t\"\x1a\n\x08IntArray\x12\x0e\n\x06values\x18\x01 \x03(\x03\"\x1d\n\x0bNumberArray\x12\x0e\n\x06values\x18\x01 \x03(\x01\"\x1e\n\x0c\x42ooleanArray\x12\x0e\n\x06values\x18\x01 \x03(\x08\"\x95\x06\n\x07\x46ilters\x12/\n\x08operator\x18\x01 \x01(\x0e\x32\x1d.weaviate.v1.Filters.Operator\x12\n\n\x02on\x18\x02 \x03(\t\x12%\n\x07\x66ilters\x18\x03 \x03(\x0b\x32\x14.weaviate.v1.Filters\x12\x14\n\nvalue_text\x18\x04 \x01(\tH\x00\x12\x13\n\tvalue_int\x18\x05 \x01(\x03H\x00\x12\x17\n\rvalue_boolean\x18\x06 \x01(\x08H\x00\x12\x16\n\x0cvalue_number\x18\x07 \x01(\x02H\x00\x12\x32\n\x10value_text_array\x18\t \x01(\x0b\x32\x16.weaviate.v1.TextArrayH\x00\x12\x30\n\x0fvalue_int_array\x18\n \x01(\x0b\x32\x15.weaviate.v1.IntArrayH\x00\x12\x38\n\x13value_boolean_array\x18\x0b \x01(\x0b\x32\x19.weaviate.v1.BooleanArrayH\x00\x12\x36\n\x12value_number_array\x18\x0c \x01(\x0b\x32\x18.weaviate.v1.NumberArrayH\x00\"\xe3\x02\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x12\n\x0eOPERATOR_EQUAL\x10\x01\x12\x16\n\x12OPERATOR_NOT_EQUAL\x10\x02\x12\x19\n\x15OPERATOR_GREATER_THAN\x10\x03\x12\x1f\n\x1bOPERATOR_GREATER_THAN_EQUAL\x10\x04\x12\x16\n\x12OPERATOR_LESS_THAN\x10\x05\x12\x1c\n\x18OPERATOR_LESS_THAN_EQUAL\x10\x06\x12\x10\n\x0cOPERATOR_AND\x10\x07\x12\x0f\n\x0bOPERATOR_OR\x10\x08\x12\x1d\n\x19OPERATOR_WITHIN_GEO_RANGE\x10\t\x12\x11\n\rOPERATOR_LIKE\x10\n\x12\x14\n\x10OPERATOR_IS_NULL\x10\x0b\x12\x19\n\x15OPERATOR_CONTAINS_ANY\x10\x0c\x12\x19\n\x15OPERATOR_CONTAINS_ALL\x10\rB\x0c\n\ntest_value\"\xcc\x01\n\x0fMetadataRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\x08\x12\x0e\n\x06vector\x18\x02 \x01(\x08\x12\x1a\n\x12\x63reation_time_unix\x18\x03 \x01(\x08\x12\x1d\n\x15last_update_time_unix\x18\x04 \x01(\x08\x12\x10\n\x08\x64istance\x18\x05 \x01(\x08\x12\x11\n\tcertainty\x18\x06 \x01(\x08\x12\r\n\x05score\x18\x07 \x01(\x08\x12\x15\n\rexplain_score\x18\x08 \x01(\x08\x12\x15\n\ris_consistent\x18\t \x01(\x08\"j\n\x11PropertiesRequest\x12\x1a\n\x12non_ref_properties\x18\x01 \x03(\t\x12\x39\n\x0eref_properties\x18\x02 \x03(\x0b\x32!.weaviate.v1.RefPropertiesRequest\"\xe2\x01\n\x06Hybrid\x12\r\n\x05query\x18\x01 \x01(\t\x12\x12\n\nproperties\x18\x02 \x03(\t\x12\x0e\n\x06vector\x18\x03 \x03(\x02\x12\r\n\x05\x61lpha\x18\x04 \x01(\x02\x12\x33\n\x0b\x66usion_type\x18\x05 \x01(\x0e\x32\x1e.weaviate.v1.Hybrid.FusionType\"a\n\nFusionType\x12\x1b\n\x17\x46USION_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x46USION_TYPE_RANKED\x10\x01\x12\x1e\n\x1a\x46USION_TYPE_RELATIVE_SCORE\x10\x02\"\xad\x02\n\x0eNearTextSearch\x12\r\n\x05query\x18\x01 \x03(\t\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x12\x36\n\x07move_to\x18\x04 \x01(\x0b\x32 .weaviate.v1.NearTextSearch.MoveH\x02\x88\x01\x01\x12\x38\n\tmove_away\x18\x05 \x01(\x0b\x32 .weaviate.v1.NearTextSearch.MoveH\x03\x88\x01\x01\x1a\x36\n\x04Move\x12\r\n\x05\x66orce\x18\x01 \x01(\x02\x12\x10\n\x08\x63oncepts\x18\x02 \x03(\t\x12\r\n\x05uuids\x18\x03 \x03(\tB\x0c\n\n_certaintyB\x0b\n\t_distanceB\n\n\x08_move_toB\x0c\n\n_move_away\"j\n\x0fNearImageSearch\x12\r\n\x05image\x18\x01 \x01(\t\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x0c\n\n_certaintyB\x0b\n\t_distance\"j\n\x0fNearAudioSearch\x12\r\n\x05\x61udio\x18\x01 \x01(\t\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x0c\n\n_certaintyB\x0b\n\t_distance\"j\n\x0fNearVideoSearch\x12\r\n\x05video\x18\x01 \x01(\t\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x0c\n\n_certaintyB\x0b\n\t_distance\")\n\x04\x42M25\x12\r\n\x05query\x18\x01 \x01(\t\x12\x12\n\nproperties\x18\x02 \x03(\t\"\xb1\x01\n\x14RefPropertiesRequest\x12\x1a\n\x12reference_property\x18\x01 \x01(\t\x12\x32\n\nproperties\x18\x02 \x01(\x0b\x32\x1e.weaviate.v1.PropertiesRequest\x12.\n\x08metadata\x18\x03 \x01(\x0b\x32\x1c.weaviate.v1.MetadataRequest\x12\x19\n\x11target_collection\x18\x04 \x01(\t\"f\n\nNearVector\x12\x0e\n\x06vector\x18\x01 \x03(\x02\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x0c\n\n_certaintyB\x0b\n\t_distance\"b\n\nNearObject\x12\n\n\x02id\x18\x01 \x01(\t\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x0c\n\n_certaintyB\x0b\n\t_distance\"\xc3\x01\n\x0bSearchReply\x12\x0c\n\x04took\x18\x01 \x01(\x02\x12*\n\x07results\x18\x02 \x03(\x0b\x32\x19.weaviate.v1.SearchResult\x12&\n\x19generative_grouped_result\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x34\n\x10group_by_results\x18\x04 \x03(\x0b\x32\x1a.weaviate.v1.GroupByResultB\x1c\n\x1a_generative_grouped_result\"\x90\x01\n\rGroupByResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0cmin_distance\x18\x02 \x01(\x02\x12\x14\n\x0cmax_distance\x18\x03 \x01(\x02\x12\x19\n\x11number_of_objects\x18\x04 \x01(\x03\x12*\n\x07objects\x18\x05 \x03(\x0b\x32\x19.weaviate.v1.SearchResult\"p\n\x0cSearchResult\x12\x31\n\nproperties\x18\x01 \x01(\x0b\x32\x1d.weaviate.v1.PropertiesResult\x12-\n\x08metadata\x18\x02 \x01(\x0b\x32\x1b.weaviate.v1.MetadataResult\"\xc6\x03\n\x0eMetadataResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06vector\x18\x02 \x03(\x02\x12\x1a\n\x12\x63reation_time_unix\x18\x03 \x01(\x03\x12\"\n\x1a\x63reation_time_unix_present\x18\x04 \x01(\x08\x12\x1d\n\x15last_update_time_unix\x18\x05 \x01(\x03\x12%\n\x1dlast_update_time_unix_present\x18\x06 \x01(\x08\x12\x10\n\x08\x64istance\x18\x07 \x01(\x02\x12\x18\n\x10\x64istance_present\x18\x08 \x01(\x08\x12\x11\n\tcertainty\x18\t \x01(\x02\x12\x19\n\x11\x63\x65rtainty_present\x18\n \x01(\x08\x12\r\n\x05score\x18\x0b \x01(\x02\x12\x15\n\rscore_present\x18\x0c \x01(\x08\x12\x15\n\rexplain_score\x18\r \x01(\t\x12\x1d\n\x15\x65xplain_score_present\x18\x0e \x01(\x08\x12\x1a\n\ris_consistent\x18\x0f \x01(\x08H\x00\x88\x01\x01\x12\x12\n\ngenerative\x18\x10 \x01(\t\x12\x1a\n\x12generative_present\x18\x11 \x01(\x08\x42\x10\n\x0e_is_consistent\"\xd2\x03\n\x10PropertiesResult\x12\x33\n\x12non_ref_properties\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x33\n\tref_props\x18\x02 \x03(\x0b\x32 .weaviate.v1.RefPropertiesResult\x12\x19\n\x11target_collection\x18\x03 \x01(\t\x12-\n\x08metadata\x18\x04 \x01(\x0b\x32\x1b.weaviate.v1.MetadataResult\x12\x43\n\x17number_array_properties\x18\x05 \x03(\x0b\x32\".weaviate.v1.NumberArrayProperties\x12=\n\x14int_array_properties\x18\x06 \x03(\x0b\x32\x1f.weaviate.v1.IntArrayProperties\x12?\n\x15text_array_properties\x18\x07 \x03(\x0b\x32 .weaviate.v1.TextArrayProperties\x12\x45\n\x18\x62oolean_array_properties\x18\x08 \x03(\x0b\x32#.weaviate.v1.BooleanArrayProperties\"[\n\x13RefPropertiesResult\x12\x31\n\nproperties\x18\x01 \x03(\x0b\x32\x1d.weaviate.v1.PropertiesResult\x12\x11\n\tprop_name\x18\x02 \x01(\tBl\n\x1cio.weaviate.grpc.protocol.v1B\x16WeaviateProtoSearchGetZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'v1.search_get_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\034io.weaviate.grpc.protocol.v1B\026WeaviateProtoSearchGetZ4github.com/weaviate/weaviate/grpc/generated;protocol' + _globals['_SEARCHREQUEST']._serialized_start=82 + _globals['_SEARCHREQUEST']._serialized_end=1181 + _globals['_GROUPBY']._serialized_start=1183 + _globals['_GROUPBY']._serialized_end=1259 + _globals['_SORTBY']._serialized_start=1261 + _globals['_SORTBY']._serialized_end=1302 + _globals['_GENERATIVESEARCH']._serialized_start=1304 + _globals['_GENERATIVESEARCH']._serialized_end=1413 + _globals['_TEXTARRAY']._serialized_start=1415 + _globals['_TEXTARRAY']._serialized_end=1442 + _globals['_INTARRAY']._serialized_start=1444 + _globals['_INTARRAY']._serialized_end=1470 + _globals['_NUMBERARRAY']._serialized_start=1472 + _globals['_NUMBERARRAY']._serialized_end=1501 + _globals['_BOOLEANARRAY']._serialized_start=1503 + _globals['_BOOLEANARRAY']._serialized_end=1533 + _globals['_FILTERS']._serialized_start=1536 + _globals['_FILTERS']._serialized_end=2325 + _globals['_FILTERS_OPERATOR']._serialized_start=1956 + _globals['_FILTERS_OPERATOR']._serialized_end=2311 + _globals['_METADATAREQUEST']._serialized_start=2328 + _globals['_METADATAREQUEST']._serialized_end=2532 + _globals['_PROPERTIESREQUEST']._serialized_start=2534 + _globals['_PROPERTIESREQUEST']._serialized_end=2640 + _globals['_HYBRID']._serialized_start=2643 + _globals['_HYBRID']._serialized_end=2869 + _globals['_HYBRID_FUSIONTYPE']._serialized_start=2772 + _globals['_HYBRID_FUSIONTYPE']._serialized_end=2869 + _globals['_NEARTEXTSEARCH']._serialized_start=2872 + _globals['_NEARTEXTSEARCH']._serialized_end=3173 + _globals['_NEARTEXTSEARCH_MOVE']._serialized_start=3066 + _globals['_NEARTEXTSEARCH_MOVE']._serialized_end=3120 + _globals['_NEARIMAGESEARCH']._serialized_start=3175 + _globals['_NEARIMAGESEARCH']._serialized_end=3281 + _globals['_NEARAUDIOSEARCH']._serialized_start=3283 + _globals['_NEARAUDIOSEARCH']._serialized_end=3389 + _globals['_NEARVIDEOSEARCH']._serialized_start=3391 + _globals['_NEARVIDEOSEARCH']._serialized_end=3497 + _globals['_BM25']._serialized_start=3499 + _globals['_BM25']._serialized_end=3540 + _globals['_REFPROPERTIESREQUEST']._serialized_start=3543 + _globals['_REFPROPERTIESREQUEST']._serialized_end=3720 + _globals['_NEARVECTOR']._serialized_start=3722 + _globals['_NEARVECTOR']._serialized_end=3824 + _globals['_NEAROBJECT']._serialized_start=3826 + _globals['_NEAROBJECT']._serialized_end=3924 + _globals['_SEARCHREPLY']._serialized_start=3927 + _globals['_SEARCHREPLY']._serialized_end=4122 + _globals['_GROUPBYRESULT']._serialized_start=4125 + _globals['_GROUPBYRESULT']._serialized_end=4269 + _globals['_SEARCHRESULT']._serialized_start=4271 + _globals['_SEARCHRESULT']._serialized_end=4383 + _globals['_METADATARESULT']._serialized_start=4386 + _globals['_METADATARESULT']._serialized_end=4840 + _globals['_PROPERTIESRESULT']._serialized_start=4843 + _globals['_PROPERTIESRESULT']._serialized_end=5309 + _globals['_REFPROPERTIESRESULT']._serialized_start=5311 + _globals['_REFPROPERTIESRESULT']._serialized_end=5402 +# @@protoc_insertion_point(module_scope) diff --git a/weaviate_grpc/search_get_v1_pb2.pyi b/proto/v1/search_get_pb2.pyi similarity index 99% rename from weaviate_grpc/search_get_v1_pb2.pyi rename to proto/v1/search_get_pb2.pyi index a7520fa59..5ef9c5a90 100644 --- a/weaviate_grpc/search_get_v1_pb2.pyi +++ b/proto/v1/search_get_pb2.pyi @@ -1,5 +1,5 @@ -import base_pb2 as _base_pb2 from google.protobuf import struct_pb2 as _struct_pb2 +from v1 import base_pb2 as _base_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor @@ -8,7 +8,7 @@ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Map DESCRIPTOR: _descriptor.FileDescriptor -class SearchRequestV1(_message.Message): +class SearchRequest(_message.Message): __slots__ = ["collection", "tenant", "consistency_level", "properties", "metadata", "group_by", "limit", "offset", "autocut", "after", "sort_by", "filters", "hybrid_search", "bm25_search", "near_vector", "near_object", "near_text", "near_image", "near_audio", "near_video", "generative"] COLLECTION_FIELD_NUMBER: _ClassVar[int] TENANT_FIELD_NUMBER: _ClassVar[int] @@ -307,7 +307,7 @@ class NearObject(_message.Message): distance: float def __init__(self, id: _Optional[str] = ..., certainty: _Optional[float] = ..., distance: _Optional[float] = ...) -> None: ... -class SearchReplyV1(_message.Message): +class SearchReply(_message.Message): __slots__ = ["took", "results", "generative_grouped_result", "group_by_results"] TOOK_FIELD_NUMBER: _ClassVar[int] RESULTS_FIELD_NUMBER: _ClassVar[int] diff --git a/weaviate_grpc/search_get_pb2_grpc.py b/proto/v1/search_get_pb2_grpc.py similarity index 100% rename from weaviate_grpc/search_get_pb2_grpc.py rename to proto/v1/search_get_pb2_grpc.py diff --git a/proto/v1/weaviate_pb2.py b/proto/v1/weaviate_pb2.py new file mode 100644 index 000000000..a043d03b0 --- /dev/null +++ b/proto/v1/weaviate_pb2.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: v1/weaviate.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from proto.v1 import batch_pb2 as v1_dot_batch__pb2 +from proto.v1 import search_get_pb2 as v1_dot_search__get__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11v1/weaviate.proto\x12\x0bweaviate.v1\x1a\x0ev1/batch.proto\x1a\x13v1/search_get.proto2\xa0\x01\n\x08Weaviate\x12@\n\x06Search\x12\x1a.weaviate.v1.SearchRequest\x1a\x18.weaviate.v1.SearchReply\"\x00\x12R\n\x0c\x42\x61tchObjects\x12 .weaviate.v1.BatchObjectsRequest\x1a\x1e.weaviate.v1.BatchObjectsReply\"\x00\x42\x63\n\x1cio.weaviate.grpc.protocol.v1B\rWeaviateProtoZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'v1.weaviate_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\034io.weaviate.grpc.protocol.v1B\rWeaviateProtoZ4github.com/weaviate/weaviate/grpc/generated;protocol' + _globals['_WEAVIATE']._serialized_start=72 + _globals['_WEAVIATE']._serialized_end=232 +# @@protoc_insertion_point(module_scope) diff --git a/weaviate_grpc/weaviate_pb2.pyi b/proto/v1/weaviate_pb2.pyi similarity index 53% rename from weaviate_grpc/weaviate_pb2.pyi rename to proto/v1/weaviate_pb2.pyi index b4e43d708..cda70c79e 100644 --- a/weaviate_grpc/weaviate_pb2.pyi +++ b/proto/v1/weaviate_pb2.pyi @@ -1,6 +1,5 @@ -import batch_pb2 as _batch_pb2 -import search_get_pb2 as _search_get_pb2 -import search_get_v1_pb2 as _search_get_v1_pb2 +from v1 import batch_pb2 as _batch_pb2 +from v1 import search_get_pb2 as _search_get_pb2 from google.protobuf import descriptor as _descriptor from typing import ClassVar as _ClassVar diff --git a/proto/v1/weaviate_pb2_grpc.py b/proto/v1/weaviate_pb2_grpc.py new file mode 100644 index 000000000..194633525 --- /dev/null +++ b/proto/v1/weaviate_pb2_grpc.py @@ -0,0 +1,100 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from proto.v1 import batch_pb2 as v1_dot_batch__pb2 +from proto.v1 import search_get_pb2 as v1_dot_search__get__pb2 + + +class WeaviateStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Search = channel.unary_unary( + '/weaviate.v1.Weaviate/Search', + request_serializer=v1_dot_search__get__pb2.SearchRequest.SerializeToString, + response_deserializer=v1_dot_search__get__pb2.SearchReply.FromString, + ) + self.BatchObjects = channel.unary_unary( + '/weaviate.v1.Weaviate/BatchObjects', + request_serializer=v1_dot_batch__pb2.BatchObjectsRequest.SerializeToString, + response_deserializer=v1_dot_batch__pb2.BatchObjectsReply.FromString, + ) + + +class WeaviateServicer(object): + """Missing associated documentation comment in .proto file.""" + + def Search(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchObjects(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_WeaviateServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Search': grpc.unary_unary_rpc_method_handler( + servicer.Search, + request_deserializer=v1_dot_search__get__pb2.SearchRequest.FromString, + response_serializer=v1_dot_search__get__pb2.SearchReply.SerializeToString, + ), + 'BatchObjects': grpc.unary_unary_rpc_method_handler( + servicer.BatchObjects, + request_deserializer=v1_dot_batch__pb2.BatchObjectsRequest.FromString, + response_serializer=v1_dot_batch__pb2.BatchObjectsReply.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'weaviate.v1.Weaviate', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class Weaviate(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def Search(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/weaviate.v1.Weaviate/Search', + v1_dot_search__get__pb2.SearchRequest.SerializeToString, + v1_dot_search__get__pb2.SearchReply.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def BatchObjects(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/weaviate.v1.Weaviate/BatchObjects', + v1_dot_batch__pb2.BatchObjectsRequest.SerializeToString, + v1_dot_batch__pb2.BatchObjectsReply.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/pyproject.toml b/pyproject.toml index dbefdd539..5f81a6efd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ exclude = ''' | build | dist | docs - | weaviate_grpc + | proto )/ ''' @@ -32,8 +32,8 @@ show_error_codes = true no_implicit_optional = true warn_return_any = true warn_unused_ignores = true -exclude = ["weaviate_grpc", "docs", "mock_tests", "test", "integration"] +exclude = ["proto", "docs", "mock_tests", "test", "integration"] [[tool.mypy.overrides]] -module = "weaviate_grpc.*" +module = "proto.v1.*" ignore_errors = true \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 9bf62e72d..2bc3700f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,8 @@ packages = weaviate.data.replication weaviate.gql weaviate.cluster - weaviate_grpc + proto + proto.v1 platforms = any include_package_data = True diff --git a/weaviate/connect/connection.py b/weaviate/connect/connection.py index a910d79d4..8962f9bb1 100644 --- a/weaviate/connect/connection.py +++ b/weaviate/connect/connection.py @@ -41,7 +41,7 @@ try: import grpc # type: ignore - from weaviate_grpc import weaviate_pb2_grpc + from proto.v1 import weaviate_pb2_grpc has_grpc = True diff --git a/weaviate/gql/get.py b/weaviate/gql/get.py index 87330d981..b2bcf090a 100644 --- a/weaviate/gql/get.py +++ b/weaviate/gql/get.py @@ -38,7 +38,7 @@ from weaviate.warnings import _Warnings try: - from weaviate_grpc import search_get_v1_pb2 + from proto.v1 import search_get_pb2 import grpc # type: ignore except ImportError: pass @@ -1837,11 +1837,11 @@ def do(self) -> dict: metadata = (("authorization", access_token),) try: - res, _ = self._connection.grpc_stub.SearchV1.with_call( # type: ignore - search_get_v1_pb2.SearchRequestV1( + res, _ = self._connection.grpc_stub.Search.with_call( # type: ignore + search_get_pb2.SearchRequest( collection=self._class_name, limit=self._limit, - near_vector=search_get_v1_pb2.NearVector( + near_vector=search_get_pb2.NearVector( vector=self._near_clause.content["vector"], certainty=self._near_clause.content.get("certainty", None), distance=self._near_clause.content.get("distance", None), @@ -1849,7 +1849,7 @@ def do(self) -> dict: if self._near_clause is not None and isinstance(self._near_clause, NearVector) else None, - near_object=search_get_v1_pb2.NearObject( + near_object=search_get_pb2.NearObject( id=self._near_clause.content["id"], certainty=self._near_clause.content.get("certainty", None), distance=self._near_clause.content.get("distance", None), @@ -1858,7 +1858,7 @@ def do(self) -> dict: and isinstance(self._near_clause, NearObject) else None, properties=self._convert_references_to_grpc(self._properties), - metadata=search_get_v1_pb2.MetadataRequest( + metadata=search_get_pb2.MetadataRequest( uuid=self._additional_dataclass.uuid, vector=self._additional_dataclass.vector, creation_time_unix=self._additional_dataclass.creationTimeUnix, @@ -1869,12 +1869,12 @@ def do(self) -> dict: ) if self._additional_dataclass is not None else None, - bm25_search=search_get_v1_pb2.BM25( + bm25_search=search_get_pb2.BM25( properties=self._bm25.properties, query=self._bm25.query ) if self._bm25 is not None else None, - hybrid_search=search_get_v1_pb2.Hybrid( + hybrid_search=search_get_pb2.Hybrid( properties=self._hybrid.properties, query=self._hybrid.query, alpha=self._hybrid.alpha, @@ -1905,7 +1905,7 @@ def do(self) -> dict: return super().do() def _extract_additional_properties( - self, props: "search_get_v1_pb2.MetadataResult" + self, props: "search_get_pb2.MetadataResult" ) -> Dict[str, str]: additional_props: Dict[str, Any] = {} if self._additional_dataclass is None: @@ -1938,7 +1938,7 @@ def _extract_additional_properties( return additional_props def _convert_references_to_grpc_result( - self, properties: "search_get_v1_pb2.PropertiesResult" + self, properties: "search_get_pb2.PropertiesResult" ) -> Dict: result: Dict[str, Any] = {} for name, non_ref_prop in properties.non_ref_properties.items(): @@ -1953,11 +1953,11 @@ def _convert_references_to_grpc_result( def _convert_references_to_grpc( self, properties: List[Union[LinkTo, str]] - ) -> "search_get_v1_pb2.PropertiesRequest": - return search_get_v1_pb2.PropertiesRequest( + ) -> "search_get_pb2.PropertiesRequest": + return search_get_pb2.PropertiesRequest( non_ref_properties=[prop for prop in properties if isinstance(prop, str)], ref_properties=[ - search_get_v1_pb2.RefPropertiesRequest( + search_get_pb2.RefPropertiesRequest( target_collection=prop.linked_class, reference_property=prop.link_on, properties=self._convert_references_to_grpc(prop.properties), diff --git a/weaviate_grpc/base_pb2.py b/weaviate_grpc/base_pb2.py deleted file mode 100644 index 595975603..000000000 --- a/weaviate_grpc/base_pb2.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: base.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nbase.proto\x12\x0cweaviategrpc\":\n\x15NumberArrayProperties\x12\x0e\n\x06values\x18\x01 \x03(\x01\x12\x11\n\tprop_name\x18\x02 \x01(\t\"7\n\x12IntArrayProperties\x12\x0e\n\x06values\x18\x01 \x03(\x03\x12\x11\n\tprop_name\x18\x02 \x01(\t\"8\n\x13TextArrayProperties\x12\x0e\n\x06values\x18\x01 \x03(\t\x12\x11\n\tprop_name\x18\x02 \x01(\t\";\n\x16\x42ooleanArrayProperties\x12\x0e\n\x06values\x18\x01 \x03(\x08\x12\x11\n\tprop_name\x18\x02 \x01(\t*\x89\x01\n\x10\x43onsistencyLevel\x12!\n\x1d\x43ONSISTENCY_LEVEL_UNSPECIFIED\x10\x00\x12\x19\n\x15\x43ONSISTENCY_LEVEL_ONE\x10\x01\x12\x1c\n\x18\x43ONSISTENCY_LEVEL_QUORUM\x10\x02\x12\x19\n\x15\x43ONSISTENCY_LEVEL_ALL\x10\x03\x42\x64\n\x19io.weaviate.grpc.protocolB\x11WeaviateProtoBaseZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'base_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\031io.weaviate.grpc.protocolB\021WeaviateProtoBaseZ4github.com/weaviate/weaviate/grpc/generated;protocol' - _globals['_CONSISTENCYLEVEL']._serialized_start=265 - _globals['_CONSISTENCYLEVEL']._serialized_end=402 - _globals['_NUMBERARRAYPROPERTIES']._serialized_start=28 - _globals['_NUMBERARRAYPROPERTIES']._serialized_end=86 - _globals['_INTARRAYPROPERTIES']._serialized_start=88 - _globals['_INTARRAYPROPERTIES']._serialized_end=143 - _globals['_TEXTARRAYPROPERTIES']._serialized_start=145 - _globals['_TEXTARRAYPROPERTIES']._serialized_end=201 - _globals['_BOOLEANARRAYPROPERTIES']._serialized_start=203 - _globals['_BOOLEANARRAYPROPERTIES']._serialized_end=262 -# @@protoc_insertion_point(module_scope) diff --git a/weaviate_grpc/batch_pb2.py b/weaviate_grpc/batch_pb2.py deleted file mode 100644 index f18b9f2a7..000000000 --- a/weaviate_grpc/batch_pb2.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: batch.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import base_pb2 as base__pb2 -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x62\x61tch.proto\x12\x0cweaviategrpc\x1a\nbase.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x97\x01\n\x13\x42\x61tchObjectsRequest\x12*\n\x07objects\x18\x01 \x03(\x0b\x32\x19.weaviategrpc.BatchObject\x12>\n\x11\x63onsistency_level\x18\x02 \x01(\x0e\x32\x1e.weaviategrpc.ConsistencyLevelH\x00\x88\x01\x01\x42\x14\n\x12_consistency_level\"\x8b\x06\n\x0b\x42\x61tchObject\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0e\n\x06vector\x18\x02 \x03(\x02\x12\x38\n\nproperties\x18\x03 \x01(\x0b\x32$.weaviategrpc.BatchObject.Properties\x12\x12\n\ncollection\x18\x04 \x01(\t\x12\x0e\n\x06tenant\x18\x05 \x01(\t\x1a\xf1\x03\n\nProperties\x12\x33\n\x12non_ref_properties\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12O\n\x17single_target_ref_props\x18\x02 \x03(\x0b\x32..weaviategrpc.BatchObject.SingleTargetRefProps\x12M\n\x16multi_target_ref_props\x18\x03 \x03(\x0b\x32-.weaviategrpc.BatchObject.MultiTargetRefProps\x12\x44\n\x17number_array_properties\x18\x04 \x03(\x0b\x32#.weaviategrpc.NumberArrayProperties\x12>\n\x14int_array_properties\x18\x05 \x03(\x0b\x32 .weaviategrpc.IntArrayProperties\x12@\n\x15text_array_properties\x18\x06 \x03(\x0b\x32!.weaviategrpc.TextArrayProperties\x12\x46\n\x18\x62oolean_array_properties\x18\x07 \x03(\x0b\x32$.weaviategrpc.BooleanArrayProperties\x1a\x38\n\x14SingleTargetRefProps\x12\r\n\x05uuids\x18\x01 \x03(\t\x12\x11\n\tprop_name\x18\x02 \x01(\t\x1aR\n\x13MultiTargetRefProps\x12\r\n\x05uuids\x18\x01 \x03(\t\x12\x11\n\tprop_name\x18\x02 \x01(\t\x12\x19\n\x11target_collection\x18\x03 \x01(\t\"\x89\x01\n\x11\x42\x61tchObjectsReply\x12\x0c\n\x04took\x18\x01 \x01(\x02\x12:\n\x06\x65rrors\x18\x02 \x03(\x0b\x32*.weaviategrpc.BatchObjectsReply.BatchError\x1a*\n\nBatchError\x12\r\n\x05index\x18\x01 \x01(\x05\x12\r\n\x05\x65rror\x18\x02 \x01(\tBe\n\x19io.weaviate.grpc.protocolB\x12WeaviateProtoBatchZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'batch_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\031io.weaviate.grpc.protocolB\022WeaviateProtoBatchZ4github.com/weaviate/weaviate/grpc/generated;protocol' - _globals['_BATCHOBJECTSREQUEST']._serialized_start=72 - _globals['_BATCHOBJECTSREQUEST']._serialized_end=223 - _globals['_BATCHOBJECT']._serialized_start=226 - _globals['_BATCHOBJECT']._serialized_end=1005 - _globals['_BATCHOBJECT_PROPERTIES']._serialized_start=366 - _globals['_BATCHOBJECT_PROPERTIES']._serialized_end=863 - _globals['_BATCHOBJECT_SINGLETARGETREFPROPS']._serialized_start=865 - _globals['_BATCHOBJECT_SINGLETARGETREFPROPS']._serialized_end=921 - _globals['_BATCHOBJECT_MULTITARGETREFPROPS']._serialized_start=923 - _globals['_BATCHOBJECT_MULTITARGETREFPROPS']._serialized_end=1005 - _globals['_BATCHOBJECTSREPLY']._serialized_start=1008 - _globals['_BATCHOBJECTSREPLY']._serialized_end=1145 - _globals['_BATCHOBJECTSREPLY_BATCHERROR']._serialized_start=1103 - _globals['_BATCHOBJECTSREPLY_BATCHERROR']._serialized_end=1145 -# @@protoc_insertion_point(module_scope) diff --git a/weaviate_grpc/regen.sh b/weaviate_grpc/regen.sh deleted file mode 100644 index 33e2c1c2f..000000000 --- a/weaviate_grpc/regen.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -echo "this script assumes that you have checked out weaviate next to the client" -cd "${0%/*}/.." - - -python3 -m grpc_tools.protoc -I ../weaviate/grpc/proto --python_out=./weaviate_grpc --pyi_out=./weaviate_grpc --grpc_python_out=./weaviate_grpc ../weaviate/grpc/proto/*.proto - - -sed -i '' 's/import weaviate_pb2/from . import weaviate_pb2/g' weaviate_grpc/*.py -sed -i '' 's/import batch_pb2/from . import batch_pb2/g' weaviate_grpc/*.py -sed -i '' 's/import search_get_pb2/from . import search_get_pb2/g' weaviate_grpc/*.py -sed -i '' 's/import search_get_v1_pb2/from . import search_get_v1_pb2/g' weaviate_grpc/*.py -sed -i '' 's/import base_pb2/from . import base_pb2/g' weaviate_grpc/*.py - -echo "done" - diff --git a/weaviate_grpc/search_get_pb2.py b/weaviate_grpc/search_get_pb2.py deleted file mode 100644 index 7487fc8fa..000000000 --- a/weaviate_grpc/search_get_pb2.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: search_get.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10search_get.proto\x12\x0cweaviategrpc\"\x0f\n\rSearchRequest\"\r\n\x0bSearchReplyBi\n\x19io.weaviate.grpc.protocolB\x16WeaviateProtoSearchGetZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'search_get_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\031io.weaviate.grpc.protocolB\026WeaviateProtoSearchGetZ4github.com/weaviate/weaviate/grpc/generated;protocol' - _globals['_SEARCHREQUEST']._serialized_start=34 - _globals['_SEARCHREQUEST']._serialized_end=49 - _globals['_SEARCHREPLY']._serialized_start=51 - _globals['_SEARCHREPLY']._serialized_end=64 -# @@protoc_insertion_point(module_scope) diff --git a/weaviate_grpc/search_get_pb2.pyi b/weaviate_grpc/search_get_pb2.pyi deleted file mode 100644 index 8f99a9c32..000000000 --- a/weaviate_grpc/search_get_pb2.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ClassVar as _ClassVar - -DESCRIPTOR: _descriptor.FileDescriptor - -class SearchRequest(_message.Message): - __slots__ = [] - def __init__(self) -> None: ... - -class SearchReply(_message.Message): - __slots__ = [] - def __init__(self) -> None: ... diff --git a/weaviate_grpc/search_get_v1_pb2.py b/weaviate_grpc/search_get_v1_pb2.py deleted file mode 100644 index 750525cd6..000000000 --- a/weaviate_grpc/search_get_v1_pb2.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: search_get_v1.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import base_pb2 as base__pb2 -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13search_get_v1.proto\x12\x0cweaviategrpc\x1a\nbase.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xdc\x08\n\x0fSearchRequestV1\x12\x12\n\ncollection\x18\x01 \x01(\t\x12\x0e\n\x06tenant\x18\n \x01(\t\x12>\n\x11\x63onsistency_level\x18\x0b \x01(\x0e\x32\x1e.weaviategrpc.ConsistencyLevelH\x00\x88\x01\x01\x12\x38\n\nproperties\x18\x14 \x01(\x0b\x32\x1f.weaviategrpc.PropertiesRequestH\x01\x88\x01\x01\x12\x34\n\x08metadata\x18\x15 \x01(\x0b\x32\x1d.weaviategrpc.MetadataRequestH\x02\x88\x01\x01\x12,\n\x08group_by\x18\x16 \x01(\x0b\x32\x15.weaviategrpc.GroupByH\x03\x88\x01\x01\x12\r\n\x05limit\x18\x1e \x01(\r\x12\x0e\n\x06offset\x18\x1f \x01(\r\x12\x0f\n\x07\x61utocut\x18 \x01(\r\x12\r\n\x05\x61\x66ter\x18! \x01(\t\x12%\n\x07sort_by\x18\" \x03(\x0b\x32\x14.weaviategrpc.SortBy\x12+\n\x07\x66ilters\x18( \x01(\x0b\x32\x15.weaviategrpc.FiltersH\x04\x88\x01\x01\x12\x30\n\rhybrid_search\x18) \x01(\x0b\x32\x14.weaviategrpc.HybridH\x05\x88\x01\x01\x12,\n\x0b\x62m25_search\x18* \x01(\x0b\x32\x12.weaviategrpc.BM25H\x06\x88\x01\x01\x12\x32\n\x0bnear_vector\x18+ \x01(\x0b\x32\x18.weaviategrpc.NearVectorH\x07\x88\x01\x01\x12\x32\n\x0bnear_object\x18, \x01(\x0b\x32\x18.weaviategrpc.NearObjectH\x08\x88\x01\x01\x12\x34\n\tnear_text\x18- \x01(\x0b\x32\x1c.weaviategrpc.NearTextSearchH\t\x88\x01\x01\x12\x36\n\nnear_image\x18. \x01(\x0b\x32\x1d.weaviategrpc.NearImageSearchH\n\x88\x01\x01\x12\x36\n\nnear_audio\x18/ \x01(\x0b\x32\x1d.weaviategrpc.NearAudioSearchH\x0b\x88\x01\x01\x12\x36\n\nnear_video\x18\x30 \x01(\x0b\x32\x1d.weaviategrpc.NearVideoSearchH\x0c\x88\x01\x01\x12\x37\n\ngenerative\x18< \x01(\x0b\x32\x1e.weaviategrpc.GenerativeSearchH\r\x88\x01\x01\x42\x14\n\x12_consistency_levelB\r\n\x0b_propertiesB\x0b\n\t_metadataB\x0b\n\t_group_byB\n\n\x08_filtersB\x10\n\x0e_hybrid_searchB\x0e\n\x0c_bm25_searchB\x0e\n\x0c_near_vectorB\x0e\n\x0c_near_objectB\x0c\n\n_near_textB\r\n\x0b_near_imageB\r\n\x0b_near_audioB\r\n\x0b_near_videoB\r\n\x0b_generative\"L\n\x07GroupBy\x12\x0c\n\x04path\x18\x01 \x03(\t\x12\x18\n\x10number_of_groups\x18\x02 \x01(\x05\x12\x19\n\x11objects_per_group\x18\x03 \x01(\x05\")\n\x06SortBy\x12\x11\n\tascending\x18\x01 \x01(\x08\x12\x0c\n\x04path\x18\x02 \x03(\t\"m\n\x10GenerativeSearch\x12\x1e\n\x16single_response_prompt\x18\x01 \x01(\t\x12\x1d\n\x15grouped_response_task\x18\x02 \x01(\t\x12\x1a\n\x12grouped_properties\x18\x03 \x03(\t\"\x1b\n\tTextArray\x12\x0e\n\x06values\x18\x01 \x03(\t\"\x1a\n\x08IntArray\x12\x0e\n\x06values\x18\x01 \x03(\x03\"\x1d\n\x0bNumberArray\x12\x0e\n\x06values\x18\x01 \x03(\x01\"\x1e\n\x0c\x42ooleanArray\x12\x0e\n\x06values\x18\x01 \x03(\x08\"\x9b\x06\n\x07\x46ilters\x12\x30\n\x08operator\x18\x01 \x01(\x0e\x32\x1e.weaviategrpc.Filters.Operator\x12\n\n\x02on\x18\x02 \x03(\t\x12&\n\x07\x66ilters\x18\x03 \x03(\x0b\x32\x15.weaviategrpc.Filters\x12\x14\n\nvalue_text\x18\x04 \x01(\tH\x00\x12\x13\n\tvalue_int\x18\x05 \x01(\x03H\x00\x12\x17\n\rvalue_boolean\x18\x06 \x01(\x08H\x00\x12\x16\n\x0cvalue_number\x18\x07 \x01(\x02H\x00\x12\x33\n\x10value_text_array\x18\t \x01(\x0b\x32\x17.weaviategrpc.TextArrayH\x00\x12\x31\n\x0fvalue_int_array\x18\n \x01(\x0b\x32\x16.weaviategrpc.IntArrayH\x00\x12\x39\n\x13value_boolean_array\x18\x0b \x01(\x0b\x32\x1a.weaviategrpc.BooleanArrayH\x00\x12\x37\n\x12value_number_array\x18\x0c \x01(\x0b\x32\x19.weaviategrpc.NumberArrayH\x00\"\xe3\x02\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x12\n\x0eOPERATOR_EQUAL\x10\x01\x12\x16\n\x12OPERATOR_NOT_EQUAL\x10\x02\x12\x19\n\x15OPERATOR_GREATER_THAN\x10\x03\x12\x1f\n\x1bOPERATOR_GREATER_THAN_EQUAL\x10\x04\x12\x16\n\x12OPERATOR_LESS_THAN\x10\x05\x12\x1c\n\x18OPERATOR_LESS_THAN_EQUAL\x10\x06\x12\x10\n\x0cOPERATOR_AND\x10\x07\x12\x0f\n\x0bOPERATOR_OR\x10\x08\x12\x1d\n\x19OPERATOR_WITHIN_GEO_RANGE\x10\t\x12\x11\n\rOPERATOR_LIKE\x10\n\x12\x14\n\x10OPERATOR_IS_NULL\x10\x0b\x12\x19\n\x15OPERATOR_CONTAINS_ANY\x10\x0c\x12\x19\n\x15OPERATOR_CONTAINS_ALL\x10\rB\x0c\n\ntest_value\"\xcc\x01\n\x0fMetadataRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\x08\x12\x0e\n\x06vector\x18\x02 \x01(\x08\x12\x1a\n\x12\x63reation_time_unix\x18\x03 \x01(\x08\x12\x1d\n\x15last_update_time_unix\x18\x04 \x01(\x08\x12\x10\n\x08\x64istance\x18\x05 \x01(\x08\x12\x11\n\tcertainty\x18\x06 \x01(\x08\x12\r\n\x05score\x18\x07 \x01(\x08\x12\x15\n\rexplain_score\x18\x08 \x01(\x08\x12\x15\n\ris_consistent\x18\t \x01(\x08\"k\n\x11PropertiesRequest\x12\x1a\n\x12non_ref_properties\x18\x01 \x03(\t\x12:\n\x0eref_properties\x18\x02 \x03(\x0b\x32\".weaviategrpc.RefPropertiesRequest\"\xe3\x01\n\x06Hybrid\x12\r\n\x05query\x18\x01 \x01(\t\x12\x12\n\nproperties\x18\x02 \x03(\t\x12\x0e\n\x06vector\x18\x03 \x03(\x02\x12\r\n\x05\x61lpha\x18\x04 \x01(\x02\x12\x34\n\x0b\x66usion_type\x18\x05 \x01(\x0e\x32\x1f.weaviategrpc.Hybrid.FusionType\"a\n\nFusionType\x12\x1b\n\x17\x46USION_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x46USION_TYPE_RANKED\x10\x01\x12\x1e\n\x1a\x46USION_TYPE_RELATIVE_SCORE\x10\x02\"\xaf\x02\n\x0eNearTextSearch\x12\r\n\x05query\x18\x01 \x03(\t\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x12\x37\n\x07move_to\x18\x04 \x01(\x0b\x32!.weaviategrpc.NearTextSearch.MoveH\x02\x88\x01\x01\x12\x39\n\tmove_away\x18\x05 \x01(\x0b\x32!.weaviategrpc.NearTextSearch.MoveH\x03\x88\x01\x01\x1a\x36\n\x04Move\x12\r\n\x05\x66orce\x18\x01 \x01(\x02\x12\x10\n\x08\x63oncepts\x18\x02 \x03(\t\x12\r\n\x05uuids\x18\x03 \x03(\tB\x0c\n\n_certaintyB\x0b\n\t_distanceB\n\n\x08_move_toB\x0c\n\n_move_away\"j\n\x0fNearImageSearch\x12\r\n\x05image\x18\x01 \x01(\t\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x0c\n\n_certaintyB\x0b\n\t_distance\"j\n\x0fNearAudioSearch\x12\r\n\x05\x61udio\x18\x01 \x01(\t\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x0c\n\n_certaintyB\x0b\n\t_distance\"j\n\x0fNearVideoSearch\x12\r\n\x05video\x18\x01 \x01(\t\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x0c\n\n_certaintyB\x0b\n\t_distance\")\n\x04\x42M25\x12\r\n\x05query\x18\x01 \x01(\t\x12\x12\n\nproperties\x18\x02 \x03(\t\"\xb3\x01\n\x14RefPropertiesRequest\x12\x1a\n\x12reference_property\x18\x01 \x01(\t\x12\x33\n\nproperties\x18\x02 \x01(\x0b\x32\x1f.weaviategrpc.PropertiesRequest\x12/\n\x08metadata\x18\x03 \x01(\x0b\x32\x1d.weaviategrpc.MetadataRequest\x12\x19\n\x11target_collection\x18\x04 \x01(\t\"f\n\nNearVector\x12\x0e\n\x06vector\x18\x01 \x03(\x02\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x0c\n\n_certaintyB\x0b\n\t_distance\"b\n\nNearObject\x12\n\n\x02id\x18\x01 \x01(\t\x12\x16\n\tcertainty\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x0c\n\n_certaintyB\x0b\n\t_distance\"\xc7\x01\n\rSearchReplyV1\x12\x0c\n\x04took\x18\x01 \x01(\x02\x12+\n\x07results\x18\x02 \x03(\x0b\x32\x1a.weaviategrpc.SearchResult\x12&\n\x19generative_grouped_result\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x35\n\x10group_by_results\x18\x04 \x03(\x0b\x32\x1b.weaviategrpc.GroupByResultB\x1c\n\x1a_generative_grouped_result\"\x91\x01\n\rGroupByResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0cmin_distance\x18\x02 \x01(\x02\x12\x14\n\x0cmax_distance\x18\x03 \x01(\x02\x12\x19\n\x11number_of_objects\x18\x04 \x01(\x03\x12+\n\x07objects\x18\x05 \x03(\x0b\x32\x1a.weaviategrpc.SearchResult\"r\n\x0cSearchResult\x12\x32\n\nproperties\x18\x01 \x01(\x0b\x32\x1e.weaviategrpc.PropertiesResult\x12.\n\x08metadata\x18\x02 \x01(\x0b\x32\x1c.weaviategrpc.MetadataResult\"\xc6\x03\n\x0eMetadataResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06vector\x18\x02 \x03(\x02\x12\x1a\n\x12\x63reation_time_unix\x18\x03 \x01(\x03\x12\"\n\x1a\x63reation_time_unix_present\x18\x04 \x01(\x08\x12\x1d\n\x15last_update_time_unix\x18\x05 \x01(\x03\x12%\n\x1dlast_update_time_unix_present\x18\x06 \x01(\x08\x12\x10\n\x08\x64istance\x18\x07 \x01(\x02\x12\x18\n\x10\x64istance_present\x18\x08 \x01(\x08\x12\x11\n\tcertainty\x18\t \x01(\x02\x12\x19\n\x11\x63\x65rtainty_present\x18\n \x01(\x08\x12\r\n\x05score\x18\x0b \x01(\x02\x12\x15\n\rscore_present\x18\x0c \x01(\x08\x12\x15\n\rexplain_score\x18\r \x01(\t\x12\x1d\n\x15\x65xplain_score_present\x18\x0e \x01(\x08\x12\x1a\n\ris_consistent\x18\x0f \x01(\x08H\x00\x88\x01\x01\x12\x12\n\ngenerative\x18\x10 \x01(\t\x12\x1a\n\x12generative_present\x18\x11 \x01(\x08\x42\x10\n\x0e_is_consistent\"\xd8\x03\n\x10PropertiesResult\x12\x33\n\x12non_ref_properties\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x34\n\tref_props\x18\x02 \x03(\x0b\x32!.weaviategrpc.RefPropertiesResult\x12\x19\n\x11target_collection\x18\x03 \x01(\t\x12.\n\x08metadata\x18\x04 \x01(\x0b\x32\x1c.weaviategrpc.MetadataResult\x12\x44\n\x17number_array_properties\x18\x05 \x03(\x0b\x32#.weaviategrpc.NumberArrayProperties\x12>\n\x14int_array_properties\x18\x06 \x03(\x0b\x32 .weaviategrpc.IntArrayProperties\x12@\n\x15text_array_properties\x18\x07 \x03(\x0b\x32!.weaviategrpc.TextArrayProperties\x12\x46\n\x18\x62oolean_array_properties\x18\x08 \x03(\x0b\x32$.weaviategrpc.BooleanArrayProperties\"\\\n\x13RefPropertiesResult\x12\x32\n\nproperties\x18\x01 \x03(\x0b\x32\x1e.weaviategrpc.PropertiesResult\x12\x11\n\tprop_name\x18\x02 \x01(\tBk\n\x19io.weaviate.grpc.protocolB\x18WeaviateProtoSearchGetV1Z4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'search_get_v1_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\031io.weaviate.grpc.protocolB\030WeaviateProtoSearchGetV1Z4github.com/weaviate/weaviate/grpc/generated;protocol' - _globals['_SEARCHREQUESTV1']._serialized_start=80 - _globals['_SEARCHREQUESTV1']._serialized_end=1196 - _globals['_GROUPBY']._serialized_start=1198 - _globals['_GROUPBY']._serialized_end=1274 - _globals['_SORTBY']._serialized_start=1276 - _globals['_SORTBY']._serialized_end=1317 - _globals['_GENERATIVESEARCH']._serialized_start=1319 - _globals['_GENERATIVESEARCH']._serialized_end=1428 - _globals['_TEXTARRAY']._serialized_start=1430 - _globals['_TEXTARRAY']._serialized_end=1457 - _globals['_INTARRAY']._serialized_start=1459 - _globals['_INTARRAY']._serialized_end=1485 - _globals['_NUMBERARRAY']._serialized_start=1487 - _globals['_NUMBERARRAY']._serialized_end=1516 - _globals['_BOOLEANARRAY']._serialized_start=1518 - _globals['_BOOLEANARRAY']._serialized_end=1548 - _globals['_FILTERS']._serialized_start=1551 - _globals['_FILTERS']._serialized_end=2346 - _globals['_FILTERS_OPERATOR']._serialized_start=1977 - _globals['_FILTERS_OPERATOR']._serialized_end=2332 - _globals['_METADATAREQUEST']._serialized_start=2349 - _globals['_METADATAREQUEST']._serialized_end=2553 - _globals['_PROPERTIESREQUEST']._serialized_start=2555 - _globals['_PROPERTIESREQUEST']._serialized_end=2662 - _globals['_HYBRID']._serialized_start=2665 - _globals['_HYBRID']._serialized_end=2892 - _globals['_HYBRID_FUSIONTYPE']._serialized_start=2795 - _globals['_HYBRID_FUSIONTYPE']._serialized_end=2892 - _globals['_NEARTEXTSEARCH']._serialized_start=2895 - _globals['_NEARTEXTSEARCH']._serialized_end=3198 - _globals['_NEARTEXTSEARCH_MOVE']._serialized_start=3091 - _globals['_NEARTEXTSEARCH_MOVE']._serialized_end=3145 - _globals['_NEARIMAGESEARCH']._serialized_start=3200 - _globals['_NEARIMAGESEARCH']._serialized_end=3306 - _globals['_NEARAUDIOSEARCH']._serialized_start=3308 - _globals['_NEARAUDIOSEARCH']._serialized_end=3414 - _globals['_NEARVIDEOSEARCH']._serialized_start=3416 - _globals['_NEARVIDEOSEARCH']._serialized_end=3522 - _globals['_BM25']._serialized_start=3524 - _globals['_BM25']._serialized_end=3565 - _globals['_REFPROPERTIESREQUEST']._serialized_start=3568 - _globals['_REFPROPERTIESREQUEST']._serialized_end=3747 - _globals['_NEARVECTOR']._serialized_start=3749 - _globals['_NEARVECTOR']._serialized_end=3851 - _globals['_NEAROBJECT']._serialized_start=3853 - _globals['_NEAROBJECT']._serialized_end=3951 - _globals['_SEARCHREPLYV1']._serialized_start=3954 - _globals['_SEARCHREPLYV1']._serialized_end=4153 - _globals['_GROUPBYRESULT']._serialized_start=4156 - _globals['_GROUPBYRESULT']._serialized_end=4301 - _globals['_SEARCHRESULT']._serialized_start=4303 - _globals['_SEARCHRESULT']._serialized_end=4417 - _globals['_METADATARESULT']._serialized_start=4420 - _globals['_METADATARESULT']._serialized_end=4874 - _globals['_PROPERTIESRESULT']._serialized_start=4877 - _globals['_PROPERTIESRESULT']._serialized_end=5349 - _globals['_REFPROPERTIESRESULT']._serialized_start=5351 - _globals['_REFPROPERTIESRESULT']._serialized_end=5443 -# @@protoc_insertion_point(module_scope) diff --git a/weaviate_grpc/search_get_v1_pb2_grpc.py b/weaviate_grpc/search_get_v1_pb2_grpc.py deleted file mode 100644 index 2daafffeb..000000000 --- a/weaviate_grpc/search_get_v1_pb2_grpc.py +++ /dev/null @@ -1,4 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - diff --git a/weaviate_grpc/weaviate_pb2.py b/weaviate_grpc/weaviate_pb2.py deleted file mode 100644 index 70ebe6b69..000000000 --- a/weaviate_grpc/weaviate_pb2.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: weaviate.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import batch_pb2 as batch__pb2 -from . import search_get_pb2 as search__get__pb2 -from . import search_get_v1_pb2 as search__get__v1__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eweaviate.proto\x12\x0cweaviategrpc\x1a\x0b\x62\x61tch.proto\x1a\x10search_get.proto\x1a\x13search_get_v1.proto2\xee\x01\n\x08Weaviate\x12\x42\n\x06Search\x12\x1b.weaviategrpc.SearchRequest\x1a\x19.weaviategrpc.SearchReply\"\x00\x12H\n\x08SearchV1\x12\x1d.weaviategrpc.SearchRequestV1\x1a\x1b.weaviategrpc.SearchReplyV1\"\x00\x12T\n\x0c\x42\x61tchObjects\x12!.weaviategrpc.BatchObjectsRequest\x1a\x1f.weaviategrpc.BatchObjectsReply\"\x00\x42`\n\x19io.weaviate.grpc.protocolB\rWeaviateProtoZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'weaviate_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\031io.weaviate.grpc.protocolB\rWeaviateProtoZ4github.com/weaviate/weaviate/grpc/generated;protocol' - _globals['_WEAVIATE']._serialized_start=85 - _globals['_WEAVIATE']._serialized_end=323 -# @@protoc_insertion_point(module_scope) diff --git a/weaviate_grpc/weaviate_pb2_grpc.py b/weaviate_grpc/weaviate_pb2_grpc.py deleted file mode 100644 index cebd02e22..000000000 --- a/weaviate_grpc/weaviate_pb2_grpc.py +++ /dev/null @@ -1,134 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import batch_pb2 as batch__pb2 -from . import search_get_pb2 as search__get__pb2 -from . import search_get_v1_pb2 as search__get__v1__pb2 - - -class WeaviateStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Search = channel.unary_unary( - '/weaviategrpc.Weaviate/Search', - request_serializer=search__get__pb2.SearchRequest.SerializeToString, - response_deserializer=search__get__pb2.SearchReply.FromString, - ) - self.SearchV1 = channel.unary_unary( - '/weaviategrpc.Weaviate/SearchV1', - request_serializer=search__get__v1__pb2.SearchRequestV1.SerializeToString, - response_deserializer=search__get__v1__pb2.SearchReplyV1.FromString, - ) - self.BatchObjects = channel.unary_unary( - '/weaviategrpc.Weaviate/BatchObjects', - request_serializer=batch__pb2.BatchObjectsRequest.SerializeToString, - response_deserializer=batch__pb2.BatchObjectsReply.FromString, - ) - - -class WeaviateServicer(object): - """Missing associated documentation comment in .proto file.""" - - def Search(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SearchV1(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def BatchObjects(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_WeaviateServicer_to_server(servicer, server): - rpc_method_handlers = { - 'Search': grpc.unary_unary_rpc_method_handler( - servicer.Search, - request_deserializer=search__get__pb2.SearchRequest.FromString, - response_serializer=search__get__pb2.SearchReply.SerializeToString, - ), - 'SearchV1': grpc.unary_unary_rpc_method_handler( - servicer.SearchV1, - request_deserializer=search__get__v1__pb2.SearchRequestV1.FromString, - response_serializer=search__get__v1__pb2.SearchReplyV1.SerializeToString, - ), - 'BatchObjects': grpc.unary_unary_rpc_method_handler( - servicer.BatchObjects, - request_deserializer=batch__pb2.BatchObjectsRequest.FromString, - response_serializer=batch__pb2.BatchObjectsReply.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'weaviategrpc.Weaviate', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class Weaviate(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def Search(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/weaviategrpc.Weaviate/Search', - search__get__pb2.SearchRequest.SerializeToString, - search__get__pb2.SearchReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SearchV1(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/weaviategrpc.Weaviate/SearchV1', - search__get__v1__pb2.SearchRequestV1.SerializeToString, - search__get__v1__pb2.SearchReplyV1.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def BatchObjects(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/weaviategrpc.Weaviate/BatchObjects', - batch__pb2.BatchObjectsRequest.SerializeToString, - batch__pb2.BatchObjectsReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata)