diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/AICoreService.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/AICoreService.java
deleted file mode 100644
index 8a2e24c..0000000
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/AICoreService.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * © 2026 SAP SE or an SAP affiliate company and cds-ai contributors.
- */
-package com.sap.cds.feature.aicore.api;
-
-import com.sap.cds.services.cds.RemoteService;
-import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient;
-
-/**
- * CAP service contract for SAP AI Core integration.
- *
- *
The service exposes resource-group, configuration and deployment lifecycle as CDS entities
- * (see {@link #RESOURCE_GROUPS}, {@link #DEPLOYMENTS}, {@link #CONFIGURATIONS}) and additionally
- * provides programmatic helpers to:
- *
- *
- * - Resolve the resource group ID for the current tenant ({@link #resourceGroup()}), creating
- * it on-demand when multi-tenancy is enabled.
- *
- Resolve (or create) a deployment matching a {@link ModelDeploymentSpec} ({@link
- * #deploymentId(String, ModelDeploymentSpec)}).
- *
- Build an {@link ApiClient} preconfigured for inference against a specific deployment
- * ({@link #inferenceClient(String, String)}).
- *
- *
- * The implementation is tenant-aware: it reads the current tenant from the {@code
- * RequestContext}. Callers do not need to pass tenant identifiers explicitly.
- */
-public interface AICoreService extends RemoteService {
-
- /** Default service name under which an instance is registered in the service catalog. */
- String DEFAULT_NAME = "AICoreService$Default";
-
- /** Qualified name of the {@code resourceGroups} entity exposed by this service. */
- String RESOURCE_GROUPS = "AICore.resourceGroups";
-
- /** Qualified name of the {@code deployments} entity exposed by this service. */
- String DEPLOYMENTS = "AICore.deployments";
-
- /** Qualified name of the {@code configurations} entity exposed by this service. */
- String CONFIGURATIONS = "AICore.configurations";
-
- /**
- * Returns the AI Core resource group ID associated with the current tenant.
- *
- *
When multi-tenancy is disabled the configured default resource group is returned. When
- * enabled, the resource group is looked up by the {@code ext.ai.sap.com/CDS_TENANT_ID} label and
- * created on first call if it does not exist.
- *
- * @return the AI Core resource group ID for the current tenant
- */
- String resourceGroup();
-
- /**
- * Returns the AI Core resource group ID associated with the given tenant.
- *
- *
This variant is used during subscribe/unsubscribe flows where the tenant ID is explicitly
- * available from the context rather than the current request.
- *
- * @param tenantId the CDS tenant identifier
- * @return the AI Core resource group ID for the specified tenant
- */
- String resourceGroupForTenant(String tenantId);
-
- /**
- * Returns the deployment ID for the given model spec inside the given resource group.
- *
- *
Looks up an existing RUNNING/PENDING deployment that matches the spec, otherwise creates a
- * configuration (if missing) and a new deployment, then polls until the deployment reaches
- * RUNNING. Results are cached per {@code (resourceGroupId, configurationName)} pair.
- *
- * @param resourceGroupId the AI Core resource group to operate in
- * @param spec the deployment specification (scenario, executable, configuration name and
- * existing-match predicate)
- * @return the deployment ID
- */
- String deploymentId(String resourceGroupId, ModelDeploymentSpec spec);
-
- /**
- * Returns an {@link ApiClient} preconfigured with the inference destination for the given
- * deployment, suitable for constructing foundation-model SDK clients.
- *
- * @param resourceGroupId the AI Core resource group containing the deployment
- * @param deploymentId the deployment ID returned by {@link #deploymentId(String,
- * ModelDeploymentSpec)}
- * @return a configured {@link ApiClient} pointing at the deployment's inference endpoint
- */
- ApiClient inferenceClient(String resourceGroupId, String deploymentId);
-}
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/DeploymentIdContext.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/DeploymentIdContext.java
index 4fa04d9..04857c0 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/DeploymentIdContext.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/DeploymentIdContext.java
@@ -9,9 +9,9 @@
/**
* Typed {@link EventContext} for the {@code deploymentId} event.
*
- *
Emitted by {@link AICoreService#deploymentId(String, ModelDeploymentSpec)} to resolve (or
- * create) a deployment matching the given spec inside the given resource group. The ON handler
- * performs cache lookup, retry, configuration creation, deployment creation and polling.
+ *
Emitted on the AI Core service to resolve (or create) a deployment matching the given spec
+ * inside the given resource group. The ON handler performs cache lookup, retry, configuration
+ * creation, deployment creation and polling.
*/
@EventName(DeploymentIdContext.EVENT)
public interface DeploymentIdContext extends EventContext {
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/InferenceClientContext.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/InferenceClientContext.java
index 1b3095e..8ed8710 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/InferenceClientContext.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/InferenceClientContext.java
@@ -10,8 +10,8 @@
/**
* Typed {@link EventContext} for the {@code inferenceClient} event.
*
- *
Emitted by {@link AICoreService#inferenceClient(String, String)} to build an {@link ApiClient}
- * preconfigured with the inference destination for the given deployment.
+ *
Emitted on the AI Core service to build an {@link ApiClient} preconfigured with the inference
+ * destination for the given deployment.
*/
@EventName(InferenceClientContext.EVENT)
public interface InferenceClientContext extends EventContext {
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/ModelDeploymentSpec.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/ModelDeploymentSpec.java
index a51d1b6..72b29f3 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/ModelDeploymentSpec.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/ModelDeploymentSpec.java
@@ -9,8 +9,8 @@
import java.util.function.Predicate;
/**
- * Describes a target AI Core deployment used by {@link AICoreService#deploymentId(String,
- * ModelDeploymentSpec)} to look up or create a deployment inside a resource group.
+ * Describes a target AI Core deployment used by the {@code deploymentId} event to look up or create
+ * a deployment inside a resource group.
*
*
The spec carries the AI Core scenario/executable identification, the human-readable
* configuration name (used as a stable key for caching and idempotent reuse), the parameter
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/ResourceGroupContext.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/ResourceGroupContext.java
index 19a2a82..9d08328 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/ResourceGroupContext.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/api/ResourceGroupContext.java
@@ -9,9 +9,9 @@
/**
* Typed {@link EventContext} for the {@code resourceGroup} event.
*
- *
Emitted by {@link AICoreService#resourceGroup()} to resolve the AI Core resource group ID for
- * the current tenant. In multi-tenancy mode, the resource group is created on-demand if it does not
- * exist. In single-tenancy mode, the configured default resource group is returned.
+ *
Emitted on the AI Core service to resolve the AI Core resource group ID for the current
+ * tenant. In multi-tenancy mode, the resource group is created on-demand if it does not exist. In
+ * single-tenancy mode, the configured default resource group is returned.
*
*
If {@link #getTenantId()} is non-null, the handler uses the explicit tenant ID. Otherwise, the
* current tenant is read from the {@code RequestContext}.
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/AICoreServiceConfiguration.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/AICoreServiceConfiguration.java
index 202ed8d..8ad1bda 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/AICoreServiceConfiguration.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/AICoreServiceConfiguration.java
@@ -7,7 +7,6 @@
import com.sap.ai.sdk.core.client.ConfigurationApi;
import com.sap.ai.sdk.core.client.DeploymentApi;
import com.sap.ai.sdk.core.client.ResourceGroupApi;
-import com.sap.cds.feature.aicore.api.AICoreService;
import com.sap.cds.feature.aicore.core.handler.AICoreApiHandler;
import com.sap.cds.feature.aicore.core.handler.AICoreSetupHandler;
import com.sap.cds.feature.aicore.core.handler.ActionHandler;
@@ -17,7 +16,9 @@
import com.sap.cds.feature.aicore.core.handler.MockAICoreSetupHandler;
import com.sap.cds.feature.aicore.core.handler.MockEntityHandler;
import com.sap.cds.feature.aicore.core.handler.ResourceGroupHandler;
+import com.sap.cds.feature.aicore.generated.cds4j.aicore.AICore_;
import com.sap.cds.services.environment.CdsProperties;
+import com.sap.cds.services.environment.CdsProperties.Remote.RemoteServiceConfig;
import com.sap.cds.services.mt.DeploymentService;
import com.sap.cds.services.runtime.CdsRuntime;
import com.sap.cds.services.runtime.CdsRuntimeConfiguration;
@@ -27,13 +28,16 @@
import org.slf4j.LoggerFactory;
/**
- * {@link CdsRuntimeConfiguration} that wires the {@code AICore} service and its event handlers into
- * the CAP Java runtime.
+ * {@link CdsRuntimeConfiguration} that wires the {@code AICore} remote service and its event
+ * handlers into the CAP Java runtime.
*
- *
Detects the presence of an SAP AI Core service binding (either a regular service binding or
- * the {@code AICORE_SERVICE_KEY} environment variable used for hybrid local testing) and registers
- * the appropriate handlers. Picked up automatically through {@code ServiceLoader}; applications do
- * not need to instantiate this class directly.
+ *
In the {@link #environment} phase, a {@link RemoteServiceConfig} entry for "AICore" is
+ * injected into the runtime properties so the framework's {@code RemoteServiceConfiguration}
+ * auto-creates the service instance from the CDS model. This follows the same pattern used by
+ * {@code cds-feature-notifications}.
+ *
+ *
In the {@link #eventHandlers} phase, production or mock handlers are registered depending on
+ * whether an AI Core service binding is present.
*/
public class AICoreServiceConfiguration implements CdsRuntimeConfiguration {
@@ -43,34 +47,23 @@ public class AICoreServiceConfiguration implements CdsRuntimeConfiguration {
private AICoreClients clients;
private DeploymentResolver resolver;
- private static boolean hasAICoreModel(CdsRuntime runtime) {
- return runtime.getCdsModel().findService("AICore").isPresent();
- }
-
- private static boolean hasAICoreBinding(CdsRuntime runtime) {
- return runtime
- .getEnvironment()
- .getServiceBindings()
- .filter(b -> ServiceBindingUtils.matches(b, "aicore"))
- .findFirst()
- .isPresent();
- }
-
/**
- * Detects multi-tenancy by checking the standard CAP Java {@code cds.multiTenancy.sidecar.url}
- * property or the presence of a {@link DeploymentService} in the service catalog. This aligns
- * with the standard CAP Java convention — no custom property flag is needed.
+ * Injects a {@link RemoteServiceConfig} for "AICore" into the runtime properties. This runs
+ * before all {@code services()} methods, ensuring the framework's {@code
+ * RemoteServiceConfiguration} will auto-create a {@code RemoteServiceImpl} for the AICore CDS
+ * service definition.
*/
- private static boolean detectMultiTenancy(CdsRuntime runtime) {
- CdsProperties props = runtime.getEnvironment().getCdsProperties();
- String sidecarUrl = props.getMultiTenancy().getSidecar().getUrl();
- if (sidecarUrl != null && !sidecarUrl.isBlank()) {
- return true;
- }
- return runtime
- .getServiceCatalog()
- .getService(DeploymentService.class, DeploymentService.DEFAULT_NAME)
- != null;
+ @Override
+ public void environment(CdsRuntimeConfigurer configurer) {
+ RemoteServiceConfig remoteConfig = new RemoteServiceConfig(AICore_.CDS_NAME);
+ remoteConfig.setModel(AICore_.CDS_NAME);
+ configurer
+ .getCdsRuntime()
+ .getEnvironment()
+ .getCdsProperties()
+ .getRemote()
+ .getServices()
+ .putIfAbsent(AICore_.CDS_NAME, remoteConfig);
}
@Override
@@ -78,7 +71,7 @@ public void services(CdsRuntimeConfigurer configurer) {
CdsRuntime runtime = configurer.getCdsRuntime();
if (!hasAICoreModel(runtime)) {
- logger.debug("AICore CDS model not found in runtime model — skipping service registration.");
+ logger.debug("AICore CDS model not found in runtime model - skipping handler setup.");
return;
}
@@ -96,23 +89,19 @@ public void services(CdsRuntimeConfigurer configurer) {
this.clients =
new AICoreClients(deploymentApi, configurationApi, resourceGroupApi, sdkService);
this.resolver = new DeploymentResolver(config, deploymentApi, resourceGroupApi);
- logger.info("Registered AICoreService backed by AI Core binding.");
+ logger.info("AI Core binding detected - production handlers will be registered.");
} else {
- logger.info(
- "Registered AICoreService (no AI Core binding found — mock handlers will be used).");
+ logger.info("No AI Core binding found - mock handlers will be registered.");
}
-
- configurer.service(new AICoreServiceImpl(AICoreService.DEFAULT_NAME, runtime));
}
@Override
public void eventHandlers(CdsRuntimeConfigurer configurer) {
if (config == null) {
- return; // No AICore model — services() skipped registration
+ return; // No AICore model - services() skipped
}
if (clients != null) {
- // Production path: real AI Core binding
configurer.eventHandler(new AICoreApiHandler(config, clients, resolver));
configurer.eventHandler(new ResourceGroupHandler(config, clients, resolver));
configurer.eventHandler(new DeploymentHandler(config, clients, resolver));
@@ -125,7 +114,6 @@ public void eventHandlers(CdsRuntimeConfigurer configurer) {
logger.debug("Registered AI Core setup handler for MTX subscribe/unsubscribe.");
}
} else {
- // Mock path: no AI Core binding
MockAICoreApiHandler mockApiHandler = new MockAICoreApiHandler(config);
configurer.eventHandler(new MockEntityHandler());
configurer.eventHandler(mockApiHandler);
@@ -137,4 +125,29 @@ public void eventHandlers(CdsRuntimeConfigurer configurer) {
}
}
}
+
+ private static boolean hasAICoreModel(CdsRuntime runtime) {
+ return runtime.getCdsModel().findService(AICore_.CDS_NAME).isPresent();
+ }
+
+ private static boolean hasAICoreBinding(CdsRuntime runtime) {
+ return runtime
+ .getEnvironment()
+ .getServiceBindings()
+ .filter(b -> ServiceBindingUtils.matches(b, "aicore"))
+ .findFirst()
+ .isPresent();
+ }
+
+ private static boolean detectMultiTenancy(CdsRuntime runtime) {
+ CdsProperties props = runtime.getEnvironment().getCdsProperties();
+ String sidecarUrl = props.getMultiTenancy().getSidecar().getUrl();
+ if (sidecarUrl != null && !sidecarUrl.isBlank()) {
+ return true;
+ }
+ return runtime
+ .getServiceCatalog()
+ .getService(DeploymentService.class, DeploymentService.DEFAULT_NAME)
+ != null;
+ }
}
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/AICoreServiceImpl.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/AICoreServiceImpl.java
deleted file mode 100644
index b1c226c..0000000
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/AICoreServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * © 2026 SAP SE or an SAP affiliate company and cds-ai contributors.
- */
-package com.sap.cds.feature.aicore.core;
-
-import com.sap.cds.feature.aicore.api.AICoreService;
-import com.sap.cds.feature.aicore.api.DeploymentIdContext;
-import com.sap.cds.feature.aicore.api.InferenceClientContext;
-import com.sap.cds.feature.aicore.api.ModelDeploymentSpec;
-import com.sap.cds.feature.aicore.api.ResourceGroupContext;
-import com.sap.cds.services.impl.cds.AbstractCdsDefinedService;
-import com.sap.cds.services.runtime.CdsRuntime;
-import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient;
-
-/**
- * Production implementation of {@link AICoreService}.
- *
- *
This class is a pure delegation layer: each API method creates a typed {@link
- * com.sap.cds.services.EventContext EventContext}, emits it via the CAP event mechanism, and
- * returns the handler's result. All business logic (caching, locking, API calls) lives in the
- * registered ON handlers which receive their dependencies via constructor injection.
- *
- *
Implementation note: This class extends {@code AbstractCdsDefinedService}
- * from the CAP Java runtime's internal {@code impl} package. This is necessary because the public
- * API ({@code ServiceDelegator}) does not provide CQN execution capabilities or CDS model binding.
- * The semi-public {@code AbstractCqnService} (from {@code cds-services-utils}) provides CQN but not
- * {@code getDefinition()}. Until a public API alternative exists, this coupling is accepted and
- * version-compatibility is verified through integration tests against the CAP Java runtime.
- */
-public class AICoreServiceImpl extends AbstractCdsDefinedService implements AICoreService {
-
- private static final String CDS_DEFINITION_NAME = "AICore";
-
- public AICoreServiceImpl(String name, CdsRuntime runtime) {
- super(name, CDS_DEFINITION_NAME, runtime);
- }
-
- @Override
- public String resourceGroup() {
- ResourceGroupContext ctx = ResourceGroupContext.create();
- emit(ctx);
- return ctx.getResult();
- }
-
- @Override
- public String resourceGroupForTenant(String tenantId) {
- ResourceGroupContext ctx = ResourceGroupContext.create();
- ctx.setTenantId(tenantId);
- emit(ctx);
- return ctx.getResult();
- }
-
- @Override
- public String deploymentId(String resourceGroupId, ModelDeploymentSpec spec) {
- DeploymentIdContext ctx = DeploymentIdContext.create();
- ctx.setResourceGroupId(resourceGroupId);
- ctx.setSpec(spec);
- emit(ctx);
- return ctx.getResult();
- }
-
- @Override
- public ApiClient inferenceClient(String resourceGroupId, String deploymentId) {
- InferenceClientContext ctx = InferenceClientContext.create();
- ctx.setResourceGroupId(resourceGroupId);
- ctx.setDeploymentId(deploymentId);
- emit(ctx);
- return ctx.getResult();
- }
-}
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/AICoreApiHandler.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/AICoreApiHandler.java
index 3ecf8e7..2ab2ee7 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/AICoreApiHandler.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/AICoreApiHandler.java
@@ -10,7 +10,6 @@
import com.sap.ai.sdk.core.model.AiDeploymentList;
import com.sap.ai.sdk.core.model.AiDeploymentResponseWithDetails;
import com.sap.ai.sdk.core.model.AiDeploymentStatus;
-import com.sap.cds.feature.aicore.api.AICoreService;
import com.sap.cds.feature.aicore.api.DeploymentIdContext;
import com.sap.cds.feature.aicore.api.InferenceClientContext;
import com.sap.cds.feature.aicore.api.ModelDeploymentSpec;
@@ -18,6 +17,7 @@
import com.sap.cds.feature.aicore.core.AICoreClients;
import com.sap.cds.feature.aicore.core.AICoreConfig;
import com.sap.cds.feature.aicore.core.DeploymentResolver;
+import com.sap.cds.feature.aicore.generated.cds4j.aicore.AICore_;
import com.sap.cds.services.ErrorStatuses;
import com.sap.cds.services.ServiceException;
import com.sap.cds.services.handler.EventHandler;
@@ -32,13 +32,13 @@
import org.slf4j.LoggerFactory;
/**
- * ON handler for the {@link AICoreService} API events ({@code resourceGroup}, {@code deploymentId},
+ * ON handler for the AI Core service API events ({@code resourceGroup}, {@code deploymentId},
* {@code inferenceClient}).
*
*
Contains the business logic for deployment discovery/creation and inference client
* construction. Resource-group resolution is delegated to {@link DeploymentResolver}.
*/
-@ServiceName(AICoreService.DEFAULT_NAME)
+@ServiceName(AICore_.CDS_NAME)
public class AICoreApiHandler implements EventHandler {
private static final Logger logger = LoggerFactory.getLogger(AICoreApiHandler.class);
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/ActionHandler.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/ActionHandler.java
index 2c9d1e7..f2ea8ef 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/ActionHandler.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/ActionHandler.java
@@ -5,10 +5,10 @@
import com.sap.ai.sdk.core.model.AiDeploymentModificationRequest;
import com.sap.ai.sdk.core.model.AiDeploymentTargetStatus;
-import com.sap.cds.feature.aicore.api.AICoreService;
import com.sap.cds.feature.aicore.core.AICoreClients;
import com.sap.cds.feature.aicore.core.AICoreConfig;
import com.sap.cds.feature.aicore.core.DeploymentResolver;
+import com.sap.cds.feature.aicore.generated.cds4j.aicore.AICore_;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.Deployments;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.DeploymentsStopContext;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.Deployments_;
@@ -19,7 +19,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@ServiceName(AICoreService.DEFAULT_NAME)
+@ServiceName(AICore_.CDS_NAME)
public class ActionHandler extends AbstractCrudHandler {
private static final Logger logger = LoggerFactory.getLogger(ActionHandler.class);
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/ConfigurationHandler.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/ConfigurationHandler.java
index bf4e1d8..01a9f4b 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/ConfigurationHandler.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/ConfigurationHandler.java
@@ -7,10 +7,10 @@
import com.sap.ai.sdk.core.model.AiConfigurationBaseData;
import com.sap.ai.sdk.core.model.AiConfigurationList;
import com.sap.ai.sdk.core.model.AiParameterArgumentBinding;
-import com.sap.cds.feature.aicore.api.AICoreService;
import com.sap.cds.feature.aicore.core.AICoreClients;
import com.sap.cds.feature.aicore.core.AICoreConfig;
import com.sap.cds.feature.aicore.core.DeploymentResolver;
+import com.sap.cds.feature.aicore.generated.cds4j.aicore.AICore_;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.ArtifactArgumentBinding;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.Configurations;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.Configurations_;
@@ -32,7 +32,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@ServiceName(AICoreService.DEFAULT_NAME)
+@ServiceName(AICore_.CDS_NAME)
public class ConfigurationHandler extends AbstractCrudHandler {
private static final Logger logger = LoggerFactory.getLogger(ConfigurationHandler.class);
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/DeploymentHandler.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/DeploymentHandler.java
index 4657bc4..c16f166 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/DeploymentHandler.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/DeploymentHandler.java
@@ -9,10 +9,10 @@
import com.sap.ai.sdk.core.model.AiDeploymentModificationRequest;
import com.sap.ai.sdk.core.model.AiDeploymentResponseWithDetails;
import com.sap.ai.sdk.core.model.AiDeploymentTargetStatus;
-import com.sap.cds.feature.aicore.api.AICoreService;
import com.sap.cds.feature.aicore.core.AICoreClients;
import com.sap.cds.feature.aicore.core.AICoreConfig;
import com.sap.cds.feature.aicore.core.DeploymentResolver;
+import com.sap.cds.feature.aicore.generated.cds4j.aicore.AICore_;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.Deployments;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.Deployments_;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.ResourceGroups;
@@ -36,7 +36,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@ServiceName(AICoreService.DEFAULT_NAME)
+@ServiceName(AICore_.CDS_NAME)
public class DeploymentHandler extends AbstractCrudHandler {
private static final Logger logger = LoggerFactory.getLogger(DeploymentHandler.class);
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/MockAICoreApiHandler.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/MockAICoreApiHandler.java
index f5155a2..b8916c1 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/MockAICoreApiHandler.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/MockAICoreApiHandler.java
@@ -3,12 +3,12 @@
*/
package com.sap.cds.feature.aicore.core.handler;
-import com.sap.cds.feature.aicore.api.AICoreService;
import com.sap.cds.feature.aicore.api.DeploymentIdContext;
import com.sap.cds.feature.aicore.api.InferenceClientContext;
import com.sap.cds.feature.aicore.api.ModelDeploymentSpec;
import com.sap.cds.feature.aicore.api.ResourceGroupContext;
import com.sap.cds.feature.aicore.core.AICoreConfig;
+import com.sap.cds.feature.aicore.generated.cds4j.aicore.AICore_;
import com.sap.cds.services.ErrorStatuses;
import com.sap.cds.services.ServiceException;
import com.sap.cds.services.handler.EventHandler;
@@ -20,10 +20,10 @@
import org.slf4j.LoggerFactory;
/**
- * Mock ON handler for the {@link AICoreService} API events when no AI Core binding is available.
- * Uses in-memory maps instead of real API calls.
+ * Mock ON handler for the AI Core service API events when no AI Core binding is available. Uses
+ * in-memory maps instead of real API calls.
*/
-@ServiceName(AICoreService.DEFAULT_NAME)
+@ServiceName(AICore_.CDS_NAME)
public class MockAICoreApiHandler implements EventHandler {
private static final Logger logger = LoggerFactory.getLogger(MockAICoreApiHandler.class);
diff --git a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/MockEntityHandler.java b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/MockEntityHandler.java
index 2ac76ab..a8ea0c9 100644
--- a/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/MockEntityHandler.java
+++ b/cds-feature-ai-core/src/main/java/com/sap/cds/feature/aicore/core/handler/MockEntityHandler.java
@@ -4,7 +4,10 @@
package com.sap.cds.feature.aicore.core.handler;
import com.sap.cds.CdsData;
-import com.sap.cds.feature.aicore.api.AICoreService;
+import com.sap.cds.feature.aicore.generated.cds4j.aicore.AICore_;
+import com.sap.cds.feature.aicore.generated.cds4j.aicore.Configurations_;
+import com.sap.cds.feature.aicore.generated.cds4j.aicore.Deployments_;
+import com.sap.cds.feature.aicore.generated.cds4j.aicore.ResourceGroups_;
import com.sap.cds.ql.cqn.AnalysisResult;
import com.sap.cds.ql.cqn.CqnAnalyzer;
import com.sap.cds.ql.cqn.CqnDelete;
@@ -25,7 +28,7 @@
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
-@ServiceName(AICoreService.DEFAULT_NAME)
+@ServiceName(AICore_.CDS_NAME)
public class MockEntityHandler implements EventHandler {
private final Map> resourceGroups = new ConcurrentHashMap<>();
@@ -34,7 +37,7 @@ public class MockEntityHandler implements EventHandler {
// --- Resource Groups ---
- @On(entity = AICoreService.RESOURCE_GROUPS)
+ @On(entity = ResourceGroups_.CDS_NAME)
public void readResourceGroups(CdsReadEventContext context) {
CqnSelect select = context.getCqn();
CdsModel model = context.getModel();
@@ -61,7 +64,7 @@ public void readResourceGroups(CdsReadEventContext context) {
}
}
- @On(entity = AICoreService.RESOURCE_GROUPS)
+ @On(entity = ResourceGroups_.CDS_NAME)
public void createResourceGroups(CdsCreateEventContext context) {
CqnInsert insert = context.getCqn();
List