Skip to content

Commit f970d56

Browse files
authored
🏷️ Update based on open-sourced types (#185)
* 🏷️ Update based on open-sourced types Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com> * 💡 Add caikit reference as comments Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com> --------- Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
1 parent 4d136ad commit f970d56

File tree

5 files changed

+19
-23
lines changed

5 files changed

+19
-23
lines changed

protos/caikit_data_model_nlp.proto

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
// Ref. https://github.com/caikit/caikit/blob/main/caikit/interfaces/nlp/data_model/text.py
22
/*------------------------------------------------------------------------------
33
* AUTO GENERATED
44
*----------------------------------------------------------------------------*/
@@ -27,6 +27,16 @@
2727

2828
/*-- MESSAGES ----------------------------------------------------------------*/
2929

30+
message ChunkerTokenizationStreamResult {
31+
32+
/*-- fields --*/
33+
repeated caikit_data_model.nlp.Token results = 1;
34+
int64 token_count = 4;
35+
int64 processed_index = 2;
36+
int64 start_index = 3;
37+
int64 input_start_index = 20;
38+
int64 input_end_index = 21;
39+
}
3040

3141
message GeneratedTextResult {
3242

protos/caikit_runtime_Chunkers.proto

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
// Ref. https://github.com/caikit/caikit/blob/main/caikit/interfaces/nlp/tasks.py
22
/*------------------------------------------------------------------------------
33
* AUTO GENERATED
44
*----------------------------------------------------------------------------*/
@@ -23,21 +23,10 @@ message ChunkerTokenizationTaskRequest {
2323
string text = 1;
2424
}
2525

26-
message ChunkerTokenizationStreamResult {
27-
28-
/*-- fields --*/
29-
repeated caikit_data_model.nlp.Token results = 1;
30-
int64 token_count = 4;
31-
int64 processed_index = 2;
32-
int64 start_index = 3;
33-
int64 input_start_index = 5;
34-
int64 input_end_index = 6;
35-
}
36-
3726

3827
/*-- SERVICES ----------------------------------------------------------------*/
3928

4029
service ChunkersService {
41-
rpc BidiStreamingChunkerTokenizationTaskPredict(stream BidiStreamingChunkerTokenizationTaskRequest) returns (stream ChunkerTokenizationStreamResult);
42-
rpc ChunkerTokenizationTaskPredict(ChunkerTokenizationTaskRequest) returns (caikit_data_model.nlp.TokenizationResults);
30+
rpc BidiStreamingChunkerTokenizationTaskPredict(stream caikit.runtime.Chunkers.BidiStreamingChunkerTokenizationTaskRequest) returns (stream caikit_data_model.nlp.ChunkerTokenizationStreamResult);
31+
rpc ChunkerTokenizationTaskPredict(caikit.runtime.Chunkers.ChunkerTokenizationTaskRequest) returns (caikit_data_model.nlp.TokenizationResults);
4332
}

src/clients/chunker.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ use crate::{
3030
pb::{
3131
caikit::runtime::chunkers::{
3232
chunkers_service_client::ChunkersServiceClient,
33-
BidiStreamingChunkerTokenizationTaskRequest, ChunkerTokenizationStreamResult,
34-
ChunkerTokenizationTaskRequest,
33+
BidiStreamingChunkerTokenizationTaskRequest, ChunkerTokenizationTaskRequest,
3534
},
36-
caikit_data_model::nlp::{Token, TokenizationResults},
35+
caikit_data_model::nlp::{ChunkerTokenizationStreamResult, Token, TokenizationResults},
3736
},
3837
};
3938

src/orchestrator/streaming.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ use crate::{
3737
unary::{input_detection_task, tokenize},
3838
UNSUITABLE_INPUT_MESSAGE,
3939
},
40-
pb::caikit::runtime::chunkers::{self, ChunkerTokenizationStreamResult},
40+
pb::caikit::runtime::chunkers,
41+
pb::caikit_data_model::nlp::ChunkerTokenizationStreamResult,
4142
};
4243

4344
pub type Chunk = ChunkerTokenizationStreamResult;

src/orchestrator/streaming/aggregator.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,7 @@ mod tests {
446446
use super::*;
447447
use crate::{
448448
models::TokenClassificationResult,
449-
pb::{
450-
caikit::runtime::chunkers::ChunkerTokenizationStreamResult,
451-
caikit_data_model::nlp::Token,
452-
},
449+
pb::caikit_data_model::nlp::{ChunkerTokenizationStreamResult, Token},
453450
};
454451

455452
fn get_detection_obj(

0 commit comments

Comments
 (0)