Skip to content

Commit 4d69ffa

Browse files
Actually use the parsed response.
1 parent 5847c81 commit 4d69ffa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

python/src/typechat/_internal/translator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ async def translate(self, request: str, *, prompt_preamble: str | list[PromptSec
8383
error_message: str
8484
if 0 <= first_curly < last_curly:
8585
trimmed_response = text_response[first_curly:last_curly]
86-
pydantic_core.from_json(trimmed_response, allow_inf_nan=False, cache_strings=False)
87-
result = self.validator.validate_object(trimmed_response)
86+
parsed_response = pydantic_core.from_json(trimmed_response, allow_inf_nan=False, cache_strings=False)
87+
result = self.validator.validate_object(parsed_response)
8888
if isinstance(result, Success):
8989
return result
9090
error_message = result.message

0 commit comments

Comments
 (0)