Skip to content

Commit ae53718

Browse files
authored
Update gRPC API with guided decoding and adapter_id changes (#10)
Signed-off-by: Nick Hill <[email protected]>
1 parent e024e96 commit ae53718

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

proto/generation.proto

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@ enum DecodingMethod {
2727

2828
message BatchedGenerationRequest {
2929
string model_id = 1;
30+
// Deprecated in favor of adapter_id
3031
optional string prefix_id = 2;
32+
optional string adapter_id = 4;
3133
repeated GenerationRequest requests = 3;
3234

3335
Parameters params = 10;
3436
}
3537

3638
message SingleGenerationRequest {
3739
string model_id = 1;
40+
// Deprecated in favor of adapter_id
3841
optional string prefix_id = 2;
42+
optional string adapter_id = 4;
3943
GenerationRequest request = 3;
4044

4145
Parameters params = 10;
@@ -106,6 +110,31 @@ message DecodingParameters {
106110
// Exponentially increases the score of the EOS token
107111
// once start_index tokens have been generated
108112
optional LengthPenalty length_penalty = 2;
113+
114+
enum ResponseFormat {
115+
// Plain text, no constraints
116+
TEXT = 0;
117+
// Valid json
118+
JSON = 1;
119+
}
120+
121+
message StringChoices {
122+
repeated string choices = 1;
123+
}
124+
125+
// Mutually-exclusive guided decoding options
126+
oneof guided {
127+
// Output will be in the specified format
128+
ResponseFormat format = 3;
129+
// Output will follow the provided JSON schema
130+
string json_schema = 4;
131+
// Output will follow the provided regex pattern
132+
string regex = 5;
133+
// Output will be exactly one of the specified choices
134+
StringChoices choice = 6;
135+
// Output will follow the provided context free grammar
136+
string grammar = 7;
137+
}
109138
}
110139

111140

0 commit comments

Comments
 (0)