This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
spec/lib/modules/ai_helper Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -140,8 +140,8 @@ def generate_prompt(
140140 end
141141 elsif type . blank?
142142 # Assume response is a regular completion.
143- helper_response << helper_chunk
144- block . call ( helper_chunk ) if block
143+ helper_response << partial
144+ block . call ( partial ) if block
145145 end
146146 end
147147
Original file line number Diff line number Diff line change 176176
177177 expect ( response [ :suggestions ] ) . to contain_exactly ( english_text )
178178 end
179+
180+ context "when the persona is not using structured outputs" do
181+ it "still works" do
182+ regular_persona = Fabricate ( :ai_persona , response_format : nil )
183+ SiteSetting . ai_helper_translator_persona = regular_persona . id
184+
185+ response =
186+ DiscourseAi ::Completions ::Llm . with_prepared_responses ( [ english_text ] ) do
187+ subject . generate_and_send_prompt ( mode , text_to_translate , user )
188+ end
189+
190+ expect ( response [ :suggestions ] ) . to contain_exactly ( english_text )
191+ end
192+ end
179193 end
180194
181195 context "when using a prompt that returns a list" do
You can’t perform that action at this time.
0 commit comments