Skip to content

Commit baf6066

Browse files
committed
Remove now unused location property in InstanceConfig
1 parent bdf2a54 commit baf6066

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

FirebaseAI/Sources/Types/Internal/APIConfig.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ struct APIConfig: Sendable, Hashable, Encodable {
2727
/// - Parameters:
2828
/// - service: The API service to use for generative AI.
2929
/// - version: The version of the API to use.
30-
/// - location: The server location to use.
3130
init(service: Service, version: Version) {
3231
self.service = service
3332
self.version = version

FirebaseAI/Tests/TestApp/Tests/Utilities/InstanceConfig.swift

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,11 @@ struct InstanceConfig: Equatable, Encodable {
109109
]
110110

111111
let appName: String?
112-
let location: String?
113112
let useLimitedUseAppCheckTokens: Bool
114113
let apiConfig: APIConfig
115114

116-
init(appName: String? = nil,
117-
location: String? = nil,
118-
useLimitedUseAppCheckTokens: Bool = false,
119-
apiConfig: APIConfig) {
115+
init(appName: String? = nil, useLimitedUseAppCheckTokens: Bool = false, apiConfig: APIConfig) {
120116
self.appName = appName
121-
self.location = location
122117
self.useLimitedUseAppCheckTokens = useLimitedUseAppCheckTokens
123118
self.apiConfig = apiConfig
124119
}
@@ -152,7 +147,12 @@ extension InstanceConfig: CustomTestStringConvertible {
152147
case .googleAIBypassProxy:
153148
" - Bypass Proxy"
154149
}
155-
let locationSuffix = location.map { " - \($0)" } ?? ""
150+
let locationSuffix: String
151+
if case let .vertexAI(_, location: location) = apiConfig.service {
152+
locationSuffix = location
153+
} else {
154+
locationSuffix = ""
155+
}
156156
let appCheckLimitedUseDesignator = useLimitedUseAppCheckTokens ? " - FAC Limited-Use" : ""
157157

158158
return """
@@ -172,10 +172,6 @@ extension FirebaseAI {
172172
useLimitedUseAppCheckTokens: instanceConfig.useLimitedUseAppCheckTokens
173173
)
174174
case .googleAI:
175-
assert(
176-
instanceConfig.location == nil,
177-
"The Developer API is global and does not support `location`."
178-
)
179175
return FirebaseAI.createInstance(
180176
app: instanceConfig.app,
181177
apiConfig: instanceConfig.apiConfig,

0 commit comments

Comments
 (0)