@@ -36,6 +36,7 @@ pub fn get_tool_parser_map() -> &'static HashMap<&'static str, ToolCallConfig> {
3636 map. insert ( "deepseek_v3" , ToolCallConfig :: deepseek_v3 ( ) ) ;
3737 map. insert ( "deepseek_v3_1" , ToolCallConfig :: deepseek_v3_1 ( ) ) ;
3838 map. insert ( "qwen3_coder" , ToolCallConfig :: qwen3_coder ( ) ) ;
39+ map. insert ( "jamba" , ToolCallConfig :: jamba ( ) ) ;
3940 map. insert ( "default" , ToolCallConfig :: default ( ) ) ;
4041 map
4142 } )
@@ -191,6 +192,7 @@ mod tests {
191192 "deepseek_v3" ,
192193 "deepseek_v3_1" ,
193194 "qwen3_coder" ,
195+ "jamba" ,
194196 ] ;
195197 for parser in available_parsers {
196198 assert ! ( parsers. contains( & parser) ) ;
@@ -940,19 +942,11 @@ Remember, San Francisco weather can be quite unpredictable, particularly with it
940942 }
941943
942944 #[ tokio:: test]
943- #[ ignore]
944945 async fn test_ai21labs_ai21_jamba_15_mini_simple ( ) {
945- let input = r#" [
946- {"name": "get_weather", "arguments": {"location": "San Francisco, CA", "unit": "fahrenheit"}}
947- ]"# ;
948- let config = ToolCallConfig {
949- parser_config : ParserConfig :: Json ( JsonParserConfig {
950- tool_call_start_tokens : vec ! [ ] ,
951- tool_call_end_tokens : vec ! [ ] ,
952- arguments_keys : vec ! [ "arguments" . to_string( ) ] ,
953- ..Default :: default ( )
954- } ) ,
955- } ;
946+ let input = r#"<tool_calls>[
947+ {"name": "get_weather", "arguments": {"location": "San Francisco, CA", "unit": "fahrenheit"}}
948+ ]</tool_calls>"# ;
949+ let config = ToolCallConfig :: jamba ( ) ;
956950 let ( result, content) = try_tool_call_parse ( input, & config) . await . unwrap ( ) ;
957951 assert_eq ! ( content, Some ( "" . to_string( ) ) ) ;
958952 assert ! ( !result. is_empty( ) ) ;
@@ -963,6 +957,29 @@ Remember, San Francisco weather can be quite unpredictable, particularly with it
963957 assert_eq ! ( args[ "unit" ] , "fahrenheit" ) ;
964958 }
965959
960+ #[ tokio:: test]
961+ async fn test_ai21labs_ai21_jamba_15_mini_multiple ( ) {
962+ let input = r#"<tool_calls>[
963+ {"name": "get_weather", "arguments": {"location": "San Francisco, CA", "unit": "fahrenheit"}},
964+ {"name": "get_weather", "arguments": {"location": "New York, NY", "unit": "celsius"}}
965+ ]</tool_calls>"# ;
966+ let config = ToolCallConfig :: jamba ( ) ;
967+ let ( result, content) = try_tool_call_parse ( input, & config) . await . unwrap ( ) ;
968+ assert_eq ! ( content, Some ( "" . to_string( ) ) ) ;
969+ assert ! ( !result. is_empty( ) ) ;
970+ assert_eq ! ( result. len( ) , 2 ) ;
971+
972+ let ( name, args) = extract_name_and_args ( result[ 0 ] . clone ( ) ) ;
973+ assert_eq ! ( name, "get_weather" ) ;
974+ assert_eq ! ( args[ "location" ] , "San Francisco, CA" ) ;
975+ assert_eq ! ( args[ "unit" ] , "fahrenheit" ) ;
976+
977+ let ( name, args) = extract_name_and_args ( result[ 1 ] . clone ( ) ) ;
978+ assert_eq ! ( name, "get_weather" ) ;
979+ assert_eq ! ( args[ "location" ] , "New York, NY" ) ;
980+ assert_eq ! ( args[ "unit" ] , "celsius" ) ;
981+ }
982+
966983 #[ tokio:: test]
967984 #[ ignore]
968985 async fn test_salesforce_llama_xlam_2_8b_fc_r_simple ( ) {
0 commit comments