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",
|
"duriin_db": "./archive.sqlite",
|
||||||
"intelligence_db": "./intelligence.sqlite",
|
"intelligence_db": "./intelligence.sqlite",
|
||||||
"llm": {
|
|
||||||
"baseUrl": "https://openrouter.ai/api/v1",
|
|
||||||
"model": "qwen/qwen3-235b-a22b-2507",
|
|
||||||
"apiKey": "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"
|
|
||||||
},
|
|
||||||
"workers": {
|
"workers": {
|
||||||
"relevanceBatchSize": 50,
|
"relevanceBatchSize": 50,
|
||||||
"relevanceLoopDelayMs": 2000,
|
"relevanceLoopDelayMs": 2000,
|
||||||
|
|
@ -38,7 +33,8 @@
|
||||||
"openRouter": {
|
"openRouter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"apiKey": "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",
|
"apiKey": "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",
|
||||||
"embeddingModel": "qwen/qwen3-embedding-8b"
|
"embeddingModel": "qwen/qwen3-embedding-8b",
|
||||||
|
"llmModel": "qwen/qwen3-235b-a22b-2507"
|
||||||
},
|
},
|
||||||
"gdelt": {
|
"gdelt": {
|
||||||
"source": "api",
|
"source": "api",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const { findMatchedCompaniesByEmbedding } = require("./embeddings");
|
||||||
|
|
||||||
async function runAugorWorker(archiveDb, intelligenceDb, config) {
|
async function runAugorWorker(archiveDb, intelligenceDb, config) {
|
||||||
const loopDelay = config.workers?.augorLoopDelayMs ?? 1500;
|
const loopDelay = config.workers?.augorLoopDelayMs ?? 1500;
|
||||||
const llmConfig = config.llm || {};
|
const llmConfig = config.openRouter || {};
|
||||||
|
|
||||||
const getPending = intelligenceDb.prepare(`
|
const getPending = intelligenceDb.prepare(`
|
||||||
SELECT * FROM article_queue WHERE status = 'pending' LIMIT 1
|
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) {
|
async function callLlm(llmConfig, prompt) {
|
||||||
const body = JSON.stringify({
|
const body = JSON.stringify({
|
||||||
model: llmConfig.model || "gpt-4o-mini",
|
model: llmConfig.llmModel || llmConfig.model,
|
||||||
messages: [{ role: "user", content: prompt }],
|
messages: [{ role: "user", content: prompt }],
|
||||||
temperature: 0.1,
|
temperature: 0.1,
|
||||||
});
|
});
|
||||||
|
|
||||||
const baseUrl = llmConfig.baseUrl || "https://api.openai.com";
|
const url = new URL("https://openrouter.ai/api/v1/chat/completions");
|
||||||
const url = new URL("/v1/chat/completions", baseUrl);
|
|
||||||
|
|
||||||
const responseText = await httpPost(url, body, {
|
const responseText = await httpPost(url, body, {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue