Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 85af135

Browse files
committed
fix tests
1 parent d10eb8d commit 85af135

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

lib/ai_helper/assistant.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ def generate_prompt(
131131
buffer_blk =
132132
Proc.new do |partial, _, type|
133133
json_summary_schema_key = bot.persona.response_format&.first.to_h
134-
135134
helper_response = [] if json_summary_schema_key["type"] == "array"
136-
137135
if type == :structured_output
138136
helper_chunk = partial.read_buffered_property(json_summary_schema_key["key"]&.to_sym)
139137
if !helper_chunk.nil? && !helper_chunk.empty?

spec/requests/ai_helper/assistant_controller_spec.rb

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,15 @@
186186

187187
context "when suggesting titles with a topic_id" do
188188
let(:title_suggestions) do
189-
"<item>What are your favourite fruits?</item><item>Love for fruits</item><item>Fruits are amazing</item><item>Favourite fruit list</item><item>Fruit share topic</item>"
189+
{
190+
output: [
191+
"What are your favourite fruits?",
192+
"Love for fruits",
193+
"Fruits are amazing",
194+
"Favourite fruit list",
195+
"Fruit share topic",
196+
],
197+
}
190198
end
191199
let(:title_suggestions_array) do
192200
[
@@ -210,7 +218,15 @@
210218

211219
context "when suggesting titles with input text" do
212220
let(:title_suggestions) do
213-
"<item>Apples - the best fruit</item><item>Why apples are great</item><item>Apples are the best fruit</item><item>My love for apples</item><item>I love apples</item>"
221+
{
222+
output: [
223+
"Apples - the best fruit",
224+
"Why apples are great",
225+
"Apples are the best fruit",
226+
"My love for apples",
227+
"I love apples",
228+
],
229+
}
214230
end
215231
let(:title_suggestions_array) do
216232
[

0 commit comments

Comments
 (0)