Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vertex AI] Update samples/docs to use gemini-1.5-flash-preview-0514 #12979

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

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 @@ -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"`.
andrewheard marked this conversation as resolved.
Show resolved Hide resolved
/// - 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
Loading