helloparthshah commited on
Commit
8ae1091
·
1 Parent(s): 5d665be

mimetype for other files are supported

Browse files
Files changed (1) hide show
  1. src/manager/manager.py +3 -1
src/manager/manager.py CHANGED
@@ -18,6 +18,7 @@ from src.tools.default_tools.memory_manager import MemoryManager
18
  from pathlib import Path
19
  from google.genai.errors import APIError
20
  import backoff
 
21
 
22
  logger = logging.getLogger(__name__)
23
  handler = logging.StreamHandler(sys.stdout)
@@ -179,10 +180,11 @@ class GeminiManager:
179
  path = message["content"][0]
180
  try:
181
  image_bytes = open(path, "rb").read()
 
182
  parts = [
183
  types.Part.from_bytes(
184
  data=image_bytes,
185
- mime_type="image/png",
186
  ),
187
  ]
188
  except Exception as e:
 
18
  from pathlib import Path
19
  from google.genai.errors import APIError
20
  import backoff
21
+ import mimetypes
22
 
23
  logger = logging.getLogger(__name__)
24
  handler = logging.StreamHandler(sys.stdout)
 
180
  path = message["content"][0]
181
  try:
182
  image_bytes = open(path, "rb").read()
183
+ mime_type, _ = mimetypes.guess_type(path)
184
  parts = [
185
  types.Part.from_bytes(
186
  data=image_bytes,
187
+ mime_type=mime_type
188
  ),
189
  ]
190
  except Exception as e: