introduce concepts phase 1-2
This commit is contained in:
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
||||
const ToolSchema = z.object({
|
||||
name: z.string(),
|
||||
icon: z.string().optional().nullable(),
|
||||
type: z.string(),
|
||||
type: z.enum(['software', 'method', 'concept']), // Make this more explicit
|
||||
description: z.string(),
|
||||
domains: z.array(z.string()).optional().nullable().default([]),
|
||||
phases: z.array(z.string()).optional().nullable().default([]),
|
||||
@@ -127,15 +127,18 @@ export async function getToolsData(): Promise<ToolsData> {
|
||||
return cachedRandomizedData;
|
||||
}
|
||||
|
||||
// Get compressed data for AI (removes projectUrl and statusUrl)
|
||||
// Get compressed data for AI (removes projectUrl and statusUrl, excludes concepts)
|
||||
export async function getCompressedToolsDataForAI(): Promise<CompressedToolsData> {
|
||||
if (!cachedCompressedData) {
|
||||
const data = await getToolsData();
|
||||
|
||||
const compressedTools = data.tools.map(tool => {
|
||||
const { projectUrl, statusUrl, ...compressedTool } = tool;
|
||||
return compressedTool;
|
||||
});
|
||||
// Filter out concepts and compress remaining tools
|
||||
const compressedTools = data.tools
|
||||
.filter(tool => tool.type !== 'concept') // Exclude concepts from AI
|
||||
.map(tool => {
|
||||
const { projectUrl, statusUrl, ...compressedTool } = tool;
|
||||
return compressedTool;
|
||||
});
|
||||
|
||||
cachedCompressedData = {
|
||||
tools: compressedTools,
|
||||
|
||||
Reference in New Issue
Block a user