Skip to content

Commit

Permalink
fix: fix missing dependencies caused by vite compilation.
Browse files Browse the repository at this point in the history
chore: update docker dependencies.
  • Loading branch information
adolphnov committed Nov 24, 2024
1 parent 1ae0d12 commit 7f92d44
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
18 changes: 9 additions & 9 deletions scripts/plugins/docker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ const packageJson = `
"start": "node index.js"
},
"dependencies": {
"@ai-sdk/anthropic": "^1.0.1",
"@ai-sdk/azure": "^1.0.3",
"@ai-sdk/cohere": "^1.0.1",
"@ai-sdk/google": "^1.0.1",
"@ai-sdk/google-vertex": "^1.0.1",
"@ai-sdk/mistral": "^1.0.2",
"@ai-sdk/openai": "^1.0.2",
"@ai-sdk/xai": "^1.0.2",
"ai": "^4.0.2",
"@ai-sdk/anthropic": "^1.0.2",
"@ai-sdk/azure": "^1.0.5",
"@ai-sdk/cohere": "^1.0.3",
"@ai-sdk/google": "^1.0.3",
"@ai-sdk/google-vertex": "^1.0.3",
"@ai-sdk/mistral": "^1.0.3",
"@ai-sdk/openai": "^1.0.4",
"@ai-sdk/xai": "^1.0.3",
"ai": "^4.0.3",
"cloudflare-worker-adapter": "^1.3.4",
"node-cron": "^3.0.3",
"ws": "^8.18.0"
Expand Down
5 changes: 4 additions & 1 deletion src/telegram/handler/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,13 @@ export class ChatHandler implements MessageHandler<WorkerContext> {
});
}
if (type === 'image' || type === 'photo') {
const isUrl = ENV.TELEGRAM_IMAGE_TRANSFER_MODE === 'url';
for (const url of urls) {
const { data, format } = isUrl ? { data: url, format: 'image/jpeg' } : await imageToBase64String(url);
params.content.push({
type: 'image',
image: ENV.TELEGRAM_IMAGE_TRANSFER_MODE === 'url' ? url : renderBase64DataURI(await imageToBase64String(url)),
image: data,
mimeType: format,
});
}
} else if (type === 'audio' || type === 'voice') {
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default defineConfig({
build: {
target: 'es2022',
rollupOptions: {
external: ['ws', '@ai-sdk/google-vertex'],
external: ['ws', '@ai-sdk/google-vertex', 'node:buffer'],
},
lib: {
entry: path.resolve(__dirname, entry),
Expand Down

0 comments on commit 7f92d44

Please sign in to comment.