improve reasoning toggle tests and refactor model capability checks
This commit is contained in:
+6
-5
@@ -414,10 +414,11 @@ export function createChatsRouter({repositories, chatService, modelService, conf
|
||||
chatId: req.validatedBody.chatId,
|
||||
message: req.validatedBody.message,
|
||||
model: req.validatedBody.model,
|
||||
webSearch: req.validatedBody.webSearch
|
||||
webSearch: req.validatedBody.webSearch,
|
||||
reasoning: req.validatedBody.reasoning
|
||||
});
|
||||
if (result.error) return res.status(result.status).json({error: result.error});
|
||||
return res.json({reply: result.reply, ...(result.sources ? {sources: result.sources} : {})});
|
||||
if (result.error) return res.status(result.status).json({error: result.error, ...(result.searchState ? {searchState: result.searchState} : {})});
|
||||
return res.json({reply: result.reply, searchState: result.searchState, ...(result.sources ? {sources: result.sources} : {})});
|
||||
} catch (error) {
|
||||
const mapped = modelService.mapError(error);
|
||||
return res.status(mapped.status).json(mapped.body);
|
||||
@@ -457,9 +458,9 @@ export function createChatsRouter({repositories, chatService, modelService, conf
|
||||
signal: generationController.signal
|
||||
});
|
||||
if (result.error) {
|
||||
sendEvent("error", {error: result.error});
|
||||
sendEvent("error", {error: result.error, ...(result.searchState ? {searchState: result.searchState} : {})});
|
||||
} else {
|
||||
sendEvent("done", {reply: result.reply, ...(result.sources ? {sources: result.sources} : {})});
|
||||
sendEvent("done", {reply: result.reply, searchState: result.searchState, ...(result.sources ? {sources: result.sources} : {})});
|
||||
}
|
||||
} catch (error) {
|
||||
const mapped = modelService.mapError(error);
|
||||
|
||||
Reference in New Issue
Block a user