diff --git a/FirebaseAI/CHANGELOG.md b/FirebaseAI/CHANGELOG.md index 7c63b1560c8..9b9e2e02ff2 100644 --- a/FirebaseAI/CHANGELOG.md +++ b/FirebaseAI/CHANGELOG.md @@ -1,4 +1,5 @@ # Unreleased +- [changed] The URL context tool APIs are now GA. - [feature] Added support for implicit caching (context caching) metadata in `GenerateContentResponse`. You can now access `cachedContentTokenCount` and `cacheTokensDetails` in `UsageMetadata` to see savings from cached content. See the [caching documentation](https://ai.google.dev/gemini-api/docs/caching) for more details. diff --git a/FirebaseAI/Sources/Tool.swift b/FirebaseAI/Sources/Tool.swift index e051b3b5ea4..53e0ee8b49e 100644 --- a/FirebaseAI/Sources/Tool.swift +++ b/FirebaseAI/Sources/Tool.swift @@ -136,9 +136,6 @@ public struct Tool: Sendable { /// /// By including URLs in your request, the Gemini model will access the content from those pages /// to inform and enhance its response. - /// - /// > Warning: URL context is a **Public Preview** feature, which means that it is not subject to - /// > any SLA or deprecation policy and could change in backwards-incompatible ways. 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 5689c7610f7..5ff671f68eb 100644 --- a/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift +++ b/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift @@ -13,9 +13,6 @@ // limitations under the License. /// Metadata related to the ``Tool/urlContext()`` tool. -/// -/// > Warning: URL context is a **Public Preview** feature, which means that it is not subject to -/// > any SLA or deprecation policy and could change in backwards-incompatible ways. @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct URLContextMetadata: Sendable, Hashable { /// List of URL metadata used to provide context to the Gemini model. diff --git a/FirebaseAI/Sources/Types/Public/URLMetadata.swift b/FirebaseAI/Sources/Types/Public/URLMetadata.swift index 3833d71accf..50ee16a7e86 100644 --- a/FirebaseAI/Sources/Types/Public/URLMetadata.swift +++ b/FirebaseAI/Sources/Types/Public/URLMetadata.swift @@ -15,9 +15,6 @@ import Foundation /// Metadata for a single URL retrieved by the ``Tool/urlContext()`` tool. -/// -/// > Warning: URL context is a **Public Preview** feature, which means that it is not subject to -/// > any SLA or deprecation policy and could change in backwards-incompatible ways. @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct URLMetadata: Sendable, Hashable { /// Status of the URL retrieval. diff --git a/FirebaseAI/Tests/Unit/Types/ToolTests.swift b/FirebaseAI/Tests/Unit/Types/ToolTests.swift index b429cb5369b..9b5c1851ea0 100644 --- a/FirebaseAI/Tests/Unit/Types/ToolTests.swift +++ b/FirebaseAI/Tests/Unit/Types/ToolTests.swift @@ -89,4 +89,19 @@ final class ToolTests: XCTestCase { } """) } + + func testEncodeTool_urlContext() throws { + let tool = Tool.urlContext() + + let jsonData = try encoder.encode(tool) + + let jsonString = try XCTUnwrap(String(data: jsonData, encoding: .utf8)) + XCTAssertEqual(jsonString, """ + { + "urlContext" : { + + } + } + """) + } }