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.

18 lines (15 loc) 589 B
import { ModelProvider } from '../types'; import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory'; import { transformSparkResponseToStream, SparkAIStream } from '../utils/streams'; export const LobeSparkAI = LobeOpenAICompatibleFactory({ baseURL: 'https://spark-api-open.xf-yun.com/v1', chatCompletion: { handleStream: SparkAIStream, handleTransformResponseToStream: transformSparkResponseToStream, noUserId: true, }, debug: { chatCompletion: () => process.env.DEBUG_SPARK_CHAT_COMPLETION === '1', }, provider: ModelProvider.Spark, });