You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.log('LLM requested image URL, using catbox fallback');
547
548
// Use catbox as fallback only when LLM explicitly requests it
548
549
fallbackToCatboxAnalysis();
@@ -660,9 +661,9 @@ function sendImageToLLM() {
660
661
// Log the image data info for debugging
661
662
console.log('Sending image to LLM. Image data length:',capturedImageData ? capturedImageData.length : 'null');
662
663
663
-
// Send image data directly to LLM for analysis
664
+
// Send image data directly to LLM for analysis with more specific instructions
664
665
constpayload={
665
-
message: `Please analyze the colors in this image and provide exactly 5 dominant colors in hex format. Response format: {"colors": ["#hex1", "#hex2", "#hex3", "#hex4", "#hex5"]}.`,
666
+
message: `I'm sending you an image captured from the R1 device's camera. Please analyze this image and extract exactly 5 dominant colors in hex format. Return ONLY a JSON object in this exact format: {"colors": ["#hex1", "#hex2", "#hex3", "#hex4", "#hex5"]}. Do not request an image URL as I'm sending the image data directly.`,
666
667
useLLM: true,
667
668
wantsR1Response: false,// Set to false to get JSON response
668
669
imageData: capturedImageData// Send image data directly
@@ -706,9 +707,9 @@ async function fallbackToCatboxAnalysis() {
706
707
thrownewError('Invalid image URL received');
707
708
}
708
709
709
-
// Send image URL to LLM for analysis
710
+
// Send image URL to LLM for analysis with clearer instructions
710
711
constpayload={
711
-
message: `Please analyze the colors in this image and provide exactly 5 dominant colors in hex format. Response format: {"colors": ["#hex1", "#hex2", "#hex3", "#hex4", "#hex5"]}. Image URL: ${imageUrl}`,
712
+
message: `I've uploaded the image to ${imageUrl}. Please analyze this image and extract exactly 5 dominant colors in hex format. Return ONLY a JSON object in this exact format: {"colors": ["#hex1", "#hex2", "#hex3", "#hex4", "#hex5"]}.`,
712
713
useLLM: true,
713
714
wantsR1Response: false// Set to false to get JSON response
0 commit comments