mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: correct single base64 image handling in image prompt (#9220)
### What problem does this PR solve? Correct single base64 image handling in image prompt.  ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -59,6 +59,10 @@ class Base(ABC):
|
|||||||
def _image_prompt(self, text, images):
|
def _image_prompt(self, text, images):
|
||||||
if not images:
|
if not images:
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
if isinstance(images, str):
|
||||||
|
images = [images]
|
||||||
|
|
||||||
pmpt = [{"type": "text", "text": text}]
|
pmpt = [{"type": "text", "text": text}]
|
||||||
for img in images:
|
for img in images:
|
||||||
pmpt.append({
|
pmpt.append({
|
||||||
@ -795,4 +799,4 @@ class GoogleCV(AnthropicCV, GeminiCV):
|
|||||||
yield ans
|
yield ans
|
||||||
else:
|
else:
|
||||||
for ans in GeminiCV.chat_streamly(self, system, history, gen_conf, images):
|
for ans in GeminiCV.chat_streamly(self, system, history, gen_conf, images):
|
||||||
yield ans
|
yield ans
|
||||||
|
|||||||
Reference in New Issue
Block a user