aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis/gpt/GPT.ts
diff options
context:
space:
mode:
authorsharkiecodes <lanyi_stroud@brown.edu>2025-06-05 22:48:33 -0400
committersharkiecodes <lanyi_stroud@brown.edu>2025-06-05 22:48:33 -0400
commit42b35b687f081e579cbec524426105df3ac695ef (patch)
tree1fdfd3e14699f5e34c1cc6aedb96316ece746a36 /src/client/apis/gpt/GPT.ts
parent7626527799c0606fa9c4fd4d26a19189dc7e7a0e (diff)
attempting marqueeview gen of multiple scrapbooks
Diffstat (limited to 'src/client/apis/gpt/GPT.ts')
-rw-r--r--src/client/apis/gpt/GPT.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/client/apis/gpt/GPT.ts b/src/client/apis/gpt/GPT.ts
index 03fce21f7..4642d79eb 100644
--- a/src/client/apis/gpt/GPT.ts
+++ b/src/client/apis/gpt/GPT.ts
@@ -14,7 +14,7 @@ export const DocSeperator = '------';
export enum TextClassifications {
Title = 'title', //a few words
Caption = 'caption', //few sentences
- LengthyDescription = 'lengthy description' }
+ LengthyDescription = 'lengthy' }
enum GPTCallType {
SUMMARY = 'summary',
@@ -106,8 +106,10 @@ const callTypeMap: { [type in GPTCallType]: GPTCallOpts } = {
model: 'gpt-4o',
maxTokens: 2048,
temp: 0.25,
- prompt: `Based on the content of the text, provide six descriptive tags (single words) separated by spaces.
- Finally, include a seventh more detailed summary phrase using underscores.`
+ prompt: `Based on the content of the the text, classify it into the
+ most appropriate category: '${TextClassifications.Title}', '${TextClassifications.Caption}', or '${TextClassifications.LengthyDescription}'.
+ Then provide five more descriptive tags (single words) separated by spaces.
+ Finally, include a more detailed summary phrase tag using underscores, for a total of seven tags.`
},
describe: { model: 'gpt-4-vision-preview', maxTokens: 2048, temp: 0, prompt: 'Describe these images in 3-5 words' },
flashcard: {
@@ -175,14 +177,15 @@ const callTypeMap: { [type in GPTCallType]: GPTCallOpts } = {
prompt: `Generate an aesthetically pleasing scrapbook layout preset based on these items.
Return your response as JSON in the format:
[{
- "type": DocumentType.RTF or DocumentType.IMG or DocumentType.PDF
+ "type": rich text or image or pdf or video or collection
"tag": a singular tag summarizing the document
+ "acceptTags": [a list of all relevant tags that this document accepts, like ['PERSON', 'LANDSCAPE']]
"x": number,
"y": number,
- "width": number,
+ "width": number, **note: if it is in an image, please respect existing aspect ratio if it is provided
"height": number
}, ...]
- If there are mutliple documents, you may include
+ If there are mutliple documents and you wish to nest documents into a collection for aesthetic purposes, you may include
"children": [
{ type:
tag: