Skip to content

Update dependency firebase/firebase-ios-sdk to from: "11.13.0" #13

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 3 commits into from
May 26, 2025
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
2 changes: 2 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Change Xcode version
run: sudo xcode-select -s /Applications/Xcode_16.2.app
- name: Install swiftlint
run: |
brew update
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/fumito-ito/FunctionCalling", from: "0.5.0"),
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "11.11.0")
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "11.13.0")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand Down
24 changes: 0 additions & 24 deletions Tests/FunctionCalling-FirebaseVertexAITests/Extensions.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,31 @@ final class FunctionCalling_FirebaseVertexAITests: XCTestCase {
}

func testConvertedResults() throws {
guard let functions = FunctionContainer().firebaseVertexAITools.first?.functions else {
guard let tool = FunctionContainer().firebaseVertexAITools.first else {
XCTFail("Conainer should contain some functions")
return
}

let encodedToolData = try JSONEncoder().encode(tool)
let jsonObject = try JSONSerialization.jsonObject(with: encodedToolData)

guard let toolDictionary = jsonObject as? [String: Any] else {
XCTFail("Failed to convert to JSON object")
return
}

guard let functions = toolDictionary["functionDeclarations"] as? [[String: Any]] else {
XCTFail("Failed to convert to JSON object")
return
}

XCTAssertEqual(functions.count, 2)

let getWeather = try XCTUnwrap(functions.first)
XCTAssertEqual(getWeather.getName(), "getWeather")
let getWeather = try XCTUnwrap(functions.first(where: { $0["name"] as? String == "getWeather" }))
// swiftlint:disable:next line_length
XCTAssertEqual(getWeather.getDescription(), "Return current weather of location that passed by the argument- Parameter location: location that I want to know how the weather- Returns: string of weather")
XCTAssertEqual(getWeather["description"] as? String, "Return current weather of location that passed by the argument- Parameter location: location that I want to know how the weather- Returns: string of weather")

let getStock = try XCTUnwrap(functions.last)
XCTAssertEqual(getStock.getName(), "getStock")
XCTAssertEqual(getStock.getDescription(), "")
let getStock = try XCTUnwrap(functions.first(where: { $0["name"] as? String == "getStock" }))
XCTAssertEqual(getStock["description"] as? String, "")
}
}