Skip to content

Commit afadbf3

Browse files
authored
Revert "Implement Maps Grounding (#7950)" (#7980)
This reverts commit 16cb887. These changes will be moved to a feature branch until after M179.
1 parent 16f1dfc commit afadbf3

13 files changed

Lines changed: 18 additions & 382 deletions

File tree

ai-logic/firebase-ai/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Unreleased
22

3-
- [feature] Added support for [Maps Grounding](https://ai.google.dev/gemini-api/docs/maps-grounding) (#7950)
43
- [fixed] Fixed an issue causing network timeouts to throw the incorrect exception type, instead of
54
`RequestTimeoutException` (#7966)
65
- [fixed] Fixed an issue causing the SDK to throw an exception if an unknown message was received

ai-logic/firebase-ai/api.txt

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -637,20 +637,6 @@ package com.google.firebase.ai.type {
637637
method public com.google.firebase.ai.type.GenerativeBackend vertexAI(String location = "us-central1");
638638
}
639639

640-
public final class GoogleMaps {
641-
ctor public GoogleMaps();
642-
}
643-
644-
public final class GoogleMapsGroundingChunk {
645-
ctor public GoogleMapsGroundingChunk(String? uri, String? title, String? placeId);
646-
method public String? getPlaceId();
647-
method public String? getTitle();
648-
method public String? getUri();
649-
property public final String? placeId;
650-
property public final String? title;
651-
property public final String? uri;
652-
}
653-
654640
public final class GoogleSearch {
655641
ctor public GoogleSearch();
656642
}
@@ -664,12 +650,8 @@ package com.google.firebase.ai.type {
664650
}
665651

666652
public final class GroundingChunk {
667-
ctor public GroundingChunk();
668-
ctor public GroundingChunk(com.google.firebase.ai.type.WebGroundingChunk? web = null);
669-
ctor public GroundingChunk(com.google.firebase.ai.type.WebGroundingChunk? web = null, com.google.firebase.ai.type.GoogleMapsGroundingChunk? maps = null);
670-
method public com.google.firebase.ai.type.GoogleMapsGroundingChunk? getMaps();
653+
ctor public GroundingChunk(com.google.firebase.ai.type.WebGroundingChunk? web);
671654
method public com.google.firebase.ai.type.WebGroundingChunk? getWeb();
672-
property public final com.google.firebase.ai.type.GoogleMapsGroundingChunk? maps;
673655
property public final com.google.firebase.ai.type.WebGroundingChunk? web;
674656
}
675657

@@ -1185,17 +1167,6 @@ package com.google.firebase.ai.type {
11851167
method public com.google.firebase.ai.type.JsonSchema<java.lang.String> string(String? description = null, boolean nullable = false, com.google.firebase.ai.type.StringFormat? format = null, String? title = null);
11861168
}
11871169

1188-
public final class LatLng {
1189-
ctor public LatLng(double latitude, double longitude);
1190-
method public double component1();
1191-
method public double component2();
1192-
method public com.google.firebase.ai.type.LatLng copy(double latitude, double longitude);
1193-
method public double getLatitude();
1194-
method public double getLongitude();
1195-
property public final double latitude;
1196-
property public final double longitude;
1197-
}
1198-
11991170
@com.google.firebase.ai.type.PublicPreviewAPI public final class LiveAudioConversationConfig {
12001171
field public static final com.google.firebase.ai.type.LiveAudioConversationConfig.Companion Companion;
12011172
}
@@ -1405,28 +1376,6 @@ package com.google.firebase.ai.type {
14051376
property public final com.google.firebase.ai.type.GenerateContentResponse response;
14061377
}
14071378

1408-
public final class RetrievalConfig {
1409-
method public static com.google.firebase.ai.type.RetrievalConfig.Builder builder();
1410-
field public static final com.google.firebase.ai.type.RetrievalConfig.Companion Companion;
1411-
}
1412-
1413-
public static final class RetrievalConfig.Builder {
1414-
ctor public RetrievalConfig.Builder();
1415-
method public com.google.firebase.ai.type.RetrievalConfig build();
1416-
method public com.google.firebase.ai.type.RetrievalConfig.Builder setLanguageCode(String? languageCode);
1417-
method public com.google.firebase.ai.type.RetrievalConfig.Builder setLatLng(com.google.firebase.ai.type.LatLng? latLng);
1418-
field public String? languageCode;
1419-
field public com.google.firebase.ai.type.LatLng? latLng;
1420-
}
1421-
1422-
public static final class RetrievalConfig.Companion {
1423-
method public com.google.firebase.ai.type.RetrievalConfig.Builder builder();
1424-
}
1425-
1426-
public final class RetrievalConfigKt {
1427-
method public static com.google.firebase.ai.type.RetrievalConfig retrievalConfig(kotlin.jvm.functions.Function1<? super com.google.firebase.ai.type.RetrievalConfig.Builder,kotlin.Unit> init);
1428-
}
1429-
14301379
public final class SafetyRating {
14311380
method public Boolean? getBlocked();
14321381
method public com.google.firebase.ai.type.HarmCategory getCategory();
@@ -1669,8 +1618,6 @@ package com.google.firebase.ai.type {
16691618
method public static com.google.firebase.ai.type.Tool codeExecution();
16701619
method public static com.google.firebase.ai.type.Tool functionDeclarations(java.util.List<com.google.firebase.ai.type.FunctionDeclaration> functionDeclarations);
16711620
method public static com.google.firebase.ai.type.Tool functionDeclarations(java.util.List<com.google.firebase.ai.type.FunctionDeclaration>? functionDeclarations = null, java.util.List<? extends com.google.firebase.ai.type.AutoFunctionDeclaration<? extends java.lang.Object?,? extends java.lang.Object?>>? autoFunctionDeclarations);
1672-
method public static com.google.firebase.ai.type.Tool googleMaps();
1673-
method public static com.google.firebase.ai.type.Tool googleMaps(com.google.firebase.ai.type.GoogleMaps googleMaps = com.google.firebase.ai.type.GoogleMaps());
16741621
method public static com.google.firebase.ai.type.Tool googleSearch();
16751622
method public static com.google.firebase.ai.type.Tool googleSearch(com.google.firebase.ai.type.GoogleSearch googleSearch = com.google.firebase.ai.type.GoogleSearch());
16761623
method public static com.google.firebase.ai.type.Tool urlContext();
@@ -1682,18 +1629,14 @@ package com.google.firebase.ai.type {
16821629
method public com.google.firebase.ai.type.Tool codeExecution();
16831630
method public com.google.firebase.ai.type.Tool functionDeclarations(java.util.List<com.google.firebase.ai.type.FunctionDeclaration> functionDeclarations);
16841631
method public com.google.firebase.ai.type.Tool functionDeclarations(java.util.List<com.google.firebase.ai.type.FunctionDeclaration>? functionDeclarations = null, java.util.List<? extends com.google.firebase.ai.type.AutoFunctionDeclaration<? extends java.lang.Object?,? extends java.lang.Object?>>? autoFunctionDeclarations);
1685-
method public com.google.firebase.ai.type.Tool googleMaps();
1686-
method public com.google.firebase.ai.type.Tool googleMaps(com.google.firebase.ai.type.GoogleMaps googleMaps = com.google.firebase.ai.type.GoogleMaps());
16871632
method public com.google.firebase.ai.type.Tool googleSearch();
16881633
method public com.google.firebase.ai.type.Tool googleSearch(com.google.firebase.ai.type.GoogleSearch googleSearch = com.google.firebase.ai.type.GoogleSearch());
16891634
method public com.google.firebase.ai.type.Tool urlContext();
16901635
method public com.google.firebase.ai.type.Tool urlContext(com.google.firebase.ai.type.UrlContext urlContext = com.google.firebase.ai.type.UrlContext());
16911636
}
16921637

16931638
public final class ToolConfig {
1694-
ctor public ToolConfig();
1695-
ctor public ToolConfig(com.google.firebase.ai.type.FunctionCallingConfig? functionCallingConfig = null);
1696-
ctor public ToolConfig(com.google.firebase.ai.type.FunctionCallingConfig? functionCallingConfig = null, com.google.firebase.ai.type.RetrievalConfig? retrievalConfig = null);
1639+
ctor public ToolConfig(com.google.firebase.ai.type.FunctionCallingConfig? functionCallingConfig);
16971640
}
16981641

16991642
public final class Transcription {

ai-logic/firebase-ai/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
version=17.11.0
15+
version=17.10.2
1616
latestReleasedVersion=17.10.1

ai-logic/firebase-ai/src/androidTest/kotlin/com/google/firebase/ai/GroundingTests.kt

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

ai-logic/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Candidate.kt

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,6 @@ public class FinishReason private constructor(public val name: String, public va
336336
* Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section
337337
* within the Service Specific Terms).
338338
*
339-
* If using Grounding with Google Maps, you are required to comply with the "Grounding with Google
340-
* Maps" usage requirements for your chosen API provider:
341-
* [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-maps) or
342-
* Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section
343-
* within the Service Specific Terms).
344-
*
345339
* @property webSearchQueries The list of web search queries that the model performed to gather the
346340
* grounding information. These can be used to allow users to explore the search results themselves.
347341
* @property searchEntryPoint Google Search entry point for web searches. This contains an HTML/CSS
@@ -414,40 +408,15 @@ public class SearchEntryPoint(
414408
* Represents a chunk of retrieved data that supports a claim in the model's response.
415409
*
416410
* @property web Contains details if the grounding chunk is from a web source.
417-
* @property maps Contains details if the grounding chunk is from a Google Maps source.
418411
*/
419-
public class GroundingChunk
420-
@JvmOverloads
421-
constructor(
422-
public val web: WebGroundingChunk? = null,
423-
public val maps: GoogleMapsGroundingChunk? = null,
412+
public class GroundingChunk(
413+
public val web: WebGroundingChunk?,
424414
) {
425-
426415
@Serializable
427416
internal data class Internal(
428417
val web: WebGroundingChunk.Internal?,
429-
val maps: GoogleMapsGroundingChunk.Internal?,
430418
) {
431-
internal fun toPublic() = GroundingChunk(web = web?.toPublic(), maps?.toPublic())
432-
}
433-
}
434-
435-
/**
436-
* A grounding chunk from Google Maps.
437-
*
438-
* @property uri The URI of the place.
439-
* @property title The title of the place.
440-
* @property placeId This Place's resource name, in `places/{place_id}` format. This can be used to
441-
* look up the place using the Google Maps API.
442-
*/
443-
public class GoogleMapsGroundingChunk(
444-
public val uri: String?,
445-
public val title: String?,
446-
public val placeId: String?,
447-
) {
448-
@Serializable
449-
internal data class Internal(val uri: String?, val title: String?, val placeId: String?) {
450-
fun toPublic() = GoogleMapsGroundingChunk(uri, title, placeId)
419+
internal fun toPublic() = GroundingChunk(web = web?.toPublic())
451420
}
452421
}
453422

ai-logic/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/GoogleMaps.kt

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

ai-logic/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/LatLng.kt

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

0 commit comments

Comments
 (0)