Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions librarian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ version: v0.51.0
repo: googleapis/google-cloud-python
sources:
googleapis:
commit: 968d491eddafaf61da6b8bd0a6a2710ec9e2fdbc
sha256: f61663b244a2907b2cce73cb16589f103d203cace88ed5a79228e27dc415bfe2
commit: 856bc831c52e81258768bba07eea278b78681924
sha256: 56ff0144615a042ae3f9e367f37f5e862a1afa0e5f6ce710e62fb18038a793ca
tools:
pip:
- name: black
Expand Down
8 changes: 8 additions & 0 deletions packages/google-apps-chat/google/apps/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@
MarkAsDoNotDisturbRequest,
UpdateAvailabilityRequest,
)
from google.apps.chat_v1.types.citation import Citation
from google.apps.chat_v1.types.cited_source import CitedSource
from google.apps.chat_v1.types.contextual_addon import ContextualAddOnMarkup
from google.apps.chat_v1.types.deletion_metadata import DeletionMetadata
from google.apps.chat_v1.types.elements import Elements
from google.apps.chat_v1.types.elements_common import ElementsImage
from google.apps.chat_v1.types.event_payload import (
MembershipBatchCreatedEventData,
MembershipBatchDeletedEventData,
Expand Down Expand Up @@ -224,8 +228,12 @@
"MarkAsAwayRequest",
"MarkAsDoNotDisturbRequest",
"UpdateAvailabilityRequest",
"Citation",
"CitedSource",
"ContextualAddOnMarkup",
"DeletionMetadata",
"Elements",
"ElementsImage",
"MembershipBatchCreatedEventData",
"MembershipBatchDeletedEventData",
"MembershipBatchUpdatedEventData",
Expand Down
12 changes: 12 additions & 0 deletions packages/google-apps-chat/google/apps/chat_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@
"google.apps.chat_v1.types.audience",
"google.apps.chat_v1.types.availability",
"google.apps.chat_v1.types.chat_service",
"google.apps.chat_v1.types.citation",
"google.apps.chat_v1.types.cited_source",
"google.apps.chat_v1.types.contextual_addon",
"google.apps.chat_v1.types.deletion_metadata",
"google.apps.chat_v1.types.elements",
"google.apps.chat_v1.types.elements_common",
"google.apps.chat_v1.types.event_payload",
"google.apps.chat_v1.types.group",
"google.apps.chat_v1.types.history_state",
Expand Down Expand Up @@ -92,8 +96,12 @@
MarkAsDoNotDisturbRequest,
UpdateAvailabilityRequest,
)
from .types.citation import Citation
from .types.cited_source import CitedSource
from .types.contextual_addon import ContextualAddOnMarkup
from .types.deletion_metadata import DeletionMetadata
from .types.elements import Elements
from .types.elements_common import ElementsImage
from .types.event_payload import (
MembershipBatchCreatedEventData,
MembershipBatchDeletedEventData,
Expand Down Expand Up @@ -245,6 +253,8 @@
"CardWithId",
"ChatServiceClient",
"ChatSpaceLinkData",
"Citation",
"CitedSource",
"CompleteImportSpaceRequest",
"CompleteImportSpaceResponse",
"ContextualAddOnMarkup",
Expand Down Expand Up @@ -272,6 +282,8 @@
"DoNotDisturbMetadata",
"DriveDataRef",
"DriveLinkData",
"Elements",
"ElementsImage",
"Emoji",
"EmojiReactionSummary",
"FindDirectMessageRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
availability,
contextual_addon,
deletion_metadata,
elements,
event_payload,
group,
history_state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
availability,
contextual_addon,
deletion_metadata,
elements,
event_payload,
group,
history_state,
Expand Down
16 changes: 16 additions & 0 deletions packages/google-apps-chat/google/apps/chat_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,24 @@
MarkAsDoNotDisturbRequest,
UpdateAvailabilityRequest,
)
from .citation import (
Citation,
)
from .cited_source import (
CitedSource,
)
from .contextual_addon import (
ContextualAddOnMarkup,
)
from .deletion_metadata import (
DeletionMetadata,
)
from .elements import (
Elements,
)
from .elements_common import (
ElementsImage,
)
from .event_payload import (
MembershipBatchCreatedEventData,
MembershipBatchDeletedEventData,
Expand Down Expand Up @@ -239,8 +251,12 @@
"MarkAsAwayRequest",
"MarkAsDoNotDisturbRequest",
"UpdateAvailabilityRequest",
"Citation",
"CitedSource",
"ContextualAddOnMarkup",
"DeletionMetadata",
"Elements",
"ElementsImage",
"MembershipBatchCreatedEventData",
"MembershipBatchDeletedEventData",
"MembershipBatchUpdatedEventData",
Expand Down
68 changes: 68 additions & 0 deletions packages/google-apps-chat/google/apps/chat_v1/types/citation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# -*- coding: utf-8 -*-
# Copyright 2026 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

import proto # type: ignore

from google.apps.chat_v1.types import cited_source

__protobuf__ = proto.module(
package="google.chat.v1",
manifest={
"Citation",
},
)


class Citation(proto.Message):
r"""Citations are inline references that can provide users more detailed
information about the inline reference. Corresponding inline
citations should be present in the message text in a markup format
of ``<chat-citation data-id="{id}">{text}</chat-citation>``.
Citations are only supported when the message's ``markup_syntax`` is
set to ``MARKDOWN``.

Unreferenced citations in ``Elements.citations`` (those without a
matching ``<chat-citation>`` tag in the message text) are ignored
and do not cause the message to be rejected.

Attributes:
id (str):
Required. The ID of the citation. This ID is defined by the
app creating the citation and must match the ``data-id``
attribute of the ``<chat-citation>`` tag in the message
text. Must contain only ASCII letters and numbers, and less
than 63 characters.
cited_sources (MutableSequence[google.apps.chat_v1.types.CitedSource]):
Optional. A list of sources that are relevant
to the citation. Sources are displayed in the
citation hover card.
"""

id: str = proto.Field(
proto.STRING,
number=1,
)
cited_sources: MutableSequence[cited_source.CitedSource] = proto.RepeatedField(
proto.MESSAGE,
number=3,
message=cited_source.CitedSource,
)


__all__ = tuple(sorted(__protobuf__.manifest))
112 changes: 112 additions & 0 deletions packages/google-apps-chat/google/apps/chat_v1/types/cited_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# -*- coding: utf-8 -*-
# Copyright 2026 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

import proto # type: ignore

from google.apps.chat_v1.types import elements_common

__protobuf__ = proto.module(
package="google.chat.v1",
manifest={
"CitedSource",
},
)


class CitedSource(proto.Message):
r"""A reference to a source of information.

Attributes:
title (str):
Required. The plaintext title of the ``CitedSource``. Does
not support markdown format.
uri (str):
Required. The URI pointing to the resource referenced by
this ``CitedSource``.
snippet (google.apps.chat_v1.types.CitedSource.Snippet):
Optional. Snippet containing information
directly from the source.
footer (google.apps.chat_v1.types.CitedSource.Footer):
Optional. Additional information to show
alongside the snippet in the form of a footer.
"""

class Snippet(proto.Message):
r"""A snippet object representing an excerpt from a larger
corpus.

Attributes:
text (str):
Optional. A short plaintext excerpt directly from the corpus
that is rendered in the citation hover card or source
preview. When footer sources are automatically populated
from inline ``citations`` (because
``Elements.cited_sources`` is not set), snippets are omitted
from the deduplicated footer sources. Does not support
markdown format, and must not exceed 1,000 characters.
image_preview (google.apps.chat_v1.types.ElementsImage):
Optional. Image preview of the snippet
provided as an input when creating the citation.
"""

text: str = proto.Field(
proto.STRING,
number=1,
)
image_preview: elements_common.ElementsImage = proto.Field(
proto.MESSAGE,
number=2,
message=elements_common.ElementsImage,
)

class Footer(proto.Message):
r"""A footer for a source, used for attribution.

Attributes:
text (str):
Optional. The plaintext to display in the
footer. Does not support markdown format.
"""

text: str = proto.Field(
proto.STRING,
number=1,
)

title: str = proto.Field(
proto.STRING,
number=1,
)
uri: str = proto.Field(
proto.STRING,
number=2,
)
snippet: Snippet = proto.Field(
proto.MESSAGE,
number=3,
message=Snippet,
)
footer: Footer = proto.Field(
proto.MESSAGE,
number=5,
message=Footer,
)


__all__ = tuple(sorted(__protobuf__.manifest))
65 changes: 65 additions & 0 deletions packages/google-apps-chat/google/apps/chat_v1/types/elements.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# -*- coding: utf-8 -*-
# Copyright 2026 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

import proto # type: ignore

from google.apps.chat_v1.types import citation, cited_source

__protobuf__ = proto.module(
package="google.chat.v1",
manifest={
"Elements",
},
)


class Elements(proto.Message):
r"""Elements are additional message components, including inline
``citations`` (where each citation is associated with a specific
portion of the message text) and ``cited_sources`` (which are
general references used to generate the response and are not
directly linked to specific segments of the text). Both
``citations`` and ``cited_sources`` can be provided as input when
creating or updating a message and are populated on output when
reading a message.

Attributes:
cited_sources (MutableSequence[google.apps.chat_v1.types.CitedSource]):
Optional. A list of sources to be displayed under the
message as footer links. These are not referenced inline.
For inline references, use ``citations``.
citations (MutableSequence[google.apps.chat_v1.types.Citation]):
Optional. A list of inline citations referenced within the
message text (via ``<chat-citation>`` tags) that render as
interactive hover cards.
"""

cited_sources: MutableSequence[cited_source.CitedSource] = proto.RepeatedField(
proto.MESSAGE,
number=1,
message=cited_source.CitedSource,
)
citations: MutableSequence[citation.Citation] = proto.RepeatedField(
proto.MESSAGE,
number=2,
message=citation.Citation,
)


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