@@ -42,8 +42,8 @@ export const getBasicStreamMock = (): MockResponseStreamEvent[] => {
42
42
- To mock a failed response, write: **fail**
43
43
- To mock a mid-sentence failed response, write: **midway fail**
44
44
- To mock a incomplete response, write: **incomplete fail**
45
- - To mock a file search, write: **rag**
46
- - To mock a file search fail response, write: **rag fail**
45
+ - To mock a file search, write: **rag** -- _make sure to have a RAG index selected_
46
+ - To mock a file search fail response, write: **rag fail** -- _make sure to have a RAG index selected_
47
47
- To mock a code block, write: **code block**
48
48
- To mock a math block, write: **math block**
49
49
OVER
@@ -154,14 +154,49 @@ export const getMidwayFailStreamMock = (): MockResponseStreamEvent[] => {
154
154
155
155
export const getFileSearchStreamMock = ( ) : MockResponseStreamEvent [ ] => {
156
156
// https://platform.openai.com/docs/api-reference/responses-streaming/response/file_search_call
157
- const responseText = `For testing RAG stream. Not yet implemented .`
157
+ const responseText = `This is a mock response for file search stream. It simulates a response that is augmented with file search results .`
158
158
159
159
const chunkedResponseText = chunkText ( responseText )
160
160
161
161
return [
162
162
{
163
163
type : 'response.created' ,
164
164
} ,
165
+ {
166
+ type : 'response.file_search_call.in_progress' ,
167
+ } ,
168
+ {
169
+ type : 'response.output_item.done' ,
170
+ item : {
171
+ id : 'fs_mock' ,
172
+ status : 'completed' ,
173
+ type : 'file_search_call' ,
174
+ queries : [ 'mock' , 'mock query' ] ,
175
+ results : [
176
+ {
177
+ attributes : { } ,
178
+ file_id : 'mock_file_search_id' ,
179
+ filename : 'mock_filename' ,
180
+ score : 0.333 ,
181
+ text : 'Mocking RAG file annotations 1' ,
182
+ } ,
183
+ {
184
+ attributes : { } ,
185
+ file_id : 'mock_file_search_id' ,
186
+ filename : 'mock_filename' ,
187
+ score : 0.444 ,
188
+ text : 'Mocking RAG file annotations 2' ,
189
+ } ,
190
+ {
191
+ attributes : { } ,
192
+ file_id : 'mock_file_search_id' ,
193
+ filename : 'mock_filename' ,
194
+ score : 0.555 ,
195
+ text : 'Mocking RAG file annotations 3' ,
196
+ } ,
197
+ ] ,
198
+ } ,
199
+ } ,
165
200
...chunkedResponseText . map ( ( chunk ) => ( {
166
201
type : 'response.output_text.delta' as ResponseStreamEvent [ 'type' ] ,
167
202
item_id : 'msg_mock' ,
0 commit comments