diff --git a/docs/comprehensive_tech_spec.md b/docs/comprehensive_tech_spec.md index 1756602..67b72f7 100644 --- a/docs/comprehensive_tech_spec.md +++ b/docs/comprehensive_tech_spec.md @@ -57,7 +57,7 @@ export interface IntentRouterOutput { ``` ### **Step 2: Define "Intent Router" System Prompt** -This prompt will be used by a `gemini-2.5-flash` model to process and classify all incoming data. +This prompt will be used by a `gemini-1.5-flash` model to process and classify all incoming data. ```text # System Prompt: Constellation Engine Intent Router diff --git a/docs/implementation_plan.md b/docs/implementation_plan.md index a8fdf9f..c6518a4 100644 --- a/docs/implementation_plan.md +++ b/docs/implementation_plan.md @@ -187,7 +187,7 @@ This phase implements the logic for getting new data into the Unified Lake. **2.1. Technical Specification: Intent Router** -* **Objective:** Create a system prompt for `gemini-2.5-flash` to classify and structure incoming data. +* **Objective:** Create a system prompt for `gemini-1.5-flash` to classify and structure incoming data. * **Content:** ```text # System Prompt: Constellation Engine Intent Router @@ -276,7 +276,7 @@ This phase focuses on migrating existing data from the GitHub repository into th * Uses the Intent Router prompt to process raw text content. */ async function generateUnifiedMetadata(content: string): Promise { - const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" }); // Or your fine-tuned model + const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" }); // Or your fine-tuned model const prompt = `# System Prompt: Constellation Engine Intent Router ... The Intent Router System Prompt ...\n\nINPUT:\n${content}`; // Replace with actual prompt from phase 2 diff --git a/scripts/migrateLegacy.ts b/scripts/migrateLegacy.ts index e02aad5..3b60c48 100644 --- a/scripts/migrateLegacy.ts +++ b/scripts/migrateLegacy.ts @@ -90,7 +90,7 @@ function extractDateFromMetadata(filePath: string, content: string): string | nu } async function generateUnifiedMetadata(content: string): Promise { - const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" }); + const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" }); const result = await model.generateContent(`${INTENT_ROUTER_PROMPT}\n\nINPUT:\n${content}`); const jsonText = result.response.text().replace(/```json\n?|\n?```/g, '').trim(); return JSON.parse(jsonText) as ExtendedIntentRouterOutput; diff --git a/src/biographerAsync.ts b/src/biographerAsync.ts index c193717..9c11ba7 100644 --- a/src/biographerAsync.ts +++ b/src/biographerAsync.ts @@ -184,7 +184,7 @@ export async function handler(event: AsyncPayload) { - Do not use markdown code blocks (\`\`\`markdown). `; - const generativeModel = genAI.getGenerativeModel({ model: "gemini-2.5-flash" }); + const generativeModel = genAI.getGenerativeModel({ model: "gemini-1.5-flash" }); const result = await generativeModel.generateContent(systemPrompt); const newLifeLogContent = sanitizeMarkdown(result.response.text()); diff --git a/src/dreams.ts b/src/dreams.ts index 098aa66..8ca6f93 100644 --- a/src/dreams.ts +++ b/src/dreams.ts @@ -75,7 +75,7 @@ export async function handler(event: APIGatewayProxyEvent): Promise => { } // 2. Curate & Dedupe: Call Gemini - const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" }); + const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" }); const prompt = `You are a curator. Review this list of 20 books. Your task is to select the single best book that fits the provided rationale. **Rationale:** ${rationale} diff --git a/src/librarian/strategicAnalysis.ts b/src/librarian/strategicAnalysis.ts index 0187fd5..6518e4d 100644 --- a/src/librarian/strategicAnalysis.ts +++ b/src/librarian/strategicAnalysis.ts @@ -53,7 +53,7 @@ export const handler = async (event: { recentEntries: ConstellationRecord[] }): }).join("\n\n---\n\n"); const model = genAI.getGenerativeModel({ - model: "gemini-2.5-flash", + model: "gemini-1.5-flash", systemInstruction: `Analyze the user's recent entries (notes, saved articles, thoughts). Identify the core topics and interests. Pay attention to the metadata (tags, media types). diff --git a/src/librarian/synthesizeInsights.ts b/src/librarian/synthesizeInsights.ts index 72ac7e3..61c7c66 100644 --- a/src/librarian/synthesizeInsights.ts +++ b/src/librarian/synthesizeInsights.ts @@ -83,7 +83,7 @@ export const handler = async (event: HandlerInput): Promise => { return `## No new recommendations were found in this run.`; } - const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" }); + const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" }); // Format entries for the prompt const entriesContext = recentEntries.map(entry => { diff --git a/src/lyrics.ts b/src/lyrics.ts index 48e2cab..716b236 100644 --- a/src/lyrics.ts +++ b/src/lyrics.ts @@ -118,7 +118,7 @@ INSTRUCTIONS: CONSTRAINT: Do not alter the raw text of the lyrics. Only group and arrange them. IMPORTANT: Output RAW markdown only. Do not wrap the output in markdown code blocks. Do not include any conversational text.`; - const generativeModel = genAI.getGenerativeModel({ model: "gemini-2.5-flash" }); + const generativeModel = genAI.getGenerativeModel({ model: "gemini-1.5-flash" }); const result = await generativeModel.generateContent(systemPrompt); let newSongSeeds = result.response.text(); diff --git a/src/philosopher.ts b/src/philosopher.ts index 86c42e4..3084ead 100644 --- a/src/philosopher.ts +++ b/src/philosopher.ts @@ -133,7 +133,7 @@ ${contextEntries} - Do not use markdown code blocks ( `; - const generativeModel = genAI.getGenerativeModel({ model: "gemini-2.5-flash" }); + const generativeModel = genAI.getGenerativeModel({ model: "gemini-1.5-flash" }); const result = await generativeModel.generateContent(systemPrompt); const newGardenContent = sanitizeMarkdown(result.response.text()); diff --git a/src/utils.ts b/src/utils.ts index 4051e1f..c1f183b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -17,7 +17,7 @@ const GITHUB_REPO = Resource.GITHUB_REPO.value; * @param model The model to use for embedding. * @returns The embedding vector. */ -export async function getEmbedding(content: string, model = "text-embedding-004"): Promise { +export async function getEmbedding(content: string, model = "embedding-001"): Promise { const embeddingModel = genAI.getGenerativeModel({ model }); const embeddingResult = await embeddingModel.embedContent(content); return embeddingResult.embedding.values; diff --git a/sst.config.ts b/sst.config.ts index e68c587..9bf2c3f 100644 --- a/sst.config.ts +++ b/sst.config.ts @@ -232,7 +232,7 @@ export default $config({ api.route("POST /dream", { handler: "src/librarian/dreamer.handler", - link: [GEMINI_API_KEY, PINECONE_API_KEY, PINECONE_INDEX_HOST, table, auth], + link: [GEMINI_API_KEY, PINECONE_API_KEY, PINECONE_INDEX_HOST, table, auth, GITHUB_TOKEN, GITHUB_OWNER, GITHUB_REPO], timeout: "90 seconds", }, { auth: { @@ -332,7 +332,7 @@ export default $config({ schedule: "rate(1 day)", job: { handler: "src/librarian/dreamer.handler", - link: [GEMINI_API_KEY, PINECONE_API_KEY, PINECONE_INDEX_HOST, table], + link: [GEMINI_API_KEY, PINECONE_API_KEY, PINECONE_INDEX_HOST, table, GITHUB_TOKEN, GITHUB_OWNER, GITHUB_REPO], timeout: "90 seconds", } });