|
39 | 39 | "CitationMetadata",
|
40 | 40 | "Citation",
|
41 | 41 | "Candidate",
|
| 42 | + "Segment", |
| 43 | + "GroundingAttribution", |
| 44 | + "GroundingMetadata", |
42 | 45 | },
|
43 | 46 | )
|
44 | 47 |
|
@@ -503,6 +506,9 @@ class Candidate(proto.Message):
|
503 | 506 | citation_metadata (google.cloud.aiplatform_v1beta1.types.CitationMetadata):
|
504 | 507 | Output only. Source attribution of the
|
505 | 508 | generated content.
|
| 509 | + grounding_metadata (google.cloud.aiplatform_v1beta1.types.GroundingMetadata): |
| 510 | + Output only. Metadata specifies sources used |
| 511 | + to ground generated content. |
506 | 512 | """
|
507 | 513 |
|
508 | 514 | class FinishReason(proto.Enum):
|
@@ -566,6 +572,125 @@ class FinishReason(proto.Enum):
|
566 | 572 | number=6,
|
567 | 573 | message="CitationMetadata",
|
568 | 574 | )
|
| 575 | + grounding_metadata: "GroundingMetadata" = proto.Field( |
| 576 | + proto.MESSAGE, |
| 577 | + number=7, |
| 578 | + message="GroundingMetadata", |
| 579 | + ) |
| 580 | + |
| 581 | + |
| 582 | +class Segment(proto.Message): |
| 583 | + r"""Segment of the content. |
| 584 | +
|
| 585 | + Attributes: |
| 586 | + part_index (int): |
| 587 | + Output only. The index of a Part object |
| 588 | + within its parent Content object. |
| 589 | + start_index (int): |
| 590 | + Output only. Start index in the given Part, |
| 591 | + measured in bytes. Offset from the start of the |
| 592 | + Part, inclusive, starting at zero. |
| 593 | + end_index (int): |
| 594 | + Output only. End index in the given Part, |
| 595 | + measured in bytes. Offset from the start of the |
| 596 | + Part, exclusive, starting at zero. |
| 597 | + """ |
| 598 | + |
| 599 | + part_index: int = proto.Field( |
| 600 | + proto.INT32, |
| 601 | + number=1, |
| 602 | + ) |
| 603 | + start_index: int = proto.Field( |
| 604 | + proto.INT32, |
| 605 | + number=2, |
| 606 | + ) |
| 607 | + end_index: int = proto.Field( |
| 608 | + proto.INT32, |
| 609 | + number=3, |
| 610 | + ) |
| 611 | + |
| 612 | + |
| 613 | +class GroundingAttribution(proto.Message): |
| 614 | + r"""Grounding attribution. |
| 615 | +
|
| 616 | + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields |
| 617 | +
|
| 618 | + Attributes: |
| 619 | + web (google.cloud.aiplatform_v1beta1.types.GroundingAttribution.Web): |
| 620 | + Optional. Attribution from the web. |
| 621 | +
|
| 622 | + This field is a member of `oneof`_ ``reference``. |
| 623 | + segment (google.cloud.aiplatform_v1beta1.types.Segment): |
| 624 | + Output only. Segment of the content this |
| 625 | + attribution belongs to. |
| 626 | + confidence_score (float): |
| 627 | + Optional. Output only. Confidence score of |
| 628 | + the attribution. Ranges from 0 to 1. 1 is the |
| 629 | + most confident. |
| 630 | +
|
| 631 | + This field is a member of `oneof`_ ``_confidence_score``. |
| 632 | + """ |
| 633 | + |
| 634 | + class Web(proto.Message): |
| 635 | + r"""Attribution from the web. |
| 636 | +
|
| 637 | + Attributes: |
| 638 | + uri (str): |
| 639 | + Output only. URI reference of the |
| 640 | + attribution. |
| 641 | + title (str): |
| 642 | + Output only. Title of the attribution. |
| 643 | + """ |
| 644 | + |
| 645 | + uri: str = proto.Field( |
| 646 | + proto.STRING, |
| 647 | + number=1, |
| 648 | + ) |
| 649 | + title: str = proto.Field( |
| 650 | + proto.STRING, |
| 651 | + number=2, |
| 652 | + ) |
| 653 | + |
| 654 | + web: Web = proto.Field( |
| 655 | + proto.MESSAGE, |
| 656 | + number=3, |
| 657 | + oneof="reference", |
| 658 | + message=Web, |
| 659 | + ) |
| 660 | + segment: "Segment" = proto.Field( |
| 661 | + proto.MESSAGE, |
| 662 | + number=1, |
| 663 | + message="Segment", |
| 664 | + ) |
| 665 | + confidence_score: float = proto.Field( |
| 666 | + proto.FLOAT, |
| 667 | + number=2, |
| 668 | + optional=True, |
| 669 | + ) |
| 670 | + |
| 671 | + |
| 672 | +class GroundingMetadata(proto.Message): |
| 673 | + r"""Metadata returned to client when grounding is enabled. |
| 674 | +
|
| 675 | + Attributes: |
| 676 | + web_search_queries (MutableSequence[str]): |
| 677 | + Optional. Web search queries for the |
| 678 | + following-up web search. |
| 679 | + grounding_attributions (MutableSequence[google.cloud.aiplatform_v1beta1.types.GroundingAttribution]): |
| 680 | + Optional. List of grounding attributions. |
| 681 | + """ |
| 682 | + |
| 683 | + web_search_queries: MutableSequence[str] = proto.RepeatedField( |
| 684 | + proto.STRING, |
| 685 | + number=1, |
| 686 | + ) |
| 687 | + grounding_attributions: MutableSequence[ |
| 688 | + "GroundingAttribution" |
| 689 | + ] = proto.RepeatedField( |
| 690 | + proto.MESSAGE, |
| 691 | + number=2, |
| 692 | + message="GroundingAttribution", |
| 693 | + ) |
569 | 694 |
|
570 | 695 |
|
571 | 696 | __all__ = tuple(sorted(__protobuf__.manifest))
|
0 commit comments