import { GoogleSearchGenAI, GoogleSearchInput, GoogleSearchResponse } from '../adapter/GoogleSearchGenAI.js';
import { ModelName } from '../domain/ModelName.js';
export class GoogleSearchUseCase {
constructor(private readonly googleSearchGenAI: GoogleSearchGenAI) {}
async execute(
query: string,
instruction?: string,
model?: ModelName
): Promise<GoogleSearchResponse> {
const modelName = model || ModelName.create();
const input: GoogleSearchInput = {
query: query.trim(),
instruction,
model: modelName.toString()
};
return await this.googleSearchGenAI.search(input);
}
}