Skip to content

Conversation

@logankilpatrick
Copy link
Member

No description provided.

Copy link
Collaborator

@natebosch natebosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the background to this change?


final apiKey = () {
final apiKey = Platform.environment['GEMINI_API_KEY'];
final apiKey = Platform.environment['GOOGLE_API_KEY'];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that GEMINI_API_KEY is the standard across the SDKS.

#188 (comment)


Future<void> textGenTextOnlyPrompt() async {
// [START text_gen_text_only_prompt]
import 'package:google_generative_ai/google_generative_ai.dart';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not valid Dart. Imports may only be at the beginning of a library.

@natebosch
Copy link
Collaborator

#214 adds the imports in comments in each sample. Does that address your intentions with this change? That looks like what the JS SDK is doing.

Copy link

@iqbalbhatti49 iqbalbhatti49 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Comments:

  • The environment variable was updated from GEMINI_API_KEY to GOOGLE_API_KEY, aligning with platform conventions.
  • Initialization of the GenerativeModel and the example prompt were added, making the code more comprehensive and user-friendly. Great addition!
  • Error handling has been streamlined, and meaningful output (No $GOOGLE_API_KEY environment variable) improves debugging.

This update is well-executed and enhances functionality—nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants