diff options
| author | sharkiecodes <lanyi_stroud@brown.edu> | 2025-04-28 20:18:26 -0400 |
|---|---|---|
| committer | sharkiecodes <lanyi_stroud@brown.edu> | 2025-04-28 20:18:26 -0400 |
| commit | 6900008b1bb89cca1eab7b95f17ee33fa335282f (patch) | |
| tree | 3912cf8d02f294de53a78a23bc6747e1ed28c06c /src/client/views/collections/collectionFreeForm | |
| parent | 10bd1bd27df3347ec7d50d8c49c1a65730db96a6 (diff) | |
adding autotagging
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
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 } }); |
