@@ -71,45 +71,43 @@ message PredictRequest {
71
71
// handled in the stream.
72
72
message PredictStreamedOptions {
73
73
// Request state used to handle splitting of requests. NONE is the
74
- // default when the stream request is not split.
74
+ // default when the stream request is not split and used for a single-turn,
75
+ // single request.
75
76
//
76
77
// SPLIT is used when multiple streamed requests are used to generate a
77
78
// logical request. END_SPLIT should be called for the last split of the
78
- // logical request. NONE can not be interspersed with SPLIT before END_SPLIT
79
- // is called. If another request is sent on the same
80
- // stream after END_SPLIT, it can be any of the RequestState since a new
81
- // logical request has started. If END_SPLIT is called on its own the
82
- // behavior is the same as NONE .
79
+ // multi-turn request to start the processing of the current turn. NONE can
80
+ // not be interspersed with SPLIT and END_SPLIT messages.
81
+ // If another request is sent on the same stream after END_SPLIT, it can be
82
+ // either SPLIT or END_SPLIT to start accumulating input or trigger the next
83
+ // model turn respectively .
83
84
//
84
85
// Some examples with a mix of request states and the logical request.
85
86
//
86
- // Example 1 :
87
- // SPLIT
88
- // SPLIT
89
- // END_SPLIT
87
+ // Example 1:
88
+ // NONE
90
89
//
91
- // Will be treated as a single logical request.
90
+ // Single turn, single request.
92
91
//
93
- // Example 2:
94
- // NONE
92
+ // Example 2 :
95
93
// END_SPLIT
96
- // NONE
97
94
//
98
- // Will be treated as three logical requests (1. NONE 2. END_SPLIT, 3. NONE)
95
+ // Will be treated as a single logical input request for a single turn,
96
+ // similar to Example 1.
99
97
//
100
98
// Example 3:
101
99
// SPLIT
102
100
// SPLIT
101
+ // END_SPLIT
103
102
//
104
- // Invalid because END_SPLIT is never call.
103
+ // Will be treated as a single logical input request for a single turn,
104
+ // similar to Example 1.
105
105
//
106
106
// Example 4:
107
- // SPLIT
108
- // NONE
109
- // SPLIT
107
+ // END_SPLIT
110
108
// END_SPLIT
111
109
//
112
- // Invalid because is interspersed with SPLIT.
110
+ // Will be treated as two logical turn requests (1. END_SPLIT 2. END_SPLIT)
113
111
//
114
112
// Example 5:
115
113
// SPLIT
@@ -118,8 +116,28 @@ message PredictStreamedOptions {
118
116
// SPLIT
119
117
// END_SPLIT
120
118
//
121
- // Will be treated as two logical requests (1. SPLIT, END_SPLIT 2. SPLIT,
119
+ // Will be treated as two logical turn requests (1. SPLIT, END_SPLIT 2. SPLIT,
122
120
// SPLIT, END_SPLIT)
121
+ //
122
+ // Incorrect Example 1:
123
+ // NONE
124
+ // END_SPLIT
125
+ //
126
+ // Invalid because NONE and END_SPLIT are interspersed.
127
+ //
128
+ // Incorrect Example 2:
129
+ // SPLIT
130
+ // SPLIT
131
+ //
132
+ // Invalid because END_SPLIT is never called.
133
+ //
134
+ // Incorrect Example 3:
135
+ // SPLIT
136
+ // NONE
137
+ // SPLIT
138
+ // END_SPLIT
139
+ //
140
+ // Invalid because NONE is interspersed with SPLIT/END_SPLIT.
123
141
124
142
enum RequestState {
125
143
NONE = 0 ;
0 commit comments