File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed
orchestration/src/test/java/com/sap/ai/sdk/orchestration Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 11package com .sap .ai .sdk .orchestration ;
22
3+ import static com .sap .ai .sdk .orchestration .OrchestrationAiModel .GPT_4O ;
34import static com .sap .ai .sdk .orchestration .OrchestrationUnitTest .CUSTOM_GPT_35 ;
45import static org .assertj .core .api .Assertions .assertThat ;
56import static org .assertj .core .api .Assertions .assertThatThrownBy ;
@@ -101,4 +102,26 @@ void testDpiMaskingConfig() {
101102 .withFailMessage ("withMaskingConfig() should overwrite the existing config and not append" )
102103 .hasSize (1 );
103104 }
105+
106+ @ Test
107+ void testLLMConfig () {
108+ Map <String , Object > params = Map .of ("foo" , "bar" );
109+ String version = "2024-05-13" ;
110+ OrchestrationAiModel aiModel = GPT_4O .withModelParams (params ).withModelVersion (version );
111+ var config = new OrchestrationModuleConfig ().withLlmConfig (aiModel );
112+
113+ var actual = ConfigToRequestTransformer .toModuleConfigs (config );
114+
115+ assertThat (actual .getLlmModuleConfig ()).isNotNull ();
116+ assertThat (actual .getLlmModuleConfig ().getModelName ()).isEqualTo (GPT_4O .getModelName ());
117+ assertThat (actual .getLlmModuleConfig ().getModelParams ()).isEqualTo (params );
118+ assertThat (actual .getLlmModuleConfig ().getModelVersion ()).isEqualTo (version );
119+
120+ assertThat (GPT_4O .getModelParams ())
121+ .withFailMessage ("Static models should be unchanged" )
122+ .isEmpty ();
123+ assertThat (GPT_4O .getModelVersion ())
124+ .withFailMessage ("Static models should be unchanged" )
125+ .isEqualTo ("latest" );
126+ }
104127}
Original file line number Diff line number Diff line change 7676 <enforcer .skipEnforceScopeLombok>false</enforcer .skipEnforceScopeLombok>
7777 <enforcer .skipBanGeneratedModulesReference>false</enforcer .skipBanGeneratedModulesReference>
7878 <!-- Test coverage -->
79- <coverage .instruction>74 %</coverage .instruction>
79+ <coverage .instruction>75 %</coverage .instruction>
8080 <coverage .branch>67%</coverage .branch>
81- <coverage .complexity>67 %</coverage .complexity>
82- <coverage .line>75 %</coverage .line>
83- <coverage .method>80 %</coverage .method>
81+ <coverage .complexity>69 %</coverage .complexity>
82+ <coverage .line>76 %</coverage .line>
83+ <coverage .method>85 %</coverage .method>
8484 <coverage .class>85%</coverage .class>
8585 </properties >
8686
You can’t perform that action at this time.
0 commit comments