FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: add MALFORMED_RESPONSE to FinishReason by rksharma-owg · Pull Request #2947 · googleapis/python-genai · GitHub

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

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 8 additions & 0 deletions google/genai/tests/types/test_types.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
import pytest
from ... import types


def test_finish_reason_malformed_response():
assert types.FinishReason.MALFORMED_RESPONSE.value == 'MALFORMED_RESPONSE'
assert (
types.FinishReason('MALFORMED_RESPONSE')
is types.FinishReason.MALFORMED_RESPONSE
)

_is_mcp_imported = False
if typing.TYPE_CHECKING:
from mcp import types as mcp_types
Expand Down
2 changes: 2 additions & 0 deletions google/genai/types.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ class FinishReason(_common.CaseInSensitiveEnum):
"""Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII)."""
MALFORMED_FUNCTION_CALL = 'MALFORMED_FUNCTION_CALL'
"""The function call generated by the model is invalid."""
MALFORMED_RESPONSE = 'MALFORMED_RESPONSE'
"""The model response was malformed."""
IMAGE_SAFETY = 'IMAGE_SAFETY'
"""Token generation stopped because generated images have safety violations."""
UNEXPECTED_TOOL_CALL = 'UNEXPECTED_TOOL_CALL'
Expand Down
Loading

Back | FazBrowse Home | New Git URL