Skip to content

Commit 648e021

Browse files
committed
fix fileSearchTool call for non course chat
1 parent f15f2e9 commit 648e021

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/server/util/azure/ResponsesAPI.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ export class ResponsesClient {
5252
this.instructions = courseAssistant.assistant_instruction
5353

5454
const fileSearchTool = courseId
55-
? createFileSearchTool({
56-
vectorStoreId: courseAssistant.vector_store_id,
57-
})
58-
: null
59-
60-
this.tools = [fileSearchTool]
55+
? [
56+
createFileSearchTool({
57+
vectorStoreId: courseAssistant.vector_store_id,
58+
}),
59+
]
60+
: [] // needs to retrun empty array for null
61+
62+
this.tools = fileSearchTool
6163
}
6264

6365
async createResponse({ input }: { input: ResponseInput }): Promise<Stream<ResponseStreamEvent> | APIError> {

0 commit comments

Comments
 (0)