diff --git a/src/components/PromptStarter/index.jsx b/src/components/PromptStarter/index.jsx index b4ab371c..7745a342 100644 --- a/src/components/PromptStarter/index.jsx +++ b/src/components/PromptStarter/index.jsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from "react"; import styles from "./styles.module.scss"; import ContextualMenu from "@site/src/components/ContextualMenu"; -import { getPromptDetails } from "./promptDetails"; +import { getPromptDetails } from "./prompts"; import { urls } from "../config"; import { analytics } from "@site/src/utils/analytics"; diff --git a/src/components/PromptStarter/promptDetails.js b/src/components/PromptStarter/promptDetails.js deleted file mode 100644 index 0ce796c6..00000000 --- a/src/components/PromptStarter/promptDetails.js +++ /dev/null @@ -1,17 +0,0 @@ -export const promptDetails = { - quickstart_prompt: { - description: "Build a working movie search app with natural language queries, vector search, and RAG in 5 steps.", - short: "The prompt will guide you to create a movie search demo application that uses natural language queries, vector and hybrid search to browse a movie collection.", - features: [ - "Create a Movie collection with text2vec-weaviate vectorizer", - "Import 5 sample movies (The Matrix, Inception, The Godfather, Spirited Away, The Dark Knight)", - "Use the query agent to retrieve information with natural language queries (only Python & TypeScript)", - "Implement vector, hybrid, and keyword search modes", - "Add Retrieval Augmented Generation (RAG) with Anthropic for AI-powered movie explanations" - ] - } -}; - -export function getPromptDetails(key) { - return promptDetails[key] || null; -} diff --git a/src/components/PromptStarter/prompts.js b/src/components/PromptStarter/prompts.js index d89da0e6..5ba09466 100644 --- a/src/components/PromptStarter/prompts.js +++ b/src/components/PromptStarter/prompts.js @@ -1,34 +1,16 @@ -// Prompts for all pages -// Add new page prompts here as they are created +import prompts from "@site/static/prompts/index.json"; -const BASE_URL = 'https://docs.weaviate.io'; +export const promptDetails = Object.fromEntries( + Object.entries(prompts).map(([key, prompt]) => [ + key, + { + description: prompt.description, + short: prompt.detailedDescription, + features: prompt.features, + }, + ]) +); -// Quickstart page prompts -const quickstartPrompts = { - python: `Open this site and follow the instructions: ${BASE_URL}/prompts/quickstart-python.md`, - typescript: `Open this site and follow the instructions: ${BASE_URL}/prompts/quickstart-typescript.md`, - go: `Open this site and follow the instructions: ${BASE_URL}/prompts/quickstart-go.md`, - java: `Open this site and follow the instructions: ${BASE_URL}/prompts/quickstart-java.md`, - csharp: `Open this site and follow the instructions: ${BASE_URL}/prompts/quickstart-csharp.md`, -}; - -// Map of page identifiers to their prompts -const prompts = { - quickstart: { prompt: quickstartPrompts }, - // Future pages can be added here: - // search: { prompt: searchPrompts }, - // agents: { prompt: agentsPrompts }, -}; - -// Cursor deeplink character limit -export const CURSOR_CHAR_LIMIT = 8000; - -// Helper to get prompts for a specific page -export function getPromptsForPage(page) { - const pagePrompts = prompts[page]; - if (!pagePrompts) { - console.warn(`No prompts found for page: ${page}. Available pages: ${Object.keys(prompts).join(", ")}`); - return null; - } - return pagePrompts; +export function getPromptDetails(key) { + return promptDetails[key] || null; } diff --git a/static/prompts/index.json b/static/prompts/index.json new file mode 100644 index 00000000..edaa3410 --- /dev/null +++ b/static/prompts/index.json @@ -0,0 +1,72 @@ +{ + "quickstart_prompt": { + "description": "Build a working movie search app with natural language queries, vector search, and RAG in 5 steps.", + "detailedDescription": "The prompt will guide you to create a movie search demo application that uses natural language queries, vector and hybrid search to browse a movie collection.", + "features": [ + "Create a Movie collection with text2vec-weaviate vectorizer", + "Import 5 sample movies (The Matrix, Inception, The Godfather, Spirited Away, The Dark Knight)", + "Use the query agent to retrieve information with natural language queries (only Python & TypeScript)", + "Implement vector, hybrid, and keyword search modes", + "Add Retrieval Augmented Generation (RAG) with Anthropic for AI-powered movie explanations" + ], + "languages": { + "python": { + "file": "quickstart-python.md", + "title": "Build a Weaviate Web App with FastAPI", + "framework": "FastAPI + Uvicorn", + "tags": [ + "Create Collection", + "Import Data", + "Query Agent", + "Hybrid Search", + "RAG" + ], + "packages": [ + "weaviate-client>=4.19.0", + "weaviate-agents>=1.2.0", + "fastapi", + "uvicorn", + "python-dotenv" + ] + }, + "typescript": { + "file": "quickstart-typescript.md", + "title": "Build a Weaviate Web App with Next.js", + "framework": "Next.js (App Router) + Tailwind CSS", + "tags": [ + "Create Collection", + "Import Data", + "Query Agent", + "Hybrid Search", + "RAG" + ], + "packages": ["weaviate-client@^3.11.0", "weaviate-agents@^1.1.0"] + }, + "go": { + "file": "quickstart-go.md", + "title": "Build a Weaviate Web App with Gin", + "framework": "Gin", + "tags": ["Create Collection", "Import Data", "Hybrid Search", "RAG"], + "packages": [ + "github.com/weaviate/weaviate-go-client/v5@v5.6.0", + "github.com/gin-gonic/gin", + "github.com/joho/godotenv" + ] + }, + "java": { + "file": "quickstart-java.md", + "title": "Build a Weaviate Web App with Spring Boot", + "framework": "Spring Boot", + "tags": ["Create Collection", "Import Data", "Hybrid Search", "RAG"], + "packages": ["io.weaviate:client:6.0.1"] + }, + "csharp": { + "file": "quickstart-csharp.md", + "title": "Build a Weaviate Web App with ASP.NET Core", + "framework": "ASP.NET Core MVC", + "tags": ["Create Collection", "Import Data", "Hybrid Search", "RAG"], + "packages": ["Weaviate.Client >= 1.0.0"] + } + } + } +}