aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis/gpt/customization.ts
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2024-02-22 13:39:42 -0500
committerSophie Zhang <sophie_zhang@brown.edu>2024-02-22 13:39:42 -0500
commitb960beb2f31327becdf6709a61b90523abdee65a (patch)
tree66b3acb69b6d0b0dc69f2691c66c974f9bc73989 /src/client/apis/gpt/customization.ts
parent3f33a680af31a04b58c6163fda53a80a737837c6 (diff)
layout progress
Diffstat (limited to 'src/client/apis/gpt/customization.ts')
-rw-r--r--src/client/apis/gpt/customization.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/apis/gpt/customization.ts b/src/client/apis/gpt/customization.ts
index 42f112f88..db5ef6eb5 100644
--- a/src/client/apis/gpt/customization.ts
+++ b/src/client/apis/gpt/customization.ts
@@ -116,9 +116,9 @@ export const smartLayout = async (inputData: { width: number; height: number }[]
};
// layout
-export const smartLayout2 = async (inputData: { width: number; height: number; content: string }[]) => {
+export const smartLayout2 = async (inputData: { width: number; height: number }[]) => {
let prompt =
- 'I want to layout documents in a 2d space in an organized fashion with padding of about 50 units around each document, importantly making sure they do not overlap. I also want you to group documents by their content, with space separating semantic categories. Given a json array of documents containing their width and heights in this form: {width: number, height: number, content: string}[], give me a json array in this form: {x: number, y: number}[] corresponding to the documents in the same order with a nice layout. Return just the json array.';
+ 'I want to layout documents in a freeform 2d space in a masonry layout with a padding of around 50 units around each document. Take inspiration from existing UI grid and masonry layout design patterns. Make sure documents do not overlap. Given a json array of documents containing their width and heights in this form: {width: number, height: number}[], give me a json array in this form: {x: number, y: number}[] corresponding to the documents in the same order with the improved layout. Return just the json array.';
let messages: ChatCompletionMessageParam[] = [
{ role: 'system', content: prompt },
@@ -132,7 +132,7 @@ export const smartLayout2 = async (inputData: { width: number; height: number; c
const response = await openai.chat.completions.create({
model: 'gpt-4',
messages: messages,
- temperature: 0.01,
+ temperature: 0,
max_tokens: 2000,
});
const content = response.choices[0].message?.content;