feat: configure deep search llm models

This commit is contained in:
john
2026-07-23 22:46:10 +08:00
parent be1e4c18c0
commit 784a10a592
11 changed files with 360 additions and 35 deletions
+11 -2
View File
@@ -1,7 +1,10 @@
import http from 'node:http';
import path from 'node:path';
import { pathToFileURL } from 'node:url';
import { createDeepSearchEngine } from './deep-search-engine.mjs';
import {
createDeepSearchEngine,
createPortalGatewayResearchLlmResolver,
} from './deep-search-engine.mjs';
import { createDeepSearchStore } from './deep-search-store.mjs';
function sendJson(res, status, body) {
@@ -83,6 +86,8 @@ export function createDeepSearchHttpServer({
const task = engine.start({
...input,
userId: requestUserId || input.userId || null,
llmProviderKeyId: input.llmProviderKeyId || input.llm_provider_key_id || '',
llmModel: input.llmModel || input.llm_model || '',
});
return sendJson(res, 202, {
task_id: task.taskId,
@@ -163,7 +168,11 @@ export function startDeepSearchServer({
logger = console,
} = {}) {
const store = createDeepSearchStore({ databasePath });
const engine = createDeepSearchEngine({ store });
const engine = createDeepSearchEngine({
store,
llm: null,
llmResolver: createPortalGatewayResearchLlmResolver(),
});
const server = createDeepSearchHttpServer({ engine, logger });
server.listen(port, host, () => {
logger.info?.(`[deep-search] listening on http://${host}:${port}`);