google-gemini-php / client

⚡️ Gemini PHP is a community-maintained PHP API client that allows you to interact with the Gemini AI API.
MIT License
193 stars 41 forks source link

Gemini 1.0 Pro Vision has been deprecated on July 12, 2024. Consider switching to different model, for example gemini-1.5-flash. #25

Closed joeybab3 closed 1 month ago

joeybab3 commented 3 months ago

Using the examples fails with the following error:

Error! Gemini API operation failed: operation=models/gemini-pro-vision:generateContent, status_code=404, response={ "error": { "code": 404, "message": "Gemini 1.0 Pro Vision has been deprecated on July 12, 2024. Consider switching to different model, for example gemini-1.5-flash.", "status": "NOT_FOUND" } }

viniciusdebruin commented 2 months ago

Guys, I managed to solve it here by following the steps in nalbantferhat's commit, but I made some changes only to the file vendor\google-gemini-php\client\src\Enums\ModelType.php and left it like this:


enum ModelType: string { case GEMINI_PRO = 'models/gemini-pro'; case GEMINI_PRO_1_0 = 'models/gemini-1.5-pro'; case GEMINI_PRO_1_0_LATEST = 'models/gemini-1.0-pro-latest'; case GEMINI_PRO_VISION = 'models/gemini-1.5-flash'; case EMBEDDING = 'models/embedding-001';

}


this worked for me

aydinfatih commented 1 month ago

I just released a new version.

Pro vision usage marked as deprecated. Also added geminiFlash method.

You can also use any model you want without depending on enums with the following method.

$client->generativeModel(model: 'models/gemini-1.5-flash-001')