Enable automatic web search by default; improve toggle behavior and search planning.
This commit is contained in:
@@ -22,7 +22,10 @@ async function fixture(t) {
|
||||
});
|
||||
await new Promise(resolve => search.listen(0, "127.0.0.1", resolve));
|
||||
const modelService = {
|
||||
async generateReply() { return `Original ${++sequence}`; },
|
||||
async generateReply(_model, _messages, options) {
|
||||
if (options.format?.properties?.search) return '{"search":false,"query":""}';
|
||||
return `Original ${++sequence}`;
|
||||
},
|
||||
async streamReply(model, messages, chunk, options) {
|
||||
calls.push({model, messages, options});
|
||||
if (options.reasoning) options.onThinking("New reasoning", "New reasoning");
|
||||
@@ -59,7 +62,7 @@ async function fixture(t) {
|
||||
};
|
||||
await api("/register", {username: "regenerator", password: "test-password"});
|
||||
const chatId = (await (await api("/chats", {title: "Versions"})).json()).chat.id;
|
||||
await api("/chat", {chatId, message: "Search the web for the latest satellite launch news today"});
|
||||
await api("/chat", {chatId, message: "Search the web for the latest satellite launch news today", webSearch: false});
|
||||
await api("/chat", {chatId, message: "Later private question"});
|
||||
const messages = (await (await api(`/chats/${chatId}/messages`)).json()).messages;
|
||||
const bot = messages[1];
|
||||
@@ -122,7 +125,7 @@ test("regeneration streams before commit in the same message; versions retain so
|
||||
assert.equal((await s.history())[1].content, "Edited original");
|
||||
assert.equal((await s.api(`${s.path}/versions/99`, {})).status, 400);
|
||||
s.setMode("success");
|
||||
const third = await (await s.api(`${s.path}/retry/stream`, {})).text();
|
||||
const third = await (await s.api(`${s.path}/retry/stream`, {webSearch: false})).text();
|
||||
assert.match(third, /event: done/);
|
||||
const thirdMessage = (await s.history())[1];
|
||||
assert.equal(thirdMessage.versionCount, 3);
|
||||
|
||||
Reference in New Issue
Block a user