Skip to content

evaluateComplexity

evaluateComplexity(llm, task, context, config?): Promise<ComplexityScore>

Defined in: scoring/evaluator.ts:211

Full evaluation using an LLM

LLMEvaluator

string

string

EvaluatorConfig = {}

Promise<ComplexityScore>

// With Ollama
const evaluate = async (prompt: string) => {
const res = await fetch('http://localhost:11434/api/generate', {
method: 'POST',
body: JSON.stringify({ model: 'qwen2.5-coder', prompt, stream: false })
});
return (await res.json()).response;
};
const score = await evaluateComplexity(evaluate, 'Fix the bug', codeDiff);
console.log(score.tier); // 'simple'
console.log(score.weighted); // 3.5