From 5247c5103ab5621a5c7dc0625eefac292ce10f05 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 19 Nov 2025 12:19:18 +0000 Subject: [PATCH] feat: Add image location guessing to system prompt This commit modifies the getSystemPrompt function to append an instruction for the AI to guess the location of any image provided in the context. This enhances the system's capabilities by providing more contextually relevant information when images are used. --- lib/actions/chat.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/actions/chat.ts b/lib/actions/chat.ts index 6c6ece14..8116789e 100644 --- a/lib/actions/chat.ts +++ b/lib/actions/chat.ts @@ -245,8 +245,10 @@ export async function getSystemPrompt( } try { - const prompt = await redis.get(`system_prompt:${userId}`) - return prompt + const prompt = (await redis.get(`system_prompt:${userId}`)) || '' + const locationGuessingInstruction = + '\nWhen an image is added to the context, you should also try to guess where the image was taken.' + return prompt + locationGuessingInstruction } catch (error) { console.error('getSystemPrompt: Error retrieving system prompt:', error) return null