Skip to content

Commit

Permalink
feat: [google-maps-places] add generative_summary and `area_summary…
Browse files Browse the repository at this point in the history
…` for place summaries (#12709)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat: add `generative_summary` and `area_summary` for place summaries
feat: add `contextual_contents` field for contextual search results
docs: `included_primary_types` supports type collections `(regions)` and
`(cities)`
END_COMMIT_OVERRIDE

Introduces Place summaries and Contextual Search Results features.

PiperOrigin-RevId: 634816526

Source-Link:
googleapis/googleapis@badabdc

Source-Link:
googleapis/googleapis-gen@bec34dc
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcGxhY2VzLy5Pd2xCb3QueWFtbCIsImgiOiJiZWMzNGRjODczODBjMjdhNzI3MWE0ZDRmOWViZWRmODRlODFmODMxIn0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
  • Loading branch information
3 people authored May 27, 2024
1 parent c5affe1 commit 46d0d9f
Show file tree
Hide file tree
Showing 11 changed files with 474 additions and 8 deletions.
6 changes: 6 additions & 0 deletions packages/google-maps-places/google/maps/places/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from google.maps.places_v1.services.places.async_client import PlacesAsyncClient
from google.maps.places_v1.services.places.client import PlacesClient
from google.maps.places_v1.types.attribution import AuthorAttribution
from google.maps.places_v1.types.content_block import ContentBlock
from google.maps.places_v1.types.contextual_content import ContextualContent
from google.maps.places_v1.types.ev_charging import EVChargeOptions, EVConnectorType
from google.maps.places_v1.types.fuel_options import FuelOptions
from google.maps.places_v1.types.geometry import Circle
Expand All @@ -37,12 +39,15 @@
SearchTextRequest,
SearchTextResponse,
)
from google.maps.places_v1.types.reference import References
from google.maps.places_v1.types.review import Review

__all__ = (
"PlacesClient",
"PlacesAsyncClient",
"AuthorAttribution",
"ContentBlock",
"ContextualContent",
"EVChargeOptions",
"EVConnectorType",
"FuelOptions",
Expand All @@ -59,5 +64,6 @@
"SearchNearbyResponse",
"SearchTextRequest",
"SearchTextResponse",
"References",
"Review",
)
6 changes: 6 additions & 0 deletions packages/google-maps-places/google/maps/places_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

from .services.places import PlacesAsyncClient, PlacesClient
from .types.attribution import AuthorAttribution
from .types.content_block import ContentBlock
from .types.contextual_content import ContextualContent
from .types.ev_charging import EVChargeOptions, EVConnectorType
from .types.fuel_options import FuelOptions
from .types.geometry import Circle
Expand All @@ -36,6 +38,7 @@
SearchTextRequest,
SearchTextResponse,
)
from .types.reference import References
from .types.review import Review

__all__ = (
Expand All @@ -44,6 +47,8 @@
"AutocompletePlacesRequest",
"AutocompletePlacesResponse",
"Circle",
"ContentBlock",
"ContextualContent",
"EVChargeOptions",
"EVConnectorType",
"FuelOptions",
Expand All @@ -54,6 +59,7 @@
"Place",
"PlacesClient",
"PriceLevel",
"References",
"Review",
"SearchNearbyRequest",
"SearchNearbyResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from google.type import localized_text_pb2 # type: ignore

from google.maps.places_v1.types import (
contextual_content,
ev_charging,
fuel_options,
photo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from google.type import localized_text_pb2 # type: ignore

from google.maps.places_v1.types import (
contextual_content,
ev_charging,
fuel_options,
photo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# limitations under the License.
#
from .attribution import AuthorAttribution
from .content_block import ContentBlock
from .contextual_content import ContextualContent
from .ev_charging import EVChargeOptions, EVConnectorType
from .fuel_options import FuelOptions
from .geometry import Circle
Expand All @@ -30,10 +32,13 @@
SearchTextRequest,
SearchTextResponse,
)
from .reference import References
from .review import Review

__all__ = (
"AuthorAttribution",
"ContentBlock",
"ContextualContent",
"EVChargeOptions",
"EVConnectorType",
"FuelOptions",
Expand All @@ -50,5 +55,6 @@
"SearchNearbyResponse",
"SearchTextRequest",
"SearchTextResponse",
"References",
"Review",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# -*- coding: utf-8 -*-
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

from typing import MutableMapping, MutableSequence

from google.type import localized_text_pb2 # type: ignore
import proto # type: ignore

from google.maps.places_v1.types import reference

__protobuf__ = proto.module(
package="google.maps.places.v1",
manifest={
"ContentBlock",
},
)


class ContentBlock(proto.Message):
r"""A block of content that can be served individually.
Attributes:
topic (str):
The topic of the content, for example
"overview" or "restaurant".
content (google.type.localized_text_pb2.LocalizedText):
Content related to the topic.
references (google.maps.places_v1.types.References):
Experimental: See
https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative
for more details.
References that are related to this block of
content.
"""

topic: str = proto.Field(
proto.STRING,
number=1,
)
content: localized_text_pb2.LocalizedText = proto.Field(
proto.MESSAGE,
number=2,
message=localized_text_pb2.LocalizedText,
)
references: reference.References = proto.Field(
proto.MESSAGE,
number=3,
message=reference.References,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Loading

0 comments on commit 46d0d9f

Please sign in to comment.