5454 ResourceNotFoundError ,
5555)
5656from owl .utils .test import (
57+ BEDROCK_CLAUDE_HAIKU_CONFIG ,
58+ BEDROCK_CLAUDE_HAIKU_DEPLOYMENT ,
5759 ELLM_EMBEDDING_CONFIG ,
5860 ELLM_EMBEDDING_DEPLOYMENT ,
5961 GPT_4O_MINI_CONFIG ,
@@ -146,6 +148,7 @@ def setup():
146148 create_model_config (GPT_4O_MINI_CONFIG ),
147149 create_model_config (GPT_5_MINI_CONFIG ),
148150 create_model_config (OPENAI_O4_MINI_CONFIG ),
151+ create_model_config (BEDROCK_CLAUDE_HAIKU_CONFIG ),
149152 create_model_config (
150153 {
151154 # "id": "openai/Qwen/Qwen-2-Audio-7B",
@@ -166,6 +169,7 @@ def setup():
166169 create_deployment (GPT_4O_MINI_DEPLOYMENT ),
167170 create_deployment (GPT_5_MINI_DEPLOYMENT ),
168171 create_deployment (OPENAI_O4_MINI_DEPLOYMENT ),
172+ create_deployment (BEDROCK_CLAUDE_HAIKU_DEPLOYMENT ),
169173 create_deployment (
170174 DeploymentCreate (
171175 model_id = llm_config_audio .id ,
@@ -1761,6 +1765,60 @@ def test_chat_history_and_sequential_regen(
17611765 assert "8" in output , output
17621766
17631767
1768+ @pytest .mark .parametrize ("table_type" , TABLE_TYPES )
1769+ @pytest .mark .parametrize ("stream" , ** STREAM_PARAMS )
1770+ def test_bedrock_multiturn_handle_blank_content (
1771+ setup : ServingContext ,
1772+ table_type : TableType ,
1773+ stream : bool ,
1774+ ):
1775+ client = JamAI (user_id = setup .user_id , project_id = setup .project_id )
1776+ cols = [
1777+ ColumnSchemaCreate (id = "input" , dtype = "str" ),
1778+ ColumnSchemaCreate (
1779+ id = "output" ,
1780+ dtype = "str" ,
1781+ gen_config = LLMGenConfig (
1782+ system_prompt = "You are a calculator." ,
1783+ prompt = "${input}" ,
1784+ multi_turn = True ,
1785+ temperature = 0.001 ,
1786+ top_p = 0.001 ,
1787+ max_tokens = 1050 , # higher than thinking.budget_tokens
1788+ model = "anthropic/claude-haiku-4-5-bedrock" ,
1789+ reasoning_effort = "low" ,
1790+ ),
1791+ ),
1792+ ]
1793+ with _create_table (client , table_type , cols = cols ) as table :
1794+ assert isinstance (table , TableMetaResponse )
1795+ # Initialise chat thread and set output format
1796+ response = client .table .add_table_rows (
1797+ table_type ,
1798+ MultiRowAddRequest (
1799+ table_id = table .id ,
1800+ data = [
1801+ dict (input = "x = 0" , output = "0" ),
1802+ dict (input = "Add 1" , output = "" ),
1803+ dict (input = "Add 2" , output = "" ),
1804+ dict (input = "Add 1" , output = "4" ),
1805+ ],
1806+ stream = False ,
1807+ ),
1808+ )
1809+ # Test adding one row
1810+ response = client .table .add_table_rows (
1811+ table_type ,
1812+ MultiRowAddRequest (
1813+ table_id = table .id ,
1814+ data = [dict (input = "Add 1" )],
1815+ stream = stream ,
1816+ ),
1817+ )
1818+ output = _collect_text (response , "output" )
1819+ assert "5" in output , output
1820+
1821+
17641822@pytest .mark .parametrize ("table_type" , TABLE_TYPES )
17651823@pytest .mark .parametrize ("stream" , ** STREAM_PARAMS )
17661824def test_convert_into_multi_turn (
0 commit comments