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.

24 lines (17 loc) 603 B
import { SearchQuery } from '@lobechat/types'; import { toolsClient } from '@/libs/trpc/client'; class SearchService { search(query: string, optionalParams?: object) { return toolsClient.search.query.query({ optionalParams, query }); } crawlPage(url: string) { return toolsClient.search.crawlPages.mutate({ urls: [url] }); } crawlPages(params: { urls: string[] }) { return toolsClient.search.crawlPages.mutate(params); } async webSearch(params: SearchQuery) { return toolsClient.search.webSearch.query(params); } } export const searchService = new SearchService();