Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@ val GenerativeViewModelFactory = object : ViewModelProvider.Factory {
return with(viewModelClass) {
when {
isAssignableFrom(SummarizeViewModel::class.java) -> {
// Initialize a GenerativeModel with the `gemini-pro` AI model
// Initialize a GenerativeModel with the `gemini-flash` AI model
// for text generation
val generativeModel = Firebase.vertexAI.generativeModel(
modelName = "gemini-1.5-pro-preview-0409",
modelName = "gemini-1.5-flash-preview-0514",
generationConfig = config
)
SummarizeViewModel(generativeModel)
}

isAssignableFrom(PhotoReasoningViewModel::class.java) -> {
// Initialize a GenerativeModel with the `gemini-pro` AI model
// Initialize a GenerativeModel with the `gemini-flash` AI model
// for multimodal text generation
val generativeModel = Firebase.vertexAI.generativeModel(
modelName = "gemini-1.5-pro-preview-0409",
modelName = "gemini-1.5-flash-preview-0514",
generationConfig = config
)
PhotoReasoningViewModel(generativeModel)
}

isAssignableFrom(ChatViewModel::class.java) -> {
// Initialize a GenerativeModel with the `gemini-pro` AI model for chat
// Initialize a GenerativeModel with the `gemini-flash` AI model for chat
val generativeModel = Firebase.vertexAI.generativeModel(
modelName = "gemini-1.5-pro-preview-0409",
modelName = "gemini-1.5-flash-preview-0514",
generationConfig = config
)
ChatViewModel(generativeModel)
Expand All @@ -87,9 +87,9 @@ val GenerativeViewModelFactory = object : ViewModelProvider.Factory {
)
)

// Initialize a GenerativeModel with the `gemini-pro` AI model for function calling chat
// Initialize a GenerativeModel with the `gemini-flash` AI model for function calling chat
Copy link
Contributor

Choose a reason for hiding this comment

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

The function example is best left with the pro model for now

Copy link
Member Author

Choose a reason for hiding this comment

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

changed to the latest preview version gemini-1.5-pro-preview-0514

val generativeModel = Firebase.vertexAI.generativeModel(
modelName = "gemini-1.5-pro-preview-0409",
modelName = "gemini-1.5-flash-preview-0514",
generationConfig = config,
tools = tools
)
Expand Down