Skip to content

Commit

Permalink
[Vertex AI] Update samples/docs to use gemini-1.5-flash-preview-0514 (
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheard authored May 16, 2024
1 parent 1c8db0b commit 61c10bc
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ConversationViewModel: ObservableObject {
private var chatTask: Task<Void, Never>?

init() {
model = VertexAI.vertexAI().generativeModel(modelName: "gemini-1.5-pro-preview-0409")
model = VertexAI.vertexAI().generativeModel(modelName: "gemini-1.5-flash-preview-0514")
chat = model.startChat()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FunctionCallingViewModel: ObservableObject {

init() {
model = VertexAI.vertexAI().generativeModel(
modelName: "gemini-1.5-pro-preview-0409",
modelName: "gemini-1.5-flash-preview-0514",
tools: [Tool(functionDeclarations: [
FunctionDeclaration(
name: "get_exchange_rate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PhotoReasoningViewModel: ObservableObject {
private var model: GenerativeModel?

init() {
model = VertexAI.vertexAI().generativeModel(modelName: "gemini-1.5-pro-preview-0409")
model = VertexAI.vertexAI().generativeModel(modelName: "gemini-1.5-flash-preview-0514")
}

func reason() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SummarizeViewModel: ObservableObject {
private var model: GenerativeModel?

init() {
model = VertexAI.vertexAI().generativeModel(modelName: "gemini-1.5-pro-preview-0409")
model = VertexAI.vertexAI().generativeModel(modelName: "gemini-1.5-flash-preview-0514")
}

func summarize(inputText: String) async {
Expand Down
3 changes: 1 addition & 2 deletions FirebaseVertexAI/Sources/GenerativeModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public final class GenerativeModel {
/// Initializes a new remote model with the given parameters.
///
/// - Parameters:
/// - name: The name of the model to use, for example `"gemini-1.0-pro"`; see
/// [Gemini models](https://ai.google.dev/models/gemini) for a list of supported model names.
/// - name: The name of the model to use, for example `"gemini-1.0-pro"`.
/// - apiKey: The API key for your project.
/// - generationConfig: The content generation parameters your model should use.
/// - safetySettings: A value describing what types of harmful content your model should allow.
Expand Down
10 changes: 7 additions & 3 deletions FirebaseVertexAI/Sources/VertexAI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ public class VertexAI: NSObject {

/// Initializes a generative model with the given parameters.
///
/// - Note: Refer to [Gemini models](https://firebase.google.com/docs/vertex-ai/gemini-models) for
/// guidance on choosing an appropriate model for your use case.
///
/// - Parameters:
/// - modelName: The name of the model to use, for example `"gemini-1.0-pro"`; see
/// [Gemini models](https://firebase.google.com/docs/vertex-ai/gemini-model#available-models)
/// for a list of supported model names.
/// - modelName: The name of the model to use, for example `"gemini-1.5-flash-preview-0514"`;
/// see [available model names
/// ](https://firebase.google.com/docs/vertex-ai/gemini-models#available-model-names) for a
/// list of supported model names.
/// - generationConfig: The content generation parameters your model should use.
/// - safetySettings: A value describing what types of harmful content your model should allow.
/// - tools: A list of ``Tool`` objects that the model may use to generate the next response.
Expand Down

0 comments on commit 61c10bc

Please sign in to comment.