From 85ccff4d57fe9c510c88ee4eaf1ba33ef4ef1188 Mon Sep 17 00:00:00 2001 From: junjiejiangjjj Date: Tue, 8 Oct 2024 11:45:15 +0800 Subject: [PATCH] Add openai embedding function type (#323) Signed-off-by: junjie.jiang --- go-api/schemapb/schema.pb.go | 41 ++++++++++++++++++++---------------- proto/schema.proto | 1 + 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/go-api/schemapb/schema.pb.go b/go-api/schemapb/schema.pb.go index 46d1ea6..7d1baa7 100644 --- a/go-api/schemapb/schema.pb.go +++ b/go-api/schemapb/schema.pb.go @@ -118,8 +118,9 @@ func (DataType) EnumDescriptor() ([]byte, []int) { type FunctionType int32 const ( - FunctionType_Unknown FunctionType = 0 - FunctionType_BM25 FunctionType = 1 + FunctionType_Unknown FunctionType = 0 + FunctionType_BM25 FunctionType = 1 + FunctionType_OpenAIEmbedding FunctionType = 2 ) // Enum value maps for FunctionType. @@ -127,10 +128,12 @@ var ( FunctionType_name = map[int32]string{ 0: "Unknown", 1: "BM25", + 2: "OpenAIEmbedding", } FunctionType_value = map[string]int32{ - "Unknown": 0, - "BM25": 1, + "Unknown": 0, + "BM25": 1, + "OpenAIEmbedding": 2, } ) @@ -2322,22 +2325,24 @@ var file_schema_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x61, 0x74, 0x31, 0x36, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x10, 0x66, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x31, 0x36, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x10, 0x67, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x46, 0x6c, 0x6f, 0x61, - 0x74, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x10, 0x68, 0x2a, 0x25, 0x0a, 0x0c, 0x46, 0x75, 0x6e, + 0x74, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x10, 0x68, 0x2a, 0x3a, 0x0a, 0x0c, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4d, 0x32, 0x35, 0x10, 0x01, - 0x2a, 0x56, 0x0a, 0x0a, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, - 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x10, 0x00, - 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6e, - 0x67, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x72, 0x6f, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, - 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x10, 0x03, 0x42, 0x6d, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x6d, - 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x42, 0x0b, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x69, 0x6f, 0x2f, - 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x70, 0x62, 0xa0, - 0x01, 0x01, 0xaa, 0x02, 0x12, 0x4d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x49, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, + 0x69, 0x6e, 0x67, 0x10, 0x02, 0x2a, 0x56, 0x0a, 0x0a, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x44, 0x72, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x44, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x10, 0x03, 0x42, 0x6d, 0x0a, + 0x0e, 0x69, 0x6f, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x42, + 0x0b, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, + 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x70, 0x62, 0xa0, 0x01, 0x01, 0xaa, 0x02, 0x12, 0x4d, 0x69, 0x6c, 0x76, 0x75, 0x73, + 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/schema.proto b/proto/schema.proto index f5fdffb..5151ff2 100644 --- a/proto/schema.proto +++ b/proto/schema.proto @@ -42,6 +42,7 @@ enum DataType { enum FunctionType{ Unknown =0; BM25 =1; + OpenAIEmbedding =2; } enum FieldState {