fix assistant widget configuration

This commit is contained in:
ajnart committed 2026-08-03 16:43:08 +02:00
1 parent bd3e4c33f3
commit 35673f113e
20 files changed
+762 -12

No files matched your search

@@ -0,0 +1,25 @@
import { describe, expect, test } from "vitest";
import { withOpenRouterWebSearch } from "./assistant-openrouter";
describe("withOpenRouterWebSearch", () => {
test("adds the current OpenRouter server tool alongside Homarr function tools", () => {
expect(
withOpenRouterWebSearch({
model: "deepseek/deepseek-v4-flash-latest",
tools: [{ type: "function", function: { name: "board_addItem", parameters: {} } }],
}),
).toMatchObject({
tools: [
{ type: "function", function: { name: "board_addItem" } },
{ type: "openrouter:web_search", parameters: { max_results: 5 } },
],
});
});
test("does not register the web search tool twice", () => {
const body = { tools: [{ type: "openrouter:web_search", parameters: { max_results: 3 } }] };
expect(withOpenRouterWebSearch(body)).toBe(body);
});
});