@@ -206,10 +206,11 @@ defmodule TamaEx.AgenticTest do
206206 "identifier" => "thread-456"
207207 } ,
208208 "identifier" => "msg-stream" ,
209- "index" => 1 ,
210- "stream" => true
209+ "index" => 1
211210 }
212211
212+ options = [ stream: true ]
213+
213214 expected_message = """
214215 Stream handler is required when streaming is true pass a stream handler into options
215216
@@ -223,7 +224,7 @@ defmodule TamaEx.AgenticTest do
223224 """
224225
225226 assert_raise RuntimeError , expected_message , fn ->
226- Agentic . create_message ( client , body )
227+ Agentic . create_message ( client , body , options )
227228 end
228229 end
229230
@@ -234,7 +235,8 @@ defmodule TamaEx.AgenticTest do
234235 { :ok , body , conn } = Plug.Conn . read_body ( conn )
235236 request_data = Jason . decode! ( body )
236237
237- assert request_data [ "message" ] [ "stream" ] == true
238+ # Stream is now passed in options, not in the message body
239+ assert is_map ( request_data [ "message" ] )
238240
239241 conn =
240242 conn
@@ -293,11 +295,10 @@ defmodule TamaEx.AgenticTest do
293295 "identifier" => "thread-456"
294296 } ,
295297 "identifier" => "msg-stream" ,
296- "index" => 1 ,
297- "stream" => true
298+ "index" => 1
298299 }
299300
300- options = [ callback: callback ]
301+ options = [ stream: true , callback: callback ]
301302
302303 response = Agentic . create_message ( client , body , options )
303304
@@ -342,7 +343,8 @@ defmodule TamaEx.AgenticTest do
342343 { :ok , body , conn } = Plug.Conn . read_body ( conn )
343344 request_data = Jason . decode! ( body )
344345
345- assert request_data [ "message" ] [ "stream" ] == true
346+ # Stream is now passed in options, not in the message body
347+ assert is_map ( request_data [ "message" ] )
346348
347349 conn =
348350 conn
@@ -375,11 +377,10 @@ defmodule TamaEx.AgenticTest do
375377 identifier: "thread-atom"
376378 } ,
377379 identifier: "msg-atom" ,
378- index: 1 ,
379- stream: true
380+ index: 1
380381 }
381382
382- options = [ callback: callback ]
383+ options = [ stream: true , callback: callback ]
383384
384385 response = Agentic . create_message ( client , body , options )
385386
@@ -430,11 +431,10 @@ defmodule TamaEx.AgenticTest do
430431 "identifier" => "thread-mixed"
431432 } ,
432433 "identifier" => "msg-mixed" ,
433- "index" => 1 ,
434- "stream" => true
434+ "index" => 1
435435 }
436436
437- options = [ callback: callback ]
437+ options = [ stream: true , callback: callback ]
438438
439439 _response = Agentic . create_message ( client , body , options )
440440
0 commit comments