UNPKG

@lobehub/chat

Version:

Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.

36 lines (30 loc) 1.02 kB
import { FileSearchImpl, createFileSearchModule } from '@/modules/fileSearch'; import { FileResult, SearchOptions } from '@/types/fileSearch'; import { ServiceModule } from './index'; /** * File Search Service * Main service class that uses platform-specific implementations internally */ export default class FileSearchService extends ServiceModule { private impl: FileSearchImpl = createFileSearchModule(); /** * Perform file search */ async search(query: string, options: Omit<SearchOptions, 'keywords'> = {}): Promise<FileResult[]> { return this.impl.search({ ...options, keywords: query }); } /** * Check search service status */ async checkSearchServiceStatus(): Promise<boolean> { return this.impl.checkSearchServiceStatus(); } /** * Update search index * @param path Optional specified path * @returns Promise indicating operation success */ async updateSearchIndex(path?: string): Promise<boolean> { return this.impl.updateSearchIndex(path); } }