Skip to content

Commit c54c8c8

Browse files
committed
Use default decodable extensions and fix copyright notice
1 parent 0c011ae commit c54c8c8

File tree

4 files changed

+4
-43
lines changed

4 files changed

+4
-43
lines changed

FirebaseAI/Sources/GenerateContentResponse.swift

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -668,44 +668,13 @@ extension GroundingMetadata: Decodable {
668668
}
669669

670670
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
671-
extension GroundingMetadata.SearchEntryPoint: Decodable {
672-
enum CodingKeys: String, CodingKey {
673-
case renderedContent
674-
}
675-
676-
public init(from decoder: Decoder) throws {
677-
let container = try decoder.container(keyedBy: CodingKeys.self)
678-
renderedContent = try container.decodeIfPresent(String.self, forKey: .renderedContent)
679-
}
680-
}
671+
extension GroundingMetadata.SearchEntryPoint: Decodable {}
681672

682673
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
683-
extension GroundingMetadata.GroundingChunk: Decodable {
684-
enum CodingKeys: String, CodingKey {
685-
case web
686-
}
687-
688-
public init(from decoder: Decoder) throws {
689-
let container = try decoder.container(keyedBy: CodingKeys.self)
690-
web = try container.decodeIfPresent(GroundingMetadata.WebGroundingChunk.self, forKey: .web)
691-
}
692-
}
674+
extension GroundingMetadata.GroundingChunk: Decodable {}
693675

694676
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
695-
extension GroundingMetadata.WebGroundingChunk: Decodable {
696-
enum CodingKeys: String, CodingKey {
697-
case uri
698-
case title
699-
case domain
700-
}
701-
702-
public init(from decoder: Decoder) throws {
703-
let container = try decoder.container(keyedBy: CodingKeys.self)
704-
uri = try container.decodeIfPresent(String.self, forKey: .uri)
705-
title = try container.decodeIfPresent(String.self, forKey: .title)
706-
domain = try container.decodeIfPresent(String.self, forKey: .domain)
707-
}
708-
}
677+
extension GroundingMetadata.WebGroundingChunk: Decodable {}
709678

710679
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
711680
extension GroundingMetadata.GroundingSupport: Decodable {

FirebaseAI/Sources/Tool.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

FirebaseAI/Tests/Unit/vertexai-sdk-test-data/mock-responses/developerapi

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

FirebaseAI/Tests/Unit/vertexai-sdk-test-data/mock-responses/vertexai

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

0 commit comments

Comments
 (0)