Skip to content

Commit

Permalink
chore: Switch from internal to public cloud SDK API (#8)
Browse files Browse the repository at this point in the history
* chore:switch from internal to public cloud SDK API

* Changes from lint:fix

---------

Co-authored-by: bot-sdk-js <[email protected]>
Co-authored-by: cloud-sdk-js <[email protected]>
  • Loading branch information
3 people authored Jul 1, 2024
1 parent 49bbef3 commit d951405
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/core/context.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable import/no-internal-modules */
import { createLogger } from '@sap-cloud-sdk/util';
import { Destination, Service } from '@sap-cloud-sdk/connectivity';
import {
Destination,
Service,
getServiceBinding,
serviceToDestinationTransformers
} from '@sap-cloud-sdk/connectivity/internal.js';
transformServiceBindingToDestination
} from '@sap-cloud-sdk/connectivity';

const logger = createLogger({
package: 'gen-ai-hub',
Expand All @@ -28,11 +28,12 @@ export async function getAiCoreDestination(): Promise<Destination> {
}
}
// Uses the @internal SDK functionality to transform the service binding to a destination.
const aiCoreDestination = await serviceToDestinationTransformers[
aiCoreServiceBinding.label
](aiCoreServiceBinding, {
useCache: true
});
const aiCoreDestination = await transformServiceBindingToDestination(
aiCoreServiceBinding,
{
useCache: true
}
);
return aiCoreDestination;
}

Expand Down

0 comments on commit d951405

Please sign in to comment.