Skip to content

[Vertex AI] Update integration tests to Gemini 2.0 Flash #14441

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

Merged
merged 1 commit into from
Feb 11, 2025
Merged
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 @@ -54,7 +54,7 @@ final class IntegrationTests: XCTestCase {

vertex = VertexAI.vertexAI()
model = vertex.generativeModel(
modelName: "gemini-1.5-flash",
modelName: "gemini-2.0-flash",
generationConfig: generationConfig,
safetySettings: safetySettings,
tools: [],
Expand All @@ -80,7 +80,7 @@ final class IntegrationTests: XCTestCase {
let app = try FirebaseApp.defaultNamedCopy(name: TestAppCheckProviderFactory.notConfiguredName)
addTeardownBlock { await app.delete() }
let vertex = VertexAI.vertexAI(app: app)
let model = vertex.generativeModel(modelName: "gemini-1.5-flash")
let model = vertex.generativeModel(modelName: "gemini-2.0-flash")
let prompt = "Where is Google headquarters located? Answer with the city name only."

do {
Expand Down Expand Up @@ -183,7 +183,7 @@ final class IntegrationTests: XCTestCase {
parameters: ["x": .integer(), "y": .integer()]
)
model = vertex.generativeModel(
modelName: "gemini-1.5-flash",
modelName: "gemini-2.0-flash",
tools: [.functionDeclarations([sumDeclaration])],
toolConfig: .init(functionCallingConfig: .any(allowedFunctionNames: ["sum"]))
)
Expand All @@ -203,7 +203,7 @@ final class IntegrationTests: XCTestCase {

func testCountTokens_jsonSchema() async throws {
model = vertex.generativeModel(
modelName: "gemini-1.5-flash",
modelName: "gemini-2.0-flash",
generationConfig: GenerationConfig(
responseMIMEType: "application/json",
responseSchema: Schema.object(properties: [
Expand All @@ -226,7 +226,7 @@ final class IntegrationTests: XCTestCase {
let app = try FirebaseApp.defaultNamedCopy(name: TestAppCheckProviderFactory.notConfiguredName)
addTeardownBlock { await app.delete() }
let vertex = VertexAI.vertexAI(app: app)
let model = vertex.generativeModel(modelName: "gemini-1.5-flash")
let model = vertex.generativeModel(modelName: "gemini-2.0-flash")
let prompt = "Why is the sky blue?"

do {
Expand Down
Loading