@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.
34 lines (28 loc) • 994 B
text/typescript
import { ModelProvider } from 'model-bank';
import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
export interface InfiniAIModelCard {
id: string;
}
export const LobeInfiniAI = createOpenAICompatibleRuntime({
baseURL: 'https://cloud.infini-ai.com/maas/v1',
chatCompletion: {
handlePayload: (payload) => {
const { model, thinking, ...rest } = payload;
return {
...rest,
enable_thinking: thinking !== undefined ? thinking.type === 'enabled' : false,
model,
} as any;
},
},
debug: {
chatCompletion: () => process.env.DEBUG_INFINIAI_CHAT_COMPLETION === '1',
},
models: async ({ client }) => {
const modelsPage = (await client.models.list()) as any;
const modelList: InfiniAIModelCard[] = modelsPage.data;
return processMultiProviderModelList(modelList, 'infiniai');
},
provider: ModelProvider.InfiniAI,
});