@@ -317,39 +317,49 @@ def test_reasoning_traces_with_implicit_dialog_rails_flows_only():
317317def test_reasoning_traces_with_implicit_dialog_rails_user_messages_only ():
318318 """Test that reasoning traces cannot be enabled when dialog rails are implicitly enabled through user messages (user canonical forms) only."""
319319
320- _ = RailsConfig .from_content (
321- yaml_content = """
322- models:
323- - type: main
324- engine: openai
325- model: gpt-3.5-turbo-instruct
326- reasoning_config:
327- remove_thinking_traces: false
328- """ ,
329- colang_content = """
320+ with pytest .raises (ValueError ) as exc_info :
321+ _ = RailsConfig .from_content (
322+ yaml_content = """
323+ models:
324+ - type: main
325+ engine: openai
326+ model: gpt-3.5-turbo-instruct
327+ reasoning_config:
328+ remove_thinking_traces: false
329+ """ ,
330+ colang_content = """
330331 define user express greeting
331- "hello"
332- "hi"
333- """ ,
332+ "hello"
333+ "hi"
334+ """ ,
335+ )
336+
337+ assert "Reasoning traces must be disabled when dialog rails are present" in str (
338+ exc_info .value
334339 )
335340
336341
337342def test_reasoning_traces_with_bot_messages_only ():
338- """Test that reasoning traces can exist with bot messages only ."""
343+ """Test that reasoning traces cannot be enabled when bot messages are present ."""
339344
340- _ = RailsConfig .from_content (
341- yaml_content = """
342- models:
343- - type: main
344- engine: openai
345- model: gpt-3.5-turbo-instruct
346- reasoning_config:
347- remove_thinking_traces: False
348- """ ,
349- colang_content = """
350- define bot express greeting
351- "Hello there!"
352- """ ,
345+ with pytest .raises (ValueError ) as exc_info :
346+ _ = RailsConfig .from_content (
347+ yaml_content = """
348+ models:
349+ - type: main
350+ engine: openai
351+ model: gpt-3.5-turbo-instruct
352+ reasoning_config:
353+ remove_thinking_traces: False
354+ """ ,
355+ colang_content = """
356+ define bot express greeting
357+ "Hello there!"
358+ """ ,
359+ )
360+
361+ assert "Reasoning traces must be disabled when dialog rails are present" in str (
362+ exc_info .value
353363 )
354364
355365
@@ -580,3 +590,50 @@ def test_reasoning_traces_with_partial_dedicated_models():
580590 "Please update your config.yml to set 'remove_thinking_traces: true' under reasoning_config"
581591 in str (exc_info .value )
582592 )
593+
594+
595+ def test_reasoning_traces_with_implicit_dialog_rails_embeddings_only ():
596+ """Test that reasoning traces can be enabled when embeddings_only is True, even with user messages."""
597+
598+ _ = RailsConfig .from_content (
599+ yaml_content = """
600+ models:
601+ - type: main
602+ engine: openai
603+ model: gpt-3.5-turbo-instruct
604+ reasoning_config:
605+ remove_thinking_traces: False
606+ rails:
607+ dialog:
608+ user_messages:
609+ embeddings_only: True
610+ """ ,
611+ colang_content = """
612+ define user express greeting
613+ "hello"
614+ "hi"
615+ """ ,
616+ )
617+
618+
619+ def test_reasoning_traces_with_bot_messages_embeddings_only ():
620+ """Test that reasoning traces can be enabled when embeddings_only is True, even with bot messages."""
621+
622+ _ = RailsConfig .from_content (
623+ yaml_content = """
624+ models:
625+ - type: main
626+ engine: openai
627+ model: gpt-3.5-turbo-instruct
628+ reasoning_config:
629+ remove_thinking_traces: False
630+ rails:
631+ dialog:
632+ user_messages:
633+ embeddings_only: True
634+ """ ,
635+ colang_content = """
636+ define bot express greeting
637+ "Hello there!"
638+ """ ,
639+ )
0 commit comments