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
Copy file name to clipboardExpand all lines: js/mood-palette.js
+9-43Lines changed: 9 additions & 43 deletions
Original file line number
Diff line number
Diff line change
@@ -527,27 +527,6 @@ function resetApp() {
527
527
showStatus('PRESS CAPTURE TO START CAMERA','info');
528
528
}
529
529
530
-
// Function to send extracted colors to LLM for processing
531
-
functionsendColorsToLLM(colors){
532
-
showStatus('SENDING COLORS TO LLM...','info');
533
-
534
-
try{
535
-
// Send color data to LLM for processing
536
-
constpayload={
537
-
message: `I've analyzed an image captured from the R1 device's camera and extracted these 5 dominant colors: ${colors.join(', ')}. Please provide a creative description of the mood or theme these colors represent, and suggest a name for this color palette. Return ONLY a JSON object in this exact format: {"paletteName": "name", "description": "description"}`,
538
-
useLLM: true,
539
-
wantsR1Response: false// Set to false to get JSON response
540
-
};
541
-
542
-
console.log('Sending colors to LLM with payload:',JSON.stringify(payload,null,2));
@@ -701,27 +671,23 @@ function createColorShapes(colors) {
701
671
returnshapesContainer;
702
672
}
703
673
704
-
// Function to send image directly to LLM for analysis (deprecated - now using color extraction)
705
-
functionsendImageToLLM(){
706
-
showStatus('SENDING IMAGE TO LLM...','info');
674
+
// Function to send extracted colors to LLM for processing
675
+
functionsendColorsToLLM(colors){
676
+
showStatus('SENDING COLORS TO LLM...','info');
707
677
708
678
try{
709
-
// Log the image data info for debugging
710
-
console.log('Sending image to LLM. Image data length:',capturedImageData ? capturedImageData.length : 'null');
711
-
712
-
// Send image data directly to LLM for analysis with specific instructions
679
+
// Send color data to LLM for processing
713
680
constpayload={
714
-
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.`,
681
+
message: `I've analyzed an image captured from the R1 device's camera and extracted these 5 dominant colors: ${colors.join(', ')}. Please provide a creative description of the mood or theme these colors represent, and suggest a name for this color palette. Return ONLY a JSON object in this exact format: {"paletteName": "name", "description": "description"}`,
715
682
useLLM: true,
716
-
wantsR1Response: false,// Set to false to get JSON response
717
-
imageData: capturedImageData// Send image data directly
683
+
wantsR1Response: false// Set to false to get JSON response
718
684
};
719
685
720
-
console.log('Sending image to LLM with payload:',JSON.stringify(payload,null,2));
686
+
console.log('Sending colors to LLM with payload:',JSON.stringify(payload,null,2));
0 commit comments