fix(images): cache Telegram photos by unique_id and pass base64 to LLM commands
Stop reading image files inside gemini/mistral commands; use pre-encoded image data from message parts Rework loadImagesIfExists / loadImagesFromFileIds to return cached file_unique_ids and download only missing sizes Encode cached images to base64 when assembling the reply chain Make getPhotoMaxSize synchronous (returns PhotoSize), and map to URL only when needed Await MessageStore.put / UserStore.put and prefetch single-image downloads on message receipt
This commit is contained in:
@@ -9,7 +9,7 @@ export class UserStore {
|
||||
return this.map;
|
||||
}
|
||||
|
||||
static async put(u: User) {
|
||||
static async put(u: User): Promise<StoredUser> {
|
||||
const user: StoredUser = {
|
||||
id: u.id,
|
||||
isBot: u.is_bot,
|
||||
@@ -22,6 +22,7 @@ export class UserStore {
|
||||
this.map.set(u.id, user);
|
||||
|
||||
await userDao.insert(userDao.mapTo([u]));
|
||||
return user;
|
||||
}
|
||||
|
||||
static async get(id: number): Promise<StoredUser | null> {
|
||||
|
||||
Reference in New Issue
Block a user