mirror of
https://github.com/FJurmanovic/sugarr.git
synced 2026-11-11 15:51:09 +00:00
Add MovieRecommenderTool and MovieSearchTool
This commit is contained in:
15
test/app/tools/MovieSearchTool.test.ts
Normal file
15
test/app/tools/MovieSearchTool.test.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { MovieSearchTool } from '../../../src/app/tools/MovieSearchTool';
|
||||
import type { RunContext } from '../../../src/core/llm/RunContext';
|
||||
|
||||
describe('MovieSearchTool.buildVariables', () => {
|
||||
it('passes the query and requested count through as prompt variables', () => {
|
||||
const tool = new MovieSearchTool(
|
||||
{} as unknown as ConstructorParameters<typeof MovieSearchTool>[0],
|
||||
{} as unknown as ConstructorParameters<typeof MovieSearchTool>[1]
|
||||
) as unknown as { buildVariables(input: unknown, ctx: RunContext): Record<string, unknown> };
|
||||
|
||||
const variables = tool.buildVariables({ query: 'sci-fi like Blade Runner', count: 5 }, {} as RunContext);
|
||||
expect(variables).toEqual({ query: 'sci-fi like Blade Runner', count: 5 });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user