mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 13:03:58 +00:00
fix(coding-agent): load photon via dynamic import
This commit is contained in:
parent
157e4e51bf
commit
94bd7f69fd
4 changed files with 28 additions and 37 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import type { ImageContent } from "@mariozechner/pi-ai";
|
||||
import { getPhoton } from "./photon.js";
|
||||
import { loadPhoton } from "./photon.js";
|
||||
|
||||
export interface ImageResizeOptions {
|
||||
maxWidth?: number; // Default: 2000
|
||||
|
|
@ -53,7 +53,7 @@ export async function resizeImage(img: ImageContent, options?: ImageResizeOption
|
|||
const opts = { ...DEFAULT_OPTIONS, ...options };
|
||||
const inputBuffer = Buffer.from(img.data, "base64");
|
||||
|
||||
const photon = getPhoton();
|
||||
const photon = await loadPhoton();
|
||||
if (!photon) {
|
||||
// Photon not available, return original image
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue