update augorWorker to use openRouter configuration and set llmModel in config
This commit is contained in:
parent
0fbdc21861
commit
17107047fe
2 changed files with 5 additions and 10 deletions
|
|
@ -1,11 +1,6 @@
|
|||
{
|
||||
"duriin_db": "./archive.sqlite",
|
||||
"intelligence_db": "./intelligence.sqlite",
|
||||
"llm": {
|
||||
"baseUrl": "https://openrouter.ai/api/v1",
|
||||
"model": "qwen/qwen3-235b-a22b-2507",
|
||||
"apiKey": "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"
|
||||
},
|
||||
"workers": {
|
||||
"relevanceBatchSize": 50,
|
||||
"relevanceLoopDelayMs": 2000,
|
||||
|
|
@ -38,7 +33,8 @@
|
|||
"openRouter": {
|
||||
"enabled": true,
|
||||
"apiKey": "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",
|
||||
"embeddingModel": "qwen/qwen3-embedding-8b"
|
||||
"embeddingModel": "qwen/qwen3-embedding-8b",
|
||||
"llmModel": "qwen/qwen3-235b-a22b-2507"
|
||||
},
|
||||
"gdelt": {
|
||||
"source": "api",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const { findMatchedCompaniesByEmbedding } = require("./embeddings");
|
|||
|
||||
async function runAugorWorker(archiveDb, intelligenceDb, config) {
|
||||
const loopDelay = config.workers?.augorLoopDelayMs ?? 1500;
|
||||
const llmConfig = config.llm || {};
|
||||
const llmConfig = config.openRouter || {};
|
||||
|
||||
const getPending = intelligenceDb.prepare(`
|
||||
SELECT * FROM article_queue WHERE status = 'pending' LIMIT 1
|
||||
|
|
@ -165,13 +165,12 @@ Only include claims directly supported by the articles. Use empty arrays if noth
|
|||
|
||||
async function callLlm(llmConfig, prompt) {
|
||||
const body = JSON.stringify({
|
||||
model: llmConfig.model || "gpt-4o-mini",
|
||||
model: llmConfig.llmModel || llmConfig.model,
|
||||
messages: [{ role: "user", content: prompt }],
|
||||
temperature: 0.1,
|
||||
});
|
||||
|
||||
const baseUrl = llmConfig.baseUrl || "https://api.openai.com";
|
||||
const url = new URL("/v1/chat/completions", baseUrl);
|
||||
const url = new URL("https://openrouter.ai/api/v1/chat/completions");
|
||||
|
||||
const responseText = await httpPost(url, body, {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue