aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-06-11 13:01:44 -0400
committerbobzel <zzzman@gmail.com>2025-06-11 13:01:44 -0400
commit05845fa3e5a6d71a58845d058a15233ccf6d72c0 (patch)
treeb7ee99e171a2595d6656f15e2cfdcd596ccf4cc3 /src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx
parentb4db1e2467337468139d0e92ef94799c4143a0fc (diff)
refactor unwrapPlaceholder duplicated code to DocUtils.
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx b/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx
index 038b1c6f9..e3a3f9b05 100644
--- a/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx
+++ b/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx
@@ -158,10 +158,9 @@ export class ImageLabelBox extends ViewBoxBaseComponent<FieldViewProps>() {
this._currentLabel = e.target.value;
});
- classifyImagesInBox = async (selectedImages? : Doc[], prompt? : string) => {
+ classifyImagesInBox = async () => {
this.startLoading();
- alert('Classifying images...');
- selectedImages ??= this._selectedImages;
+ const selectedImages = this._selectedImages;
// Converts the images into a Base64 format, afterwhich the information is sent to GPT to label them.
@@ -170,7 +169,7 @@ export class ImageLabelBox extends ViewBoxBaseComponent<FieldViewProps>() {
const url = ImageCastWithSuffix(doc[Doc.LayoutDataKey(doc)], '_o') ?? '';
return imageUrlToBase64(url).then(hrefBase64 =>
!hrefBase64 ? undefined :
- gptImageLabel(hrefBase64, prompt ?? 'Give three labels to describe this image.').then(labels =>
+ gptImageLabel(hrefBase64, 'Give three labels to describe this image.').then(labels =>
({ doc, labels }))) ; // prettier-ignore
}
});