aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis/gpt
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/apis/gpt')
-rw-r--r--src/client/apis/gpt/GPT.ts41
1 files changed, 33 insertions, 8 deletions
diff --git a/src/client/apis/gpt/GPT.ts b/src/client/apis/gpt/GPT.ts
index 4dd30f8b3..03fce21f7 100644
--- a/src/client/apis/gpt/GPT.ts
+++ b/src/client/apis/gpt/GPT.ts
@@ -30,7 +30,6 @@ enum GPTCallType {
DRAW = 'draw',
COLOR = 'color',
TEMPLATE = 'template',
- SCRAPBOOK = 'scrapbook',
VIZSUM = 'vizsum',
VIZSUM2 = 'vizsum2',
FILL = 'fill',
@@ -41,7 +40,9 @@ enum GPTCallType {
SUBSETDOCS = 'subset_docs', // select a subset of documents based on their descriptions
DOCINFO = 'doc_info', // provide information about a document
SORTDOCS = 'sort_docs',
- CLASSIFYTEXT = 'classify_text', // classify text into one of the three categories: title, caption, lengthy description
+ CLASSIFYTEXTMINIMAL = 'classify_text_minimal', // classify text into one of the three categories: title, caption, lengthy description
+ CLASSIFYTEXTFULL = 'classify_text_full', //tags pdf content
+ GENERATESCRAPBOOK = 'generate_scrapbook'
}
type GPTCallOpts = {
@@ -93,7 +94,7 @@ const callTypeMap: { [type in GPTCallType]: GPTCallOpts } = {
prompt: "You are a helpful resarch assistant. Analyze the user's data to find meaningful patterns and/or correlation. Please only return a JSON with a correlation column 1 propert, a correlation column 2 property, and an analysis property. ",
},
//new
- classify_text: {
+ classify_text_minimal: {
model: 'gpt-4o',
maxTokens: 2048,
temp: 0.25,
@@ -101,6 +102,13 @@ const callTypeMap: { [type in GPTCallType]: GPTCallOpts } = {
most appropriate category: '${TextClassifications.Title}', '${TextClassifications.Caption}', or '${TextClassifications.LengthyDescription}'. Output exclusively the classification in your response.
`
},
+ classify_text_full: {
+ 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.`
+ },
describe: { model: 'gpt-4-vision-preview', maxTokens: 2048, temp: 0, prompt: 'Describe these images in 3-5 words' },
flashcard: {
model: 'gpt-4-turbo',
@@ -160,12 +168,29 @@ const callTypeMap: { [type in GPTCallType]: GPTCallOpts } = {
prompt: 'You will be coloring drawings. You will be given what the drawing is, then a list of descriptions for parts of the drawing. Based on each description, respond with the stroke and fill color that it should be. Follow the rules: 1. Avoid using black for stroke color 2. Make the stroke color 1-3 shades darker than the fill color 3. Use the same colors when possible. Format as {#abcdef #abcdef}, making sure theres a color for each description, and do not include any additional text.',
},
- scrapbook: {
- model: 'gpt-4-turbo',
- maxTokens: 512,
+ generate_scrapbook: {
+ model: 'gpt-4o',
+ maxTokens: 2048,
temp: 0.5,
- prompt: 'You will be given a list of field descriptions for one or more templates in the format {field #0: “description”}{field #1: “description”}{...}, and a list of column descriptions in the format {“title”: “description”}{...}. Your job is to match columns with fields based on their descriptions. Your output should be in the following JSON format: {“template_title”:{“#”: “title”, “#”: “title”, “#”: “title” …}, “template_title”:{“#”: “title”, “#”: “title”, “#”: “title” …}} where “template_title” is the templates title as specified in the description provided, # represents the field # and “title” the title of the column assigned to it. A filled out example might look like {“fivefield2”:{“0”:”Name”, “1”:”Image”, “2”:”Caption”, “3”:”Position”, “4”:”Stats”}, “fivefield3”:{0:”Image”, 1:”Name”, 2:”Caption”, 3:”Stats”, 4:”Position”}. Include one object for each template. IT IS VERY IMPORTANT THAT YOU ONLY INCLUDE TEXT IN THE FORMAT ABOVE, WITH NO ADDITIONS WHATSOEVER. Do not include extraneous ‘#’ characters, ‘column’ for columns, or ‘template’ for templates: ONLY THE TITLES AND NUMBERS. There should never be one column assigned to more than one field (ie. if the “name” column is assigned to field 1, it can’t be assigned to any other fields) . Do this for each template whose fields are described. The descriptions are as follows:',
- },
+ 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
+ "tag": a singular tag summarizing the document
+ "x": number,
+ "y": number,
+ "width": number,
+ "height": number
+ }, ...]
+ If there are mutliple documents, you may include
+ "children": [
+ { type:
+ tag:
+ x: , y: , width: , height:
+ }
+ ] `
+
+ },
command_type: {
model: 'gpt-4-turbo',