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.

28 lines (25 loc) 721 B
import { ModelProvider } from '../types'; import { createOpenAICompatibleRuntime } from '../utils/openaiCompatibleFactory'; export const LobeWenxinAI = createOpenAICompatibleRuntime({ baseURL: 'https://qianfan.baidubce.com/v2', chatCompletion: { handlePayload: (payload) => { const { enabledSearch, ...rest } = payload; return { ...rest, stream: true, ...(enabledSearch && { web_search: { enable: true, enable_citation: true, enable_trace: true, }, }), } as any; }, }, debug: { chatCompletion: () => process.env.DEBUG_WENXIN_CHAT_COMPLETION === '1', }, provider: ModelProvider.Wenxin, });