From 6900008b1bb89cca1eab7b95f17ee33fa335282f Mon Sep 17 00:00:00 2001
From: sharkiecodes <lanyi_stroud@brown.edu>
Date: Mon, 28 Apr 2025 20:18:26 -0400
Subject: adding autotagging

---
 src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx b/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx
index ff9fb14e7..28d3ccd48 100644
--- a/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx
+++ b/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx
@@ -158,7 +158,7 @@ export class ImageLabelBox extends ViewBoxBaseComponent<FieldViewProps>() {
         this._currentLabel = e.target.value;
     });
 
-    classifyImagesInBox = async () => {
+    classifyImagesInBox = async (prompt? : string) => {
         this.startLoading();
 
         // Converts the images into a Base64 format, afterwhich the information is sent to GPT to label them.
@@ -168,7 +168,7 @@ export class ImageLabelBox extends ViewBoxBaseComponent<FieldViewProps>() {
                 const url = ImageCastWithSuffix(doc[Doc.LayoutDataKey(doc)], '_o') ?? '';
                 return imageUrlToBase64(url).then(hrefBase64 =>
                 !hrefBase64 ? undefined : 
-                    gptImageLabel(hrefBase64,'Give three labels to describe this image.').then(labels => 
+                    gptImageLabel(hrefBase64, prompt ?? 'Give three labels to describe this image.').then(labels => 
                         ({ doc, labels }))) ; // prettier-ignore
             }
         });
-- 
cgit v1.2.3-70-g09d2

