Skip to content

Commit

Permalink
chore: Remove Backend_details workaround (#268)
Browse files Browse the repository at this point in the history
* chore: Remove Backend_details workaround

* fix: Changes from lint

---------

Co-authored-by: cloud-sdk-js <[email protected]>
  • Loading branch information
MatKuhr and cloud-sdk-js authored Nov 6, 2024
1 parent 483ee0a commit 745465e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/ai-api/src/tests/deployment-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ describe('deployment', () => {
'https://ai.example.com/inference/deployments/0a1b2c3d',
details: {
resources: {
backend_details: {
backendDetails: {
model: {
name: 'gpt-4-32k',
version: 'latest'
}
}
},
scaling: {
backend_details: {}
backendDetails: {}
}
},
id: '0a1b2c3d',
Expand Down
7 changes: 1 addition & 6 deletions packages/ai-api/src/utils/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ function isFoundationModel(
export function extractModel(
deployment: AiDeployment
): FoundationModel | undefined {
// this workaround fixes an error in AI Core, where the API spec calls it "backendDetails" but the service returns "backend_details
// TODO: remove this workaround once fixed in AI Core (AIWDF-2124)
const model = (
deployment.details?.resources?.backendDetails ||
deployment.details?.resources?.backend_details
)?.model;
const model = deployment.details?.resources?.backendDetails?.model;
if (isFoundationModel(model)) {
return model;
}
Expand Down

0 comments on commit 745465e

Please sign in to comment.