Skip to content

Commit

Permalink
Merge branch 'refactor-content-filters' into feat/descriptive-const-c…
Browse files Browse the repository at this point in the history
…ontent-filter
  • Loading branch information
KavithaSiva authored Jan 30, 2025
2 parents 067b0ae + 220f395 commit fc3bca5
Show file tree
Hide file tree
Showing 36 changed files with 1,744 additions and 1,319 deletions.
3 changes: 2 additions & 1 deletion .changeset/big-mayflies-begin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
'@sap-ai-sdk/orchestration': minor
---

Update orchestration to 2501a release.
[Compatibility Note] Update AI API to the 2501a release.
As part of this change, the `modelsGet` method of `ScenarioAPI` has been renamed to `scenarioQueryModels`.
5 changes: 5 additions & 0 deletions .changeset/help-sap-com.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sap-ai-sdk/orchestration': minor
---

[New Functionality] Support using `help.sap.com` as data repository type in the grounding module.
6 changes: 6 additions & 0 deletions .changeset/tender-numbers-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@sap-ai-sdk/langchain': minor
'@sap-ai-sdk/sample-code': minor
---

[Fixed Issue] Fixed the internal mapping of LangChain to Azure OpenAI and vice versa.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
default: 'https://registry.npmjs.org'
pnpm-version:
description: 'PNPM version'
default: '9'
default: '10'
pnpm-install-args:
description: 'Arguments to pass to pnpm install'
default: '--frozen-lockfile'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.2.0
uses: dependabot/fetch-metadata@v2.3.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Approve a PR
Expand Down
57 changes: 36 additions & 21 deletions .github/workflows/spec-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
outputs:
spec_diff: ${{ steps.spec_diff.outputs.spec_diff }}
branch: ${{ steps.push.outputs.branch }}
pr_url: ${{ steps.create-pr.outputs.pr_url }}
compilation_result: ${{ steps.compile.outputs.compilation_result }}
test_result: ${{ steps.compile.outputs.test_result }}
env:
Expand All @@ -41,9 +42,9 @@ jobs:
REF: ${{ github.event.inputs.file-ref }}
CREATE_PR: ${{ github.event.inputs.create-pr }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- uses: sap/ai-sdk-js/.github/actions/setup@main
with:
node-version: 20
token: ${{ secrets.GITHUB_TOKEN }}

- name: "Checkout or Create Branch"
Expand Down Expand Up @@ -81,23 +82,23 @@ jobs:
- name: "Exit if there are no changes"
id: spec_diff
# Before checking for changed files, run the linter as that also formats spec files
run: |
if [[ `git status --porcelain` ]]; then
pnpm lint:fix
if [[ -n "$(git status --porcelain)" ]]; then
echo "Changes detected in the specification file."
git status
echo "spec_diff=true" >> "$GITHUB_OUTPUT"
else
echo "No changes detected in the specification file, skipping rest of the job."
git status
echo "spec_diff=false" >> "$GITHUB_OUTPUT"
fi
- uses: sap/ai-sdk-js/.github/actions/setup@main
if: steps.spec_diff.outputs.spec_diff == 'true'
with:
node-version: 20

- name: "Generate"
id: generate
if: steps.spec_diff.outputs.spec_diff == 'true'
run: |
pnpm install
pnpm generate
- name: "Compile and Test"
Expand All @@ -124,11 +125,13 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "SAP Cloud SDK Bot"
git add .
git add --all
git status
git commit -m "Update $CHOICE based on $REF"
git push --set-upstream origin ${{ steps.branch.outputs.branch }}
- name: "Create PR"
id: create-pr
if: ${{ env.CREATE_PR == 'true' && steps.spec_diff.outputs.spec_diff == 'true'}}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -139,31 +142,43 @@ jobs:
exit 0
fi
gh pr create --base main --head $BRANCH --title "feat: [DevOps] Update $CHOICE Specification" --body "
PR_URL=$(gh pr create --base main --head $BRANCH --title "feat: Update $CHOICE specification" --body "
## Context
Update $CHOICE specification file based on $REF.
This PR was created automatically by the [spec-update workflow](https://github.com/SAP/ai-sdk-js/actions/workflows/spec-update.yaml).
You can commit on top of this branch, but as long as this PR is open the action can't be re-run.
- Compilation outcome: ${{ steps.compile.output.compilation_result }}
- Test run outcome: ${{ steps.compile.output.test_result }}
- Compilation outcome: ${{ steps.compile.outputs.compilation_result }}
- Test run outcome: ${{ steps.compile.outputs.test_result }}
Before merging, make sure to update tests and release notes, if necessary.
## Definition of Done
- [ ] Unit / type tests cover new classes
- [ ] Release notes updated
"
") && echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"
- name: "Print Summary"
- name: Generate Job Summary
if: ${{ always() }}
env:
BRANCH: ${{ steps.branch.outputs.branch }}
PR_URL: ${{ steps.create-pr.outputs.pr_url }}
run: |
echo "File download outcome: ${{ steps.download.outcome }}"
echo "Spec file contained changes: ${{ steps.spec_diff.outputs.spec_diff }}"
echo "Client generation outcome: ${{ steps.generate.outcome }}"
echo "Client compilation outcome: ${{ steps.compile.output.compilation_result }}"
echo "Client test outcome: ${{ steps.compile.output.test_result }}"
echo "Branch creation: ${{ steps.push.outcome }}"
DIFF_URL="https://github.com/SAP/ai-sdk-js/compare/main...$BRANCH"
echo "## Workflow Execution Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Step | Status |" >> $GITHUB_STEP_SUMMARY
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| File Download | ${{ steps.download.outcome == 'success' && '✅' || '❌' }} ${{ steps.download.outcome }}" >> $GITHUB_STEP_SUMMARY
echo "| Spec File Changes | ${{ steps.spec_diff.outputs.spec_diff == 'true' && '🔄 Changes Detected' || '⏹️ No Changes' }}" >> $GITHUB_STEP_SUMMARY
if ${{ steps.spec_diff.outputs.spec_diff == 'true' }}; then
echo "| Client Generation | ${{ steps.generate.outcome == 'success' && '✅' || '❌' }} ${{ steps.generate.outcome }}" >> $GITHUB_STEP_SUMMARY
echo "| Client Compilation | ${{ steps.compile.outputs.compilation_result == 'success' && '✅' || '❌' }} ${{ steps.compile.outputs.compilation_result }}" >> $GITHUB_STEP_SUMMARY
echo "| Client Testing | ${{ steps.compile.outputs.test_result == 'success' && '✅' || steps.compile.outputs.test_result == 'skipped' && '⏩' || '❌' }} ${{ steps.compile.outputs.test_result }}" >> $GITHUB_STEP_SUMMARY
echo "| Branch Creation | ${{ steps.push.outcome == 'success' && '✅ [Branch Link]($DIFF_URL)' || '❌ failure' }}" >> $GITHUB_STEP_SUMMARY
echo "| Pull Request Creation | ${{ env.CREATE_PR == 'false' && '⏩ skipped' || '' }}${{ env.CREATE_PR == 'true' && steps.push.outcome == 'success' && '✅ [PR Link]($PR_URL)' || '' }}" >> $GITHUB_STEP_SUMMARY
fi
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"check:deps": "pnpm -r -F !./tests/smoke-tests -F !./tests/schema-tests -F !./sample-cap exec depcheck --ignores=\"nock,@jest/globals\" --quiet"
},
"devDependencies": {
"@changesets/cli": "^2.27.11",
"@changesets/cli": "^2.27.12",
"@jest/globals": "^29.5.12",
"@sap-ai-sdk/ai-api": "workspace:^",
"@sap-ai-sdk/core": "workspace:^",
Expand All @@ -48,16 +48,16 @@
"@sap-cloud-sdk/openapi-generator": "^3.25.0",
"@sap-cloud-sdk/util": "^3.25.0",
"@types/jest": "^29.5.14",
"@types/jsonwebtoken": "^9.0.7",
"@types/jsonwebtoken": "^9.0.8",
"@types/mock-fs": "^4.13.4",
"@types/node": "^20.17.14",
"@types/node": "^20.17.16",
"depcheck": "^1.4.7",
"eslint": "^9.18.0",
"eslint": "^9.19.0",
"glob": "^11.0.1",
"jest": "^30.0.0-alpha.6",
"jsonwebtoken": "^9.0.2",
"mock-fs": "^5.4.1",
"nock": "^13.5.6",
"nock": "^14.0.0",
"prettier": "^3.4.2",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-api/src/client/AI_CORE_API/file-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const FileApi = {
*/
fileUpload: (
path: string,
body: string | undefined,
body: any | undefined,
queryParameters?: { overwrite?: boolean },
headerParameters?: { 'AI-Resource-Group'?: string }
) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-api/src/client/AI_CORE_API/scenario-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const ScenarioApi = {
* @param headerParameters - Object containing the following keys: AI-Resource-Group.
* @returns The request builder, use the `execute()` method to trigger the request.
*/
modelsGet: (
scenarioQueryModels: (
scenarioId: string,
headerParameters: { 'AI-Resource-Group': string }
) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,12 @@ export type AiModelBaseData = {
*/
description: string;
versions: AiModelVersionList;
/**
* Display name of the model
*/
displayName?: string;
/**
* Access type of the model
*/
accessType?: string;
} & Record<string, any>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/**
* Model version information including whether it is latest version
* Model version information including whether it is latest version, its deprecation status and optional retirement date
*/
export type AiModelVersion = {
/**
Expand All @@ -16,4 +16,24 @@ export type AiModelVersion = {
* Displays whether it is the latest version offered for the model
*/
isLatest: boolean;
/**
* Deprecation status of model
*/
deprecated: boolean;
/**
* Retirement date of model in ISO 8601 timestamp
*/
retirementDate?: string;
/**
* Context length of the model
*/
contextLength?: number;
/**
* List of input types supported by the model
*/
inputTypes?: string[];
/**
* List of capabilities supported by the model
*/
capabilities?: string[];
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Representation of the 'BckndGenericSecretLabel' schema.
*/
export type BckndGenericSecretLabel = {
/**
* @example "ext.ai.sap.com/my-label"
* Max Length: 63.
* Pattern: "^ext.ai.sap.com/(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]){1,48}$".
*/
key: string;
/**
* Max Length: 5000.
*/
value: string;
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { BckndGenericSecretLabel } from './bcknd-generic-secret-label.js';
/**
* Arbitrary labels as meta information
*/
export type BckndGenericSecretLabels = BckndGenericSecretLabel[];
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { BckndGenericSecretData } from './bcknd-generic-secret-data.js';
import type { BckndGenericSecretLabels } from './bcknd-generic-secret-labels.js';
/**
* Representation of the 'BckndGenericSecretPostBody' schema.
*/
Expand All @@ -16,4 +17,5 @@ export type BckndGenericSecretPostBody = {
*/
name: string;
data: BckndGenericSecretData;
labels?: BckndGenericSecretLabels;
} & Record<string, any>;
Loading

0 comments on commit fc3bca5

Please sign in to comment.