Skip to content

Commit 58d80e8

Browse files
authored
Merge pull request #13 from Termina/imagin3
trying to support imagin 3
2 parents 412cd8c + a49dfb4 commit 58d80e8

File tree

7 files changed

+2605
-491
lines changed

7 files changed

+2605
-491
lines changed

assets/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Msg Gemini",
44
"icons": [
55
{
6-
"src": "https://uxwing.com/wp-content/themes/uxwing/download/brands-and-social-media/google-gemini-icon.png",
6+
"src": "https://cdn.tiye.me/logo/gemini-icon.png",
77
"sizes": "512x512"
88
}
99
],

calcit.cirru

Lines changed: 1716 additions & 119 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compact.cirru

Lines changed: 218 additions & 19 deletions
Large diffs are not rendered by default.

deps.cirru

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
{}
3-
:calcit-version |0.9.9
3+
:calcit-version |0.9.11
44
:dependencies $ {}
55
|calcit-lang/lilac |main
66
|calcit-lang/memof |main

lib/image.mjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export function base64ToBlob(base64Data, contentType) {
2+
contentType = contentType || ''; // 默认为空字符串,浏览器会根据base64字符串自动识别
3+
const byteCharacters = atob(base64Data);
4+
const byteArrays = [];
5+
6+
for (let offset = 0; offset < byteCharacters.length; offset += 512) { // 512 是一个块大小,可以根据需求调整
7+
const slice = byteCharacters.slice(offset, offset + 512);
8+
9+
const byteNumbers = new Array(slice.length);
10+
for (let i = 0; i < slice.length; i++) {
11+
byteNumbers[i] = slice.charCodeAt(i);
12+
}
13+
14+
const byteArray = new Uint8Array(byteNumbers);
15+
byteArrays.push(byteArray);
16+
}
17+
18+
const blob = new Blob(byteArrays, { type: contentType });
19+
return blob;
20+
}

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{
22
"dependencies": {
3-
"@calcit/procs": "^0.9.9",
4-
"@google/generative-ai": "^0.24.0",
5-
"axios": "^1.8.4",
3+
"@calcit/procs": "^0.9.11",
4+
"@google/genai": "^0.12.0",
5+
"axios": "^1.9.0",
66
"cirru-color": "^0.2.4",
7-
"copy-text-to-clipboard": "^3.2.0"
7+
"copy-text-to-clipboard": "^3.2.0",
8+
"openai": "^4.96.2"
89
},
910
"devDependencies": {
1011
"bottom-tip": "^0.1.5",
11-
"vite": "^6.2.6"
12+
"vite": "^6.3.4"
1213
},
1314
"scripts": {
1415
"build": "yarn vite build --base ./ && rm -rfv extension/dist && cp -vr dist extension/"
1516
},
16-
"version": "0.0.1"
17+
"version": "0.0.1",
18+
"packageManager": "[email protected]+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
1719
}

yarn.lock

Lines changed: 641 additions & 345 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)