File tree Expand file tree Collapse file tree
src/runloop_api_client/sdk Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -401,16 +401,15 @@ def _build_params(self) -> ScenarioCreateParams:
401401
402402 # Normalize weights to sum to 1.0
403403 total_weight = sum (s ["weight" ] for s in self ._scorers )
404- for s in self ._scorers :
405- s ["weight" ] = s ["weight" ] / total_weight
404+ normalized_scorers : List [ScoringFunctionParam ] = [{** s , "weight" : s ["weight" ] / total_weight } for s in self ._scorers ]
406405
407406 params : ScenarioCreateParams = {
408407 "name" : self ._name ,
409408 "input_context" : {
410409 "problem_statement" : self ._problem_statement ,
411410 },
412411 "scoring_contract" : {
413- "scoring_function_parameters" : self . _scorers ,
412+ "scoring_function_parameters" : normalized_scorers ,
414413 },
415414 }
416415
Original file line number Diff line number Diff line change @@ -401,16 +401,15 @@ def _build_params(self) -> ScenarioCreateParams:
401401
402402 # Normalize weights to sum to 1.0
403403 total_weight = sum (s ["weight" ] for s in self ._scorers )
404- for s in self ._scorers :
405- s ["weight" ] = s ["weight" ] / total_weight
404+ normalized_scorers : List [ScoringFunctionParam ] = [{** s , "weight" : s ["weight" ] / total_weight } for s in self ._scorers ]
406405
407406 params : ScenarioCreateParams = {
408407 "name" : self ._name ,
409408 "input_context" : {
410409 "problem_statement" : self ._problem_statement ,
411410 },
412411 "scoring_contract" : {
413- "scoring_function_parameters" : self . _scorers ,
412+ "scoring_function_parameters" : normalized_scorers ,
414413 },
415414 }
416415
You can’t perform that action at this time.
0 commit comments