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

How to re-init apiKey while in the application #14

Closed longnh2k1 closed 8 months ago

longnh2k1 commented 8 months ago

I want to re-initialize the apiKey in Gemini.init(apiKey: "--apiKye--"), what should I do without having to close the application and reopen it?

babakcode commented 8 months ago

It's impossible. You shouldn't use the multiple API keys for services with limited use. however, I can add this feature.

longnh2k1 commented 8 months ago

It's impossible. You shouldn't use the multiple API keys for services with limited use. however, I can add this feature.

I really need it, can you add that feature soon🥹? Specifically, I want to be able to pass in any apiKey that I have received from the server, rather than assigning apiKeys in the app.

babakcode commented 8 months ago

Now you can use this feature on the 2.0.4-dev.1 version.

  Gemini.reInitialize(apiKey: "new api key", enableDebugging: false);
longnh2k1 commented 8 months ago

Now you can use this feature on the 2.0.4-dev.1 version.

  Gemini.reInitialize(apiKey: "new api key", enableDebugging: false);

Thank you very much😇💐💐