feat: implement text extraction pipeline and centralized LLM interface for knowledge graph generation
This commit is contained in:
@@ -149,6 +149,7 @@ export async function processSourceText(textContent, sourceName, { signal } = {}
|
|||||||
tools: [EMIT_KNOWLEDGE_GRAPH_TOOL],
|
tools: [EMIT_KNOWLEDGE_GRAPH_TOOL],
|
||||||
toolChoice: { type: 'tool', name: EMIT_KNOWLEDGE_GRAPH_TOOL.name },
|
toolChoice: { type: 'tool', name: EMIT_KNOWLEDGE_GRAPH_TOOL.name },
|
||||||
maxTokens: 8192,
|
maxTokens: 8192,
|
||||||
|
timeoutMs: 180_000,
|
||||||
limiter: extractionLimiter,
|
limiter: extractionLimiter,
|
||||||
signal,
|
signal,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ export async function callLLM(options) {
|
|||||||
async () => {
|
async () => {
|
||||||
if (limiter) await limiter.acquire({ signal });
|
if (limiter) await limiter.acquire({ signal });
|
||||||
const timeoutCtl = new AbortController();
|
const timeoutCtl = new AbortController();
|
||||||
const timer = setTimeout(() => timeoutCtl.abort(new DOMException('Timeout', 'AbortError')), timeoutMs);
|
const timer = setTimeout(() => timeoutCtl.abort(new DOMException('Timeout', 'TimeoutError')), timeoutMs);
|
||||||
const fetchSignal = linkSignals(signal, timeoutCtl.signal);
|
const fetchSignal = linkSignals(signal, timeoutCtl.signal);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user