aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis/gpt
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-04-03 14:15:15 -0400
committerbobzel <zzzman@gmail.com>2025-04-03 14:15:15 -0400
commitede7aaa19d903a7e55fc60d9bc213988ea602c97 (patch)
tree73bfe3775170717ef23e1bdbf5945efd23f26390 /src/client/apis/gpt
parent9305752405807ac736795185ae30c6955f5b483f (diff)
fixed image box button sizing. made drawing ai regen a little faster by not creating icons when there are no annotqations.
Diffstat (limited to 'src/client/apis/gpt')
-rw-r--r--src/client/apis/gpt/GPT.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/apis/gpt/GPT.ts b/src/client/apis/gpt/GPT.ts
index 29b6ab989..140aebfe0 100644
--- a/src/client/apis/gpt/GPT.ts
+++ b/src/client/apis/gpt/GPT.ts
@@ -1,5 +1,6 @@
import { ChatCompletionMessageParam, Image } from 'openai/resources';
import { openai } from './setup';
+import { imageUrlToBase64 } from '../../../ClientUtils';
export enum GPTDocCommand {
AssignTags = 1,
@@ -310,7 +311,9 @@ const gptHandwriting = async (src: string): Promise<string> => {
}
};
-const gptDescribeImage = async (image: string): Promise<string> => {
+const gptDescribeImage = async (userPrompt: string, url: string): Promise<string> => {
+ if (userPrompt) return userPrompt;
+ const image = imageUrlToBase64(url);
try {
const response = await openai.chat.completions.create({
model: 'gpt-4o',