Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
490 changes: 245 additions & 245 deletions .librarian/state.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
FunctionCallingConfig,
FunctionDeclaration,
FunctionResponse,
FunctionResponseBlob,
FunctionResponsePart,
GoogleSearchRetrieval,
GroundingPassage,
GroundingPassages,
Expand Down Expand Up @@ -163,6 +165,7 @@
GroundingChunk,
GroundingMetadata,
GroundingSupport,
ImageConfig,
LogprobsResult,
MultiSpeakerVoiceConfig,
PrebuiltVoiceConfig,
Expand Down Expand Up @@ -207,8 +210,8 @@
UpdatePermissionRequest,
)
from google.ai.generativelanguage_v1beta.types.prediction_service import (
GenerateVideoResponse,
Media,
PredictLongRunningGeneratedVideoResponse,
PredictLongRunningMetadata,
PredictLongRunningRequest,
PredictLongRunningResponse,
Expand Down Expand Up @@ -326,6 +329,8 @@
"FunctionCallingConfig",
"FunctionDeclaration",
"FunctionResponse",
"FunctionResponseBlob",
"FunctionResponsePart",
"GoogleSearchRetrieval",
"GroundingPassage",
"GroundingPassages",
Expand Down Expand Up @@ -387,6 +392,7 @@
"GroundingChunk",
"GroundingMetadata",
"GroundingSupport",
"ImageConfig",
"LogprobsResult",
"MultiSpeakerVoiceConfig",
"PrebuiltVoiceConfig",
Expand Down Expand Up @@ -425,8 +431,8 @@
"TransferOwnershipRequest",
"TransferOwnershipResponse",
"UpdatePermissionRequest",
"GenerateVideoResponse",
"Media",
"PredictLongRunningGeneratedVideoResponse",
"PredictLongRunningMetadata",
"PredictLongRunningRequest",
"PredictLongRunningResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ async def sample_generate_content():
Args:
request (Optional[Union[google.ai.generativelanguage_v1.types.GenerateContentRequest, dict]]):
The request object. Request to generate a completion from
the model.
the model. NEXT ID: 18
model (:class:`str`):
Required. The name of the ``Model`` to use for
generating the completion.
Expand Down Expand Up @@ -493,7 +493,7 @@ async def sample_stream_generate_content():
Args:
request (Optional[Union[google.ai.generativelanguage_v1.types.GenerateContentRequest, dict]]):
The request object. Request to generate a completion from
the model.
the model. NEXT ID: 18
model (:class:`str`):
Required. The name of the ``Model`` to use for
generating the completion.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ def sample_generate_content():
Args:
request (Union[google.ai.generativelanguage_v1.types.GenerateContentRequest, dict]):
The request object. Request to generate a completion from
the model.
the model. NEXT ID: 18
model (str):
Required. The name of the ``Model`` to use for
generating the completion.
Expand Down Expand Up @@ -906,7 +906,7 @@ def sample_stream_generate_content():
Args:
request (Union[google.ai.generativelanguage_v1.types.GenerateContentRequest, dict]):
The request object. Request to generate a completion from
the model.
the model. NEXT ID: 18
model (str):
Required. The name of the ``Model`` to use for
generating the completion.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ def __call__(
Args:
request (~.generative_service.GenerateContentRequest):
The request object. Request to generate a completion from
the model.
the model. NEXT ID: 18
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand Down Expand Up @@ -1244,7 +1244,7 @@ def __call__(
Args:
request (~.generative_service.GenerateContentRequest):
The request object. Request to generate a completion from
the model.
the model. NEXT ID: 18
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,14 @@ def _get_http_options():
"method": "get",
"uri": "/v1/{name=corpora/*/operations/*}",
},
{
"method": "get",
"uri": "/v1/{name=ragStores/*/operations/*}",
},
{
"method": "get",
"uri": "/v1/{name=ragStores/*/upload/operations/*}",
},
]
return http_options

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ def _get_http_options():
"method": "get",
"uri": "/v1/{name=corpora/*/operations/*}",
},
{
"method": "get",
"uri": "/v1/{name=ragStores/*/operations/*}",
},
{
"method": "get",
"uri": "/v1/{name=ragStores/*/upload/operations/*}",
},
]
return http_options

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import struct_pb2 # type: ignore
import proto # type: ignore

from google.ai.generativelanguage_v1.types import citation
Expand Down Expand Up @@ -96,6 +97,8 @@ class TaskType(proto.Enum):

class GenerateContentRequest(proto.Message):
r"""Request to generate a completion from the model.
NEXT ID: 18


.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Expand Down Expand Up @@ -170,6 +173,7 @@ class GenerateContentRequest(proto.Message):
class GenerationConfig(proto.Message):
r"""Configuration options for model generation and outputs. Not
all parameters are configurable for every model.
Next ID: 29


.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Expand Down Expand Up @@ -246,6 +250,9 @@ class GenerationConfig(proto.Message):
the request uses a randomly generated seed.

This field is a member of `oneof`_ ``_seed``.
response_json_schema_ordered (google.protobuf.struct_pb2.Value):
Optional. An internal detail. Use ``responseJsonSchema``
rather than this field.
presence_penalty (float):
Optional. Presence penalty applied to the next token's
logprobs if the token has already been seen in the response.
Expand Down Expand Up @@ -296,6 +303,7 @@ class GenerationConfig(proto.Message):
This sets the number of top logprobs to return at each
decoding step in the
[Candidate.logprobs_result][google.ai.generativelanguage.v1.Candidate.logprobs_result].
The number must be in the range of [0, 20].

This field is a member of `oneof`_ ``_logprobs``.
enable_enhanced_civic_answers (bool):
Expand Down Expand Up @@ -339,6 +347,11 @@ class GenerationConfig(proto.Message):
number=8,
optional=True,
)
response_json_schema_ordered: struct_pb2.Value = proto.Field(
proto.MESSAGE,
number=28,
message=struct_pb2.Value,
)
presence_penalty: float = proto.Field(
proto.FLOAT,
number=15,
Expand Down Expand Up @@ -576,6 +589,12 @@ class Candidate(proto.Message):
model stopped generating tokens.
If empty, the model has not stopped generating
tokens.
finish_message (str):
Optional. Output only. Details the reason why the model
stopped generating tokens. This is populated only when
``finish_reason`` is set.

This field is a member of `oneof`_ ``_finish_message``.
safety_ratings (MutableSequence[google.ai.generativelanguage_v1.types.SafetyRating]):
List of ratings for the safety of a response
candidate.
Expand Down Expand Up @@ -644,9 +663,21 @@ class FinishReason(proto.Enum):
IMAGE_SAFETY (11):
Token generation stopped because generated
images contain safety violations.
IMAGE_PROHIBITED_CONTENT (14):
Image generation stopped because generated
images has other prohibited content.
IMAGE_OTHER (15):
Image generation stopped because of other
miscellaneous issue.
NO_IMAGE (16):
The model was expected to generate an image,
but none was generated.
UNEXPECTED_TOOL_CALL (12):
Model generated a tool call but no tools were
enabled in the request.
TOO_MANY_TOOL_CALLS (13):
Model called too many tools consecutively,
thus the system exited execution.
"""
FINISH_REASON_UNSPECIFIED = 0
STOP = 1
Expand All @@ -660,7 +691,11 @@ class FinishReason(proto.Enum):
SPII = 9
MALFORMED_FUNCTION_CALL = 10
IMAGE_SAFETY = 11
IMAGE_PROHIBITED_CONTENT = 14
IMAGE_OTHER = 15
NO_IMAGE = 16
UNEXPECTED_TOOL_CALL = 12
TOO_MANY_TOOL_CALLS = 13

index: int = proto.Field(
proto.INT32,
Expand All @@ -677,6 +712,11 @@ class FinishReason(proto.Enum):
number=2,
enum=FinishReason,
)
finish_message: str = proto.Field(
proto.STRING,
number=4,
optional=True,
)
safety_ratings: MutableSequence[safety.SafetyRating] = proto.RepeatedField(
proto.MESSAGE,
number=5,
Expand Down Expand Up @@ -747,10 +787,18 @@ class UrlRetrievalStatus(proto.Enum):
Url retrieval is successful.
URL_RETRIEVAL_STATUS_ERROR (2):
Url retrieval is failed due to error.
URL_RETRIEVAL_STATUS_PAYWALL (3):
Url retrieval is failed because the content
is behind paywall.
URL_RETRIEVAL_STATUS_UNSAFE (4):
Url retrieval is failed because the content
is unsafe.
"""
URL_RETRIEVAL_STATUS_UNSPECIFIED = 0
URL_RETRIEVAL_STATUS_SUCCESS = 1
URL_RETRIEVAL_STATUS_ERROR = 2
URL_RETRIEVAL_STATUS_PAYWALL = 3
URL_RETRIEVAL_STATUS_UNSAFE = 4

retrieved_url: str = proto.Field(
proto.STRING,
Expand All @@ -766,7 +814,13 @@ class UrlRetrievalStatus(proto.Enum):
class LogprobsResult(proto.Message):
r"""Logprobs Result

.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes:
log_probability_sum (float):
Sum of log probabilities for all tokens.

This field is a member of `oneof`_ ``_log_probability_sum``.
top_candidates (MutableSequence[google.ai.generativelanguage_v1.types.LogprobsResult.TopCandidates]):
Length = total number of decoding steps.
chosen_candidates (MutableSequence[google.ai.generativelanguage_v1.types.LogprobsResult.Candidate]):
Expand Down Expand Up @@ -825,6 +879,11 @@ class TopCandidates(proto.Message):
message="LogprobsResult.Candidate",
)

log_probability_sum: float = proto.Field(
proto.FLOAT,
number=3,
optional=True,
)
top_candidates: MutableSequence[TopCandidates] = proto.RepeatedField(
proto.MESSAGE,
number=1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class HarmCategory(proto.Enum):
**Gemini** - Dangerous content.
HARM_CATEGORY_CIVIC_INTEGRITY (11):
**Gemini** - Content that may be used to harm civic
integrity.
integrity. DEPRECATED: use enable_enhanced_civic_answers
instead.
"""
HARM_CATEGORY_UNSPECIFIED = 0
HARM_CATEGORY_DEROGATORY = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
FunctionCallingConfig,
FunctionDeclaration,
FunctionResponse,
FunctionResponseBlob,
FunctionResponsePart,
GoogleSearchRetrieval,
GroundingPassage,
GroundingPassages,
Expand Down Expand Up @@ -127,6 +129,7 @@
GroundingChunk,
GroundingMetadata,
GroundingSupport,
ImageConfig,
LogprobsResult,
MultiSpeakerVoiceConfig,
PrebuiltVoiceConfig,
Expand Down Expand Up @@ -171,8 +174,8 @@
UpdatePermissionRequest,
)
from .types.prediction_service import (
GenerateVideoResponse,
Media,
PredictLongRunningGeneratedVideoResponse,
PredictLongRunningMetadata,
PredictLongRunningRequest,
PredictLongRunningResponse,
Expand Down Expand Up @@ -342,6 +345,8 @@
"FunctionCallingConfig",
"FunctionDeclaration",
"FunctionResponse",
"FunctionResponseBlob",
"FunctionResponsePart",
"GenerateAnswerRequest",
"GenerateAnswerResponse",
"GenerateContentRequest",
Expand All @@ -350,7 +355,6 @@
"GenerateMessageResponse",
"GenerateTextRequest",
"GenerateTextResponse",
"GenerateVideoResponse",
"GenerationConfig",
"GenerativeServiceClient",
"GetCachedContentRequest",
Expand All @@ -371,6 +375,7 @@
"GroundingSupport",
"HarmCategory",
"Hyperparameters",
"ImageConfig",
"ListCachedContentsRequest",
"ListCachedContentsResponse",
"ListChunksRequest",
Expand Down Expand Up @@ -401,6 +406,7 @@
"Permission",
"PermissionServiceClient",
"PrebuiltVoiceConfig",
"PredictLongRunningGeneratedVideoResponse",
"PredictLongRunningMetadata",
"PredictLongRunningRequest",
"PredictLongRunningResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ async def sample_generate_content():
Args:
request (Optional[Union[google.ai.generativelanguage_v1beta.types.GenerateContentRequest, dict]]):
The request object. Request to generate a completion from
the model.
the model. NEXT ID: 18
model (:class:`str`):
Required. The name of the ``Model`` to use for
generating the completion.
Expand Down Expand Up @@ -674,7 +674,7 @@ async def sample_stream_generate_content():
Args:
request (Optional[Union[google.ai.generativelanguage_v1beta.types.GenerateContentRequest, dict]]):
The request object. Request to generate a completion from
the model.
the model. NEXT ID: 18
model (:class:`str`):
Required. The name of the ``Model`` to use for
generating the completion.
Expand Down
Loading
Loading