From a44a89b704083505730855751b1728ef0aae9294 Mon Sep 17 00:00:00 2001 From: CrowleyRajapakse Date: Fri, 18 Oct 2024 14:26:06 +0530 Subject: [PATCH] fixing ai configuration in dp to cp flow --- adapter/internal/controlplane/eventPublisher.go | 1 + adapter/internal/operator/controllers/dp/api_controller.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/adapter/internal/controlplane/eventPublisher.go b/adapter/internal/controlplane/eventPublisher.go index 9aa28a3a6..edef827a6 100644 --- a/adapter/internal/controlplane/eventPublisher.go +++ b/adapter/internal/controlplane/eventPublisher.go @@ -116,6 +116,7 @@ type AIRL struct { // AIConfiguration holds the AI configuration type AIConfiguration struct { + LLMProviderID string `json:"llmProviderID"` LLMProviderName string `json:"llmProviderName"` LLMProviderAPIVersion string `json:"llmProviderAPIVersion"` } diff --git a/adapter/internal/operator/controllers/dp/api_controller.go b/adapter/internal/operator/controllers/dp/api_controller.go index 456f9f964..7810b4c3a 100644 --- a/adapter/internal/operator/controllers/dp/api_controller.go +++ b/adapter/internal/operator/controllers/dp/api_controller.go @@ -2970,10 +2970,12 @@ func (apiReconciler *APIReconciler) convertAPIStateToAPICp(ctx context.Context, } subType := "DEFAULT" aiConfiguration := controlplane.AIConfiguration{} + loggers.LoggerAPKOperator.Debugf("AI Provider in state: %+v", apiState.AIProvider) if apiState.AIProvider != nil { loggers.LoggerAPKOperator.Debugf("AIProvider is found") subType = "AIAPI" aiConfiguration = controlplane.AIConfiguration{ + LLMProviderID: apiState.AIProvider.ObjectMeta.Name, LLMProviderName: apiState.AIProvider.Spec.ProviderName, LLMProviderAPIVersion: apiState.AIProvider.Spec.ProviderAPIVersion, }