mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-23 15:08:12 +02:00
feat: add OpenRouter client for AI product analysis.
This commit is contained in:
1 parent
b92ed905d7
commit
960045dc53
1 file changed
+4
-2
@@ -42,11 +42,13 @@ export class OpenRouterClient {
|
|||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
const content = data.choices?.[0]?.message?.content ?? "";
|
const content = data.choices?.[0]?.message?.content ?? "";
|
||||||
|
const reco = AnalysisEngine.extractRecommendation(content);
|
||||||
|
const cleanInsight = AnalysisEngine.cleanInsight(content);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
insight: AnalysisEngine.cleanInsight(content),
|
insight: reco ? `[${reco}] ${cleanInsight}` : cleanInsight,
|
||||||
codein: p.codein,
|
codein: p.codein,
|
||||||
recommandation: AnalysisEngine.extractRecommendation(content)
|
recommandation: reco
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user