|
|
|
|
|
|
|
|
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({ |
|
|
|
|
|
|
|
|
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 |