fix assistant widget configuration

This commit is contained in:
ajnart committed 2026-08-14 11:32:10 +02:00
1 parent 8d06201b41
commit 1f60b4b4be
16 files changed
+696 -11

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);
});
});