u
This commit is contained in:
@@ -294,7 +294,7 @@ async function parseDocumentManifest({ req, res, pages, sourceLabel }) {
|
||||
});
|
||||
|
||||
// ── LLMOrbiter setup ─────────────────────────────────────────────
|
||||
const model = 'stealth/space-bunny-alpha';//'~openai/gpt-luna-latest:floor';
|
||||
const model = env.defaultModel;
|
||||
const provider = new OpenRouterProvider({ apiKey });
|
||||
const orbiter = new LLMOrbiter(provider, {
|
||||
onStatus: (status) => {
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import * as db from '../../db/modelconversation.js';
|
||||
import env from '../../config/env.js';
|
||||
|
||||
// Model ids that are known to return empty responses from OpenRouter. Requests naming one of
|
||||
// these are transparently rerouted to `env.defaultModel` instead of failing at generation time.
|
||||
const RETIRED_MODELS = new Set(['stealth/space-bunny-alpha']);
|
||||
import { emit } from '../sse.js';
|
||||
import { getOrCreateManager, removeManager } from '../../services/conversationManager.js';
|
||||
|
||||
@@ -145,8 +150,16 @@ export function register(app, basePath = '') {
|
||||
|
||||
const { provider, model } = req.body ?? {};
|
||||
|
||||
// Clients may still send the retired `stealth/space-bunny-alpha` id, which now returns
|
||||
// empty responses from the provider. Map it onto the configured default rather than
|
||||
// ignoring the client's choice entirely, so an explicit model selection still works.
|
||||
const requestedModel = typeof model === 'string' ? model.trim() : '';
|
||||
const effectiveModel = RETIRED_MODELS.has(requestedModel) || !requestedModel
|
||||
? env.defaultModel
|
||||
: requestedModel;
|
||||
|
||||
try {
|
||||
const conversation = await db.create(req.user.id, { provider, model });
|
||||
const conversation = await db.create(req.user.id, { provider, model: effectiveModel });
|
||||
emit('modelconversation', { companyId: selected.companyId });
|
||||
res.status(201).json({ conversation });
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user