diff --git a/google/genai/types.py b/google/genai/types.py index 2c1ba022c..cc3c4ce43 100644 --- a/google/genai/types.py +++ b/google/genai/types.py @@ -515,51 +515,60 @@ class AudioTranscriptionConfigMode(_common.CaseInSensitiveEnum): class FinishReason(_common.CaseInSensitiveEnum): - """Output only. The reason why the model stopped generating tokens. + """Output only. - If empty, the model has not stopped generating the tokens. + The reason why the model stopped generating tokens. If empty, the model has + not stopped generating. """ 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.""" - 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.""" + """The generated image potentially violates safety policies.""" IMAGE_PROHIBITED_CONTENT = 'IMAGE_PROHIBITED_CONTENT' - """Image generation stopped because the generated images have 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 none was generated.""" + """The model was expected to generate an image, but didn't.""" 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.""" - CONTINUATION = 'CONTINUATION' - """Token generation stopped because the response reached the per-request token limit, but generation is not yet complete. The response can be continued by passing the returned `continuation_token` in a subsequent request.""" + """The generated image may be a recitation from a source.""" + UNEXPECTED_TOOL_CALL = 'UNEXPECTED_TOOL_CALL' + """The model generated a function call that is semantically invalid. This can happen, for example, if function calling is not enabled or the generated function is not in the function declaration.""" + TOO_MANY_TOOL_CALLS = 'TOO_MANY_TOOL_CALLS' + """The model made too many tool calls in a single request, so the server-side tool loop stopped before the model returned a final answer.""" + 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' - """Token generation stopped because the response was malformed.""" + """Finishes due to malformed response.""" + 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.""" + CONTINUATION = 'CONTINUATION' + """Token generation was stopped because the response reached the per-request token limit, but generation is not yet complete. The model response can be continued via a subsequent request using the returned `continuation_token`.""" + 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): @@ -856,7 +865,13 @@ 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' @@ -864,6 +879,10 @@ class ReinforcementTuningThinkingLevel(_common.CaseInSensitiveEnum): """Unspecified thinking level.""" MINIMAL = 'MINIMAL' """Little to no thinking.""" + LOW = 'LOW' + """Low thinking level.""" + MEDIUM = 'MEDIUM' + """Medium thinking level.""" HIGH = 'HIGH' """High thinking level."""