Skip to content

Commit 91c841c

Browse files
fix(speech-generation): return correct finish reason type in Google provider (withceleste#102)
1 parent a35bc37 commit 91c841c

File tree

1 file changed

+8
-0
lines changed
  • packages/capabilities/speech-generation/src/celeste_speech_generation/providers/google

1 file changed

+8
-0
lines changed

packages/capabilities/speech-generation/src/celeste_speech_generation/providers/google/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from celeste.parameters import ParameterMapper
1111
from celeste_speech_generation.client import SpeechGenerationClient
1212
from celeste_speech_generation.io import (
13+
SpeechGenerationFinishReason,
1314
SpeechGenerationInput,
1415
SpeechGenerationUsage,
1516
)
@@ -41,6 +42,13 @@ def _parse_usage(self, response_data: dict[str, Any]) -> SpeechGenerationUsage:
4142
usage = super()._parse_usage(response_data)
4243
return SpeechGenerationUsage(**usage)
4344

45+
def _parse_finish_reason(
46+
self, response_data: dict[str, Any]
47+
) -> SpeechGenerationFinishReason:
48+
"""Parse finish reason from response."""
49+
finish_reason = super()._parse_finish_reason(response_data)
50+
return SpeechGenerationFinishReason(reason=finish_reason.reason)
51+
4452
def _parse_content(
4553
self,
4654
response_data: dict[str, Any],

0 commit comments

Comments
 (0)