Skip to content

Commit 45bde59

Browse files
authored
DEV: Use StructuredOutput's new read chunk method (#301)
1 parent 2397335 commit 45bde59

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/services/discourse_ai/base_translator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def translate
2222
response_format: response_format,
2323
)
2424

25-
structured_output&.read_latest_buffered_chunk&.dig(:translation)
25+
structured_output&.read_buffered_property(:translation)
2626
end
2727

2828
def formatted_content

app/services/discourse_ai/language_detector.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def detect
5757
response_format: response_format,
5858
)
5959

60-
structured_output&.read_latest_buffered_chunk&.dig(:locale)
60+
structured_output&.read_buffered_property(:locale)
6161
end
6262

6363
def response_format

0 commit comments

Comments
 (0)