Skip to content

Commit 3a85a3e

Browse files
committed
Update proto with tokenize API enhancements
And remove unused generate.proto file (cherry picked from commit 5f9705816863e741d1a43b9e1b6e00b259d1c58a)
1 parent 4c5b56d commit 3a85a3e

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

proto/generation.proto

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,11 @@ message TokenInfo {
204204
message BatchedTokenizeRequest {
205205
string model_id = 1;
206206
repeated TokenizeRequest requests = 2;
207-
bool return_tokens = 3; //TBD
207+
bool return_tokens = 3;
208+
bool return_offsets = 4;
209+
210+
// Zero means don't truncate.
211+
uint32 truncate_input_tokens = 5;
208212
}
209213

210214
message BatchedTokenizeResponse {
@@ -216,10 +220,17 @@ message TokenizeRequest {
216220
}
217221

218222
message TokenizeResponse {
223+
message Offset {
224+
uint32 start = 1;
225+
uint32 end = 2;
226+
}
227+
219228
uint32 token_count = 1;
220-
repeated string tokens = 2; // if include_tokens = true
221229

222-
// We'll possibly add more later
230+
// if return_tokens = true
231+
repeated string tokens = 2;
232+
// if return_tokens = true
233+
repeated Offset offsets = 3;
223234
}
224235

225236

0 commit comments

Comments
 (0)