rpurinton / gemini-php

A PHP Library for Google Gemini AI
https://discord.gg/U9stSmpEYr
MIT License
20 stars 7 forks source link

Why is maxOutputTokens limited to 2048? #3

Open fx1234 opened 7 months ago

fx1234 commented 7 months ago

Hello,

in Validate.php maxOutputTokens is limited to 2048 and throws an error if the value is higher.

According to this page [1] the default value for gemini-pro is 8192

[1] https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/gemini

rpurinton commented 7 months ago

Might be because of unclarity in the API reference I was using which says

maxOutputTokens | Maximum number of tokens that can be generated in the response. A token is approximately four characters. 100 tokens correspond to roughly 60-80 words. Specify a lower value for shorter responses and a higher value for potentially longer responses.

Range: 1-2048

Default for gemini-pro: 8192

Default for gemini-pro-vision: 2048.

I will test and if it works I'll update the library!