knowledgebase overhaul
This commit is contained in:
@@ -51,6 +51,7 @@ interface ToolsData {
|
||||
|
||||
interface CompressedToolsData extends Omit<ToolsData, 'tools'> {
|
||||
tools: any[];
|
||||
concepts: any[]; // NEW: Add concepts for AI background knowledge
|
||||
}
|
||||
|
||||
let cachedData: ToolsData | null = null;
|
||||
@@ -128,21 +129,30 @@ export async function getToolsData(): Promise<ToolsData> {
|
||||
return cachedRandomizedData;
|
||||
}
|
||||
|
||||
// Get compressed data for AI (removes projectUrl and statusUrl, excludes concepts)
|
||||
// Get compressed data for AI (excludes concepts from tools, but includes them separately for background knowledge)
|
||||
export async function getCompressedToolsDataForAI(): Promise<CompressedToolsData> {
|
||||
if (!cachedCompressedData) {
|
||||
const data = await getToolsData();
|
||||
|
||||
// Filter out concepts and compress remaining tools
|
||||
// Separate tools and concepts
|
||||
const compressedTools = data.tools
|
||||
.filter(tool => tool.type !== 'concept') // Exclude concepts from AI
|
||||
.filter(tool => tool.type !== 'concept') // Exclude concepts from tool recommendations
|
||||
.map(tool => {
|
||||
const { projectUrl, statusUrl, ...compressedTool } = tool;
|
||||
return compressedTool;
|
||||
});
|
||||
|
||||
// Extract concepts for background knowledge - keep essential fields only
|
||||
const concepts = data.tools
|
||||
.filter(tool => tool.type === 'concept')
|
||||
.map(concept => {
|
||||
const { projectUrl, statusUrl, platforms, accessType, license, ...compressedConcept } = concept;
|
||||
return compressedConcept;
|
||||
});
|
||||
|
||||
cachedCompressedData = {
|
||||
tools: compressedTools,
|
||||
concepts: concepts,
|
||||
domains: data.domains,
|
||||
phases: data.phases,
|
||||
'domain-agnostic-software': data['domain-agnostic-software']
|
||||
|
||||
Reference in New Issue
Block a user