import { createOpenAI } from '@ai-sdk/openai'; import { GatewayFetchError } from '~~/server/utils/ai-provider'; import { Err, Ok } from '~~/types/result'; import type { ProviderModule } from '.'; export default { id: 'inception', baseUrl: 'https://api.inceptionlabs.ai/v1', modelsEndpoint: null, createGateway({ apiKey, baseURL }) { if (apiKey === undefined) { return Err(GatewayFetchError.NoProviderApiKey); } return Ok({ gateway: createOpenAI({ name: 'Inception', apiKey, baseURL }), streamTransformer: undefined, textTransformer: undefined, }); }, getAuthHeaders(apiKey) { return apiKey ? { Authorization: `Bearer ${apiKey}` } : {}; }, async fetchModels() { // inception doesn't have a model list endpoint so we hardcode them return [ { id: "mercury-2", name: "Mercury 2", attributes: { inputModalities: ['text'], outputModalities: ['text'], capabilities: ['tools', 'reasoning'], contextWindow: 128_000, } }, ]; }, } satisfies ProviderModule;