npm version, fix gpt-4-vision

This commit is contained in:
zsviczian
2025-06-12 19:19:14 +00:00
parent 8da97a63e0
commit 5accd657d9
6 changed files with 42 additions and 10 deletions

View File

@@ -0,0 +1,17 @@
{
"name": "Node.js 20",
"image": "mcr.microsoft.com/devcontainers/javascript-node:20",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
}
},
"postCreateCommand": "npm install",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.vscode-typescript-next"
]
}
}
}

7
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
target-branch: "master"

2
.nvmrc
View File

@@ -1 +1 @@
18
20

12
package-lock.json generated
View File

@@ -11,7 +11,7 @@
"dependencies": {
"@popperjs/core": "^2.11.8",
"@zsviczian/colormaster": "^1.2.2",
"@zsviczian/excalidraw": "0.18.0-19",
"@zsviczian/excalidraw": "0.18.0-21",
"chroma-js": "^2.4.2",
"clsx": "^2.0.0",
"es6-promise-pool": "2.5.0",
@@ -72,6 +72,10 @@
"ttypescript": "^1.5.15",
"typescript": "^5.7.3",
"uglify-js": "^3.19.3"
},
"engines": {
"node": ">=20.0.0",
"npm": ">=10.0.0"
}
},
"node_modules/@ampproject/remapping": {
@@ -3490,9 +3494,9 @@
"license": "MIT"
},
"node_modules/@zsviczian/excalidraw": {
"version": "0.18.0-19",
"resolved": "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.18.0-19.tgz",
"integrity": "sha512-29x40tC1x3w55obZuwRbDj6HPq5XHEeOSVJq7XMoxJS3pRgLVQI7uc5jVjxZgVnQ+xhAjWvVHkBrc0dKZfRa1w==",
"version": "0.18.0-21",
"resolved": "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.18.0-21.tgz",
"integrity": "sha512-j7ltw+FY8SrcN7a2NlPACNnUsiG6eZCLAwjZNg275U2puDf4CVGzCl6d4hB24jUn9DL5F4HKrcKLspBhxJHKaA==",
"license": "MIT",
"dependencies": {
"@braintree/sanitize-url": "6.0.2",

View File

@@ -21,9 +21,9 @@
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"dependencies": {
"@popperjs/core": "^2.11.8",
"@zsviczian/excalidraw": "0.18.0-19",
"@zsviczian/excalidraw": "0.18.0-21",
"chroma-js": "^2.4.2",
"clsx": "^2.0.0",
"@zsviczian/colormaster": "^1.2.2",
@@ -89,5 +89,9 @@
"resolutions": {
"@typescript-eslint/typescript-estree": "5.3.0"
},
"prettier": "@excalidraw/prettier-config"
"prettier": "@excalidraw/prettier-config",
"engines": {
"node": ">=20.0.0",
"npm": ">=10.0.0"
}
}

View File

@@ -1,4 +1,4 @@
import { THEME } from "../constants/constants";
import { EXCALIDRAW_PLUGIN, THEME } from "../constants/constants";
import type { Theme } from "@zsviczian/excalidraw/types/element/src/types";
import type { DataURL } from "@zsviczian/excalidraw/types/excalidraw/types";
import type { OpenAIInput, OpenAIOutput } from "@zsviczian/excalidraw/types/excalidraw/data/ai/types";
@@ -43,7 +43,7 @@ export async function diagramToHTML({
theme?: Theme;
}) {
const body: OpenAIInput.ChatCompletionCreateParamsBase = {
model: "gpt-4-vision-preview",
model: EXCALIDRAW_PLUGIN.settings.openAIDefaultVisionModel,
// 4096 are max output tokens allowed for `gpt-4-vision-preview` currently
max_tokens: 4096,
temperature: 0.1,