File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
core/src/main/java/com/sap/ai/sdk/core Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ public class AiCoreService implements AiCoreDestination {
4242
4343 private static final String AI_RESOURCE_GROUP = "URL.headers.AI-Resource-Group" ;
4444
45+ /** loads the .env file from the root of the project */
46+ public static final Dotenv DOTENV = Dotenv .configure ().ignoreIfMissing ().load ();
47+
4548 /** The resource group is defined by AiCoreDeployment.withResourceGroup(). */
4649 @ Nonnull String resourceGroup ;
4750
@@ -161,7 +164,7 @@ public AiCoreDeployment forDeploymentByScenario(@Nonnull final String scenarioId
161164 @ Nonnull
162165 protected Destination getBaseDestination ()
163166 throws DestinationAccessException , DestinationNotFoundException {
164- val serviceKey = Dotenv . configure (). ignoreIfMissing (). load () .get ("AICORE_SERVICE_KEY" );
167+ val serviceKey = DOTENV .get ("AICORE_SERVICE_KEY" );
165168 return DestinationResolver .getDestination (serviceKey );
166169 }
167170
You can’t perform that action at this time.
0 commit comments