Skip to content

Commit d6c8880

Browse files
authored
Merge pull request #13 from FunctionCalling/renovate/firebase-firebase-ios-sdk-11.x
Update dependency firebase/firebase-ios-sdk to from: "11.13.0"
2 parents 8c8ee67 + 2ac5d28 commit d6c8880

File tree

4 files changed

+21
-32
lines changed

4 files changed

+21
-32
lines changed

.github/workflows/swift.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
runs-on: macos-14
1414
steps:
1515
- uses: actions/checkout@v4
16+
- name: Change Xcode version
17+
run: sudo xcode-select -s /Applications/Xcode_16.2.app
1618
- name: Install swiftlint
1719
run: |
1820
brew update

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
],
1818
dependencies: [
1919
.package(url: "https://github.com/fumito-ito/FunctionCalling", from: "0.5.0"),
20-
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "11.11.0")
20+
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "11.13.0")
2121
],
2222
targets: [
2323
// Targets are the basic building blocks of a package, defining a module or a test suite.

Tests/FunctionCalling-FirebaseVertexAITests/Extensions.swift

Lines changed: 0 additions & 24 deletions
This file was deleted.

Tests/FunctionCalling-FirebaseVertexAITests/FunctionCalling_FirebaseVertexAITests.swift

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,31 @@ final class FunctionCalling_FirebaseVertexAITests: XCTestCase {
2121
}
2222

2323
func testConvertedResults() throws {
24-
guard let functions = FunctionContainer().firebaseVertexAITools.first?.functions else {
24+
guard let tool = FunctionContainer().firebaseVertexAITools.first else {
2525
XCTFail("Conainer should contain some functions")
2626
return
2727
}
2828

29+
let encodedToolData = try JSONEncoder().encode(tool)
30+
let jsonObject = try JSONSerialization.jsonObject(with: encodedToolData)
31+
32+
guard let toolDictionary = jsonObject as? [String: Any] else {
33+
XCTFail("Failed to convert to JSON object")
34+
return
35+
}
36+
37+
guard let functions = toolDictionary["functionDeclarations"] as? [[String: Any]] else {
38+
XCTFail("Failed to convert to JSON object")
39+
return
40+
}
41+
2942
XCTAssertEqual(functions.count, 2)
3043

31-
let getWeather = try XCTUnwrap(functions.first)
32-
XCTAssertEqual(getWeather.getName(), "getWeather")
44+
let getWeather = try XCTUnwrap(functions.first(where: { $0["name"] as? String == "getWeather" }))
3345
// swiftlint:disable:next line_length
34-
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")
46+
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")
3547

36-
let getStock = try XCTUnwrap(functions.last)
37-
XCTAssertEqual(getStock.getName(), "getStock")
38-
XCTAssertEqual(getStock.getDescription(), "")
48+
let getStock = try XCTUnwrap(functions.first(where: { $0["name"] as? String == "getStock" }))
49+
XCTAssertEqual(getStock["description"] as? String, "")
3950
}
4051
}

0 commit comments

Comments
 (0)