mirror of
				https://github.com/cdryzun/tg_bot_collections.git
				synced 2025-11-04 16:56:43 +08:00 
			
		
		
		
	@ -210,8 +210,8 @@ def gemini_photo_handler(message: Message, bot: TeleBot) -> None:
 | 
			
		||||
        temp_file.write(downloaded_file)
 | 
			
		||||
 | 
			
		||||
    model = genai.GenerativeModel("gemini-pro-vision")
 | 
			
		||||
    image_path = Path("gemini_temp.jpg")
 | 
			
		||||
    image_data = image_path.read_bytes()
 | 
			
		||||
    with open("gemini_temp.jpg", "rb") as image_file:
 | 
			
		||||
        image_data = image_file.read()
 | 
			
		||||
    contents = {
 | 
			
		||||
        "parts": [{"mime_type": "image/jpeg", "data": image_data}, {"text": prompt}]
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user