fix:Makes TranscriptionEntry.role optional

For function call or response, the role is None for now.

PiperOrigin-RevId: 760692876
This commit is contained in:
Hangfei Lin 2025-05-19 11:01:30 -07:00 committed by Copybara-Service
parent 9932015f3b
commit 171b1145ee

View File

@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Optional
from typing import Union
from google.genai import types
@ -28,8 +29,9 @@ class TranscriptionEntry(BaseModel):
)
"""The pydantic model config."""
role: str
"""The role that created this data, typically "user" or "model"""
role: Optional[str] = None
"""The role that created this data, typically "user" or "model". For function
call, this is None."""
data: Union[types.Blob, types.Content]
"""The data that can be used for transcription"""