Skip to content
Open
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
101 changes: 69 additions & 32 deletions google/genai/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,14 @@ def __getattr__(name: str) -> Any:


class MediaProcessing(_common.CaseInSensitiveEnum):
"""How the model processes input media for understanding."""
"""How the model processes this part's media for understanding.

Only meaningful for video parts (`inline_data` or `file_data` with video
mime). Non-video parts ignore this field.
"""

MEDIA_PROCESSING_UNSPECIFIED = 'MEDIA_PROCESSING_UNSPECIFIED'
"""Default. Uses model-specific processing"""
"""Defaults to model-specific processing."""
STATIC = 'STATIC'
"""Fixed-rate frame extraction. All frames placed in context."""
AGENTIC = 'AGENTIC'
Expand Down Expand Up @@ -516,39 +520,49 @@ class FinishReason(_common.CaseInSensitiveEnum):
FINISH_REASON_UNSPECIFIED = 'FINISH_REASON_UNSPECIFIED'
"""The finish reason is unspecified."""
STOP = 'STOP'
"""Token generation reached a natural stopping point or a configured stop sequence."""
"""The model reached a natural stopping point or a configured stop sequence."""
MAX_TOKENS = 'MAX_TOKENS'
"""Token generation reached the configured maximum output tokens."""
"""The model generated the maximum number of tokens allowed by the `max_output_tokens` parameter."""
SAFETY = 'SAFETY'
"""Token generation stopped because the content potentially contains safety violations. NOTE: When streaming, [content][] is empty if content filters blocks the output."""
"""The model stopped generating because the content potentially violates safety policies. NOTE: When streaming, the `content` field is empty if content filters block the output."""
RECITATION = 'RECITATION'
"""The token generation stopped because of potential recitation."""
"""The model stopped generating because the content may be a recitation from a source."""
LANGUAGE = 'LANGUAGE'
"""The token generation stopped because of using an unsupported language."""
"""The response candidate content was flagged for using an unsupported language. This enum value is not supported in Vertex AI."""
OTHER = 'OTHER'
"""All other reasons that stopped the token generation."""
"""The model stopped generating for a reason not otherwise specified."""
BLOCKLIST = 'BLOCKLIST'
"""Token generation stopped because the content contains forbidden terms."""
"""The model stopped generating because the content contains a term from a configured blocklist."""
PROHIBITED_CONTENT = 'PROHIBITED_CONTENT'
"""Token generation stopped for potentially containing prohibited content."""
"""The model stopped generating because the content may be prohibited."""
SPII = 'SPII'
"""Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII)."""
"""The model stopped generating because the content may contain sensitive personally identifiable information (SPII)."""
MALFORMED_FUNCTION_CALL = 'MALFORMED_FUNCTION_CALL'
"""The function call generated by the model is invalid."""
"""The model generated a function call that is syntactically invalid and can't be parsed."""
IMAGE_SAFETY = 'IMAGE_SAFETY'
"""Token generation stopped because generated images have safety violations."""
IMAGE_PROHIBITED_CONTENT = 'IMAGE_PROHIBITED_CONTENT'
"""The generated image may contain prohibited content."""
IMAGE_OTHER = 'IMAGE_OTHER'
"""The image generation stopped for a reason not otherwise specified."""
NO_IMAGE = 'NO_IMAGE'
"""The model was expected to generate an image, but didn't."""
IMAGE_RECITATION = 'IMAGE_RECITATION'
"""The generated image may be a recitation from a source."""
UNEXPECTED_TOOL_CALL = 'UNEXPECTED_TOOL_CALL'
"""The tool call generated by the model is invalid."""
TOO_MANY_TOOL_CALLS = 'TOO_MANY_TOOL_CALLS'
"""Model called too many tools consecutively, thus the system exited execution."""
IMAGE_PROHIBITED_CONTENT = 'IMAGE_PROHIBITED_CONTENT'
"""Image generation stopped because the generated images have prohibited content."""
NO_IMAGE = 'NO_IMAGE'
"""The model was expected to generate an image, but none was generated."""
IMAGE_RECITATION = 'IMAGE_RECITATION'
"""Image generation stopped because the generated image may be a recitation from a source."""
IMAGE_OTHER = 'IMAGE_OTHER'
"""Image generation stopped for a reason not otherwise specified."""
MISSING_THOUGHT_SIGNATURE = 'MISSING_THOUGHT_SIGNATURE'
"""Request has at least one thought signature missing. This enum value is not supported in Vertex AI."""
MALFORMED_RESPONSE = 'MALFORMED_RESPONSE'
"""Finished due to malformed response. This enum value is not supported in Vertex AI."""
ESCALATION = 'ESCALATION'
"""Request was filtered by an escalation rule. This enum value is not supported in Vertex AI."""
PUP_LIMITED_DISABLED = 'PUP_LIMITED_DISABLED'
"""Indicates that token generation stopped because the user account is limited or disabled due to Prohibited Use Policy (PUP) violations. This enum value is not supported in Vertex AI."""
MODEL_ARMOR = 'MODEL_ARMOR'
"""The model response was blocked by Model Armor. This enum value is not supported in Gemini API."""


class HarmProbability(_common.CaseInSensitiveEnum):
Expand Down Expand Up @@ -683,10 +697,17 @@ class ModelStage(_common.CaseInSensitiveEnum):


class MediaResolution(_common.CaseInSensitiveEnum):
"""The media resolution to use."""
"""The token resolution at which input media content is sampled.

This is used to control the trade-off between the quality of the response and
the number of tokens used to represent the media. A higher resolution allows
the model to perceive more detail, which can lead to a more nuanced response,
but it will also use more tokens. This does not affect the image dimensions
sent to the model.
"""

MEDIA_RESOLUTION_UNSPECIFIED = 'MEDIA_RESOLUTION_UNSPECIFIED'
"""Media resolution has not been set"""
"""Media resolution has not been set."""
MEDIA_RESOLUTION_LOW = 'MEDIA_RESOLUTION_LOW'
"""Media resolution set to low (64 tokens)."""
MEDIA_RESOLUTION_MEDIUM = 'MEDIA_RESOLUTION_MEDIUM'
Expand All @@ -699,13 +720,13 @@ class Modality(_common.CaseInSensitiveEnum):
"""Server content modalities."""

MODALITY_UNSPECIFIED = 'MODALITY_UNSPECIFIED'
"""The modality is unspecified."""
"""Unspecified modality. Will be processed as text."""
TEXT = 'TEXT'
"""Indicates the model should return text"""
"""Text modality."""
IMAGE = 'IMAGE'
"""Indicates the model should return images."""
"""Image modality."""
AUDIO = 'AUDIO'
"""Indicates the model should return audio."""
"""Audio modality."""
VIDEO = 'VIDEO'
"""Indicates the model should return video."""

Expand Down Expand Up @@ -832,14 +853,24 @@ class MatchOperation(_common.CaseInSensitiveEnum):


class ReinforcementTuningThinkingLevel(_common.CaseInSensitiveEnum):
"""Represents how much to think for the tuning job."""
"""Indicates the maximum thinking depth during tuning.

Starting from Gemini 3.5 models, the old thinking_budget will no longer be
supported and will result in a user error if set. Instead, users should use
the thinking_level parameter to control the maximum thinking depth. This enum
is not supported in Gemini API.
"""

REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED = (
'REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED'
)
"""Unspecified thinking level."""
MINIMAL = 'MINIMAL'
"""Little to no thinking."""
LOW = 'LOW'
"""Low thinking level."""
MEDIUM = 'MEDIUM'
"""Medium thinking level."""
HIGH = 'HIGH'
"""High thinking level."""

Expand Down Expand Up @@ -868,7 +899,7 @@ class JobState(_common.CaseInSensitiveEnum):
JOB_STATE_EXPIRED = 'JOB_STATE_EXPIRED'
"""The job has expired."""
JOB_STATE_UPDATING = 'JOB_STATE_UPDATING'
"""The job is being updated. Only jobs in the `JOB_STATE_RUNNING` state can be updated. After updating, the job goes back to the `JOB_STATE_RUNNING` state."""
"""The job is being updated. Only jobs in the `RUNNING` state can be updated. After updating, the job goes back to the `RUNNING` state."""
JOB_STATE_PARTIALLY_SUCCEEDED = 'JOB_STATE_PARTIALLY_SUCCEEDED'
"""The job is partially succeeded, some results may be missing due to errors."""

Expand Down Expand Up @@ -1010,10 +1041,13 @@ class ServiceTier(_common.CaseInSensitiveEnum):


class RubricContentType(_common.CaseInSensitiveEnum):
"""Represents the rubric content type."""
"""The type of rubric content to be generated.

This enum is not supported in Gemini API.
"""

RUBRIC_CONTENT_TYPE_UNSPECIFIED = 'RUBRIC_CONTENT_TYPE_UNSPECIFIED'
"""Rubric content type is unspecified."""
"""The content type to generate is not specified."""
PROPERTY = 'PROPERTY'
"""Generate rubrics based on properties."""
NL_QUESTION_ANSWER = 'NL_QUESTION_ANSWER'
Expand All @@ -1023,12 +1057,15 @@ class RubricContentType(_common.CaseInSensitiveEnum):


class ComputationBasedMetricType(_common.CaseInSensitiveEnum):
"""Represents the type of the computation based metric."""
"""The type of the computation based metric.

This enum is not supported in Gemini API.
"""

COMPUTATION_BASED_METRIC_TYPE_UNSPECIFIED = (
'COMPUTATION_BASED_METRIC_TYPE_UNSPECIFIED'
)
"""Computation based metric type is unspecified."""
"""Unspecified computation based metric type."""
EXACT_MATCH = 'EXACT_MATCH'
"""Exact match metric."""
BLEU = 'BLEU'
Expand Down
Loading