-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(catalog): more file type, qa api, and file catalog api (#412)
Because 1. catelog need to support more file upload 2. question answering api 3. file catalog api This commit add related proto --------- Co-authored-by: droplet-bot <[email protected]>
- Loading branch information
1 parent
0f4071f
commit 055bbd0
Showing
5 changed files
with
424 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
syntax = "proto3"; | ||
|
||
package artifact.artifact.v1alpha; | ||
// Artifact definitions | ||
import "artifact/artifact/v1alpha/artifact.proto"; | ||
|
||
// Protocol Buffers Well-Known Types | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
// GetFileCatalogRequest | ||
message GetFileCatalogRequest{ | ||
// id of the namespace | ||
string namespace_id = 1; | ||
// id of the catalog | ||
string catalog_id = 2; | ||
// id of the file(i.e. file name) | ||
string file_id = 3; | ||
// Uid of the file | ||
string file_uid = 4; | ||
} | ||
|
||
// GetFileCatalogResponse | ||
message GetFileCatalogResponse{ | ||
// metadata | ||
message Metadata { | ||
// file uid | ||
string file_uid = 1; | ||
// file id | ||
string file_id = 2; | ||
// file type | ||
FileType file_type = 3; | ||
// file size in bytes | ||
int64 file_size = 4; | ||
// upload time | ||
google.protobuf.Timestamp file_upload_time = 5; | ||
// file process status | ||
FileProcessStatus file_process_status = 6; | ||
} | ||
// text message | ||
message Text{ | ||
// pipelines | ||
repeated string pipeline_ids = 1; | ||
// transformed content | ||
string transformed_content = 2; | ||
// transformed content uid | ||
string transformed_content_uid = 3; | ||
// transformed content chunk number | ||
int32 transformed_content_chunk_num = 4; | ||
// transformed content token number | ||
int32 transformed_content_token_num = 5; | ||
// transformed content update time | ||
google.protobuf.Timestamp transformed_content_update_time = 6; | ||
} | ||
// chunk type | ||
enum ChunkType { | ||
// unspecified | ||
CHUNK_TYPE_UNSPECIFIED = 0; | ||
// text | ||
CHUNK_TYPE_TEXT = 1; | ||
// image | ||
CHUNK_TYPE_IMAGE = 2; | ||
// audio | ||
CHUNK_TYPE_AUDIO = 3; | ||
// video | ||
CHUNK_TYPE_VIDEO = 4; | ||
} | ||
// chunk message | ||
message Chunk { | ||
// chunk uid | ||
string uid = 1; | ||
// chunk type. i.e. text, image, audio, and video | ||
ChunkType type = 2; | ||
// chunk start position | ||
int32 start_pos = 3; | ||
// chunk end position | ||
int32 end_pos =4; | ||
// chunk content | ||
string content = 5; | ||
// chunk tokens num | ||
int32 tokens_num = 6; | ||
// embedding. float32 array | ||
repeated float embedding = 7; | ||
// chunk create time | ||
google.protobuf.Timestamp create_time = 8; | ||
// chunk retrievable | ||
bool retrievable = 9; | ||
} | ||
// file catalog | ||
Metadata metadata = 1; | ||
// text | ||
Text text = 2; | ||
// chunks | ||
repeated Chunk chunks = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
syntax = "proto3"; | ||
|
||
package artifact.artifact.v1alpha; | ||
|
||
// Artifact definitions | ||
import "artifact/artifact/v1alpha/chunk.proto"; | ||
|
||
|
||
// QuestionAnsweringRequest | ||
message QuestionAnsweringRequest { | ||
// id of the namespace | ||
string namespace_id = 1; | ||
// id of the catalog | ||
string catalog_id = 2; | ||
// question to be answered | ||
string question = 3; | ||
// topk default to 5 | ||
int32 topk = 4; | ||
} | ||
|
||
// QuestionAnsweringResponse | ||
message QuestionAnsweringResponse { | ||
// answer to the question | ||
string answer = 1; | ||
// chunks | ||
repeated SimilarityChunk similar_chunks = 2; | ||
} | ||
|
Oops, something went wrong.