babakcode / flutter_gemini

Flutter Google Gemini SDK
https://pub.dev/packages/flutter_gemini
BSD 3-Clause "New" or "Revised" License
176 stars 53 forks source link

'multi-turn chat' can add image? #18

Closed wy353208214 closed 7 months ago

wy353208214 commented 8 months ago

According to gemini rest api, we can add image to the parts. but the class 'Parts' has no attribute 'inline_data'. I know textAndImage/streamGenerateContent support it, It would be better if chat/streamChat support.

thx~

such as:

{
  "contents": [
    {
      "parts": [
        {
          "text": "What is this picture?"
        },
        {
          "inline_data": {
            "mime_type": "image/jpeg",
            "data": "'$(base64 -w0 image.jpg)'"
          }
        }
      ]
    }
  ]
}
hortigado commented 7 months ago

+1 I also need it

babakcode commented 7 months ago

Hi, I can add this feature but according to REST API documentation Note: The gemini-pro-vision model (for text-and-image input) is not yet optimized for multi-turn conversations. Make sure to use gemini-pro and text-only input for chat use cases. I didn't update it.

I am waiting for Google's upcoming updates.

wy353208214 commented 7 months ago

Hi, I can add this feature but according to REST API documentation Note: The gemini-pro-vision model (for text-and-image input) is not yet optimized for multi-turn conversations. Make sure to use gemini-pro and text-only input for chat use cases. I didn't update it.

I am waiting for Google's upcoming updates.

ok! thank you.