From f123ffc5a4b38ea18575450d1b97518c1ae538b7 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 16 Sep 2025 16:32:42 +0000 Subject: [PATCH 1/2] refactor: Move URLContext to internal Moved URLContext to be an internal type within the FirebaseAI module. This involved: - Moving the file to `FirebaseAI/Sources/Types/Internal/Tools/URLContext.swift`. - Removing the `public` keyword from the struct. - Making the `Tool.urlContext()` factory method internal. - Updating documentation comments that referenced the now-internal type. Could not run tests due to environment limitations. --- FirebaseAI/Sources/Tool.swift | 2 +- .../Sources/Types/{Public => Internal}/Tools/URLContext.swift | 2 +- FirebaseAI/Sources/Types/Public/URLContextMetadata.swift | 2 +- FirebaseAI/Sources/Types/Public/URLMetadata.swift | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename FirebaseAI/Sources/Types/{Public => Internal}/Tools/URLContext.swift (93%) diff --git a/FirebaseAI/Sources/Tool.swift b/FirebaseAI/Sources/Tool.swift index e19b98997bb..7fcdd0bc3ba 100644 --- a/FirebaseAI/Sources/Tool.swift +++ b/FirebaseAI/Sources/Tool.swift @@ -131,7 +131,7 @@ public struct Tool: Sendable { return self.init(googleSearch: googleSearch) } - public static func urlContext() -> Tool { + static func urlContext() -> Tool { return self.init(urlContext: URLContext()) } diff --git a/FirebaseAI/Sources/Types/Public/Tools/URLContext.swift b/FirebaseAI/Sources/Types/Internal/Tools/URLContext.swift similarity index 93% rename from FirebaseAI/Sources/Types/Public/Tools/URLContext.swift rename to FirebaseAI/Sources/Types/Internal/Tools/URLContext.swift index eba8a48fcba..2033bb940f1 100644 --- a/FirebaseAI/Sources/Types/Public/Tools/URLContext.swift +++ b/FirebaseAI/Sources/Types/Internal/Tools/URLContext.swift @@ -13,6 +13,6 @@ // limitations under the License. @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) -public struct URLContext: Sendable, Encodable { +struct URLContext: Sendable, Encodable { init() {} } diff --git a/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift b/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift index 3364def8963..65b6b584de8 100644 --- a/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift +++ b/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -/// Metadata related to the ``URLContext`` tool. +/// Metadata related to the URLContext tool. @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct URLContextMetadata: Sendable, Hashable { /// List of URL context. diff --git a/FirebaseAI/Sources/Types/Public/URLMetadata.swift b/FirebaseAI/Sources/Types/Public/URLMetadata.swift index 960541aebe1..59f959fc088 100644 --- a/FirebaseAI/Sources/Types/Public/URLMetadata.swift +++ b/FirebaseAI/Sources/Types/Public/URLMetadata.swift @@ -49,7 +49,7 @@ public struct URLMetadata: Sendable, Hashable { AILog.MessageCode.urlMetadataUnrecognizedURLRetrievalStatus } - /// The URL retrieved by the ``URLContext`` tool. + /// The URL retrieved by the URLContext tool. public let retrievedURL: URL? /// The status of the URL retrieval. From c1ed44b5abe5966aecd41238f15dff9768f498cb Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 16 Sep 2025 16:51:19 +0000 Subject: [PATCH 2/2] refactor: Move URLContext to internal Moved URLContext to be an internal type within the FirebaseAI module. This involved: - Moving the file to `FirebaseAI/Sources/Types/Internal/Tools/URLContext.swift`. - Removing the `public` keyword from the struct. - Updating documentation comments that referenced the now-internal type to point to the public factory method. Could not run tests due to environment limitations. --- FirebaseAI/Sources/Tool.swift | 2 +- FirebaseAI/Sources/Types/Public/URLContextMetadata.swift | 2 +- FirebaseAI/Sources/Types/Public/URLMetadata.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FirebaseAI/Sources/Tool.swift b/FirebaseAI/Sources/Tool.swift index 7fcdd0bc3ba..e19b98997bb 100644 --- a/FirebaseAI/Sources/Tool.swift +++ b/FirebaseAI/Sources/Tool.swift @@ -131,7 +131,7 @@ public struct Tool: Sendable { return self.init(googleSearch: googleSearch) } - static func urlContext() -> Tool { + public static func urlContext() -> Tool { return self.init(urlContext: URLContext()) } diff --git a/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift b/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift index 65b6b584de8..d3c87887ab6 100644 --- a/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift +++ b/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -/// Metadata related to the URLContext tool. +/// Metadata related to the ``Tool/urlContext()`` tool. @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct URLContextMetadata: Sendable, Hashable { /// List of URL context. diff --git a/FirebaseAI/Sources/Types/Public/URLMetadata.swift b/FirebaseAI/Sources/Types/Public/URLMetadata.swift index 59f959fc088..1e42759b909 100644 --- a/FirebaseAI/Sources/Types/Public/URLMetadata.swift +++ b/FirebaseAI/Sources/Types/Public/URLMetadata.swift @@ -49,7 +49,7 @@ public struct URLMetadata: Sendable, Hashable { AILog.MessageCode.urlMetadataUnrecognizedURLRetrievalStatus } - /// The URL retrieved by the URLContext tool. + /// The URL retrieved by the ``Tool/urlContext()`` tool. public let retrievedURL: URL? /// The status of the URL retrieval.