Skip to content

Commit

Permalink
Merge branch 'main' into feat/model-constants
Browse files Browse the repository at this point in the history
  • Loading branch information
deekshas8 committed Aug 6, 2024
2 parents 37d4bd5 + fd4e8d2 commit 63e7139
Show file tree
Hide file tree
Showing 27 changed files with 1,159 additions and 328 deletions.
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [["@sap-ai-sdk/*"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
27 changes: 27 additions & 0 deletions .github/workflows/delete-dist-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: delete-dist-tag

on:
workflow_dispatch:
inputs:
tag:
description: 'Dist tag to delete.'
type: string
required: true

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: delete dist tag
run: |
npm dist-tag rm @sap-ai-sdk/gen-ai-hub ${{ inputs.tag }}
npm dist-tag rm @sap-ai-sdk/ai-core ${{ inputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }}
24 changes: 7 additions & 17 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: "E2E Test"
on:
push:
branches:
- chore/e2e-test
workflow_dispatch:
schedule:
- cron: 0 22 * * *
Expand All @@ -20,9 +17,6 @@ jobs:
secret-name: AI_CORE_PRODUCTION
name: "Build and Test"
runs-on: ubuntu-latest
env:
WGET_ARGS: "-qO- -S --content-on-error"
WGET_URL: "localhost:8080"
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
Expand All @@ -37,12 +31,12 @@ jobs:
- name: Create .env file
env:
aicore: ${{ secrets[matrix.secret-name] }}
working-directory: ./sample-code
run: |
echo "aicore='$aicore'" > .env
echo "aicore='$aicore'" > sample-code/.env
echo "aicore='$aicore'" > tests/e2e-tests/.env
url=$(echo "$aicore" | jq -r '.serviceurls.AI_API_URL' | sed 's|^https://||')
echo "Using AI Core ${{ matrix.environment }} instance on $url"
- name: "Start App"
- name: "Check Sample App Starts Up"
working-directory: ./sample-code
run: |
pnpm run local &
Expand All @@ -55,15 +49,11 @@ jobs:
exit 1
fi
done
- name: "Health Check"
run: |
wget "$WGET_ARGS" "$WGET_URL/health"
- name: "OpenAI Chat Completion"
run: |
wget "$WGET_ARGS" "$WGET_URL/llm"
- name: "OpenAI Text Embedding"
wget -qO- -S --content-on-error localhost:8080
- name: "Execute E2E Tests"
working-directory: ./tests/e2e-tests
run: |
wget "$WGET_ARGS" "$WGET_URL/embedding"
pnpm run e2e-test
- name: "Slack Notification"
if: failure()
uses: slackapi/[email protected]
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: publish-canary

on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
inputs:
tag:
description: 'Dist tag for the release. If you chose something different than "canary", make sure to delete it once it is not needed anymore.'
type: string
required: false
default: 'canary'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: ${{ vars.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: install and build
run: pnpm install

- name: prepare canary changeset
run: |
rm -f .changeset/*.md || true
cat <<EOT >> .changeset/canary-release-changeset.md
---
'@sap-ai-sdk/ai-core': patch
'@sap-ai-sdk/gen-ai-hub': patch
---
Canary release
EOT
- name: publish
run: |
date=`date +%Y%m%d%H%M%S`
pnpm changeset pre enter ${date}
pnpm changeset version
pnpm changeset pre exit
pnpm changeset publish --tag ${{ inputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ build/Release
.env.local

# VS Code
.vscode
.vscode
/pnpm-publish-summary.json
10 changes: 6 additions & 4 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ const config = {
testMatch: ['**/*.test.ts'],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
// "/node_modules/"
// ],
testPathIgnorePatterns: [
"./dist"
],

// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],
Expand All @@ -166,6 +166,8 @@ const config = {
// This option allows use of a custom test runner
// testRunner: "jest-circus/runner",

// extensionsToTreatAsEsm: ['.ts'],

// A map from regular expressions to paths to transformers
transform: {
'^.+\\.tsx?$': [
Expand All @@ -186,7 +188,7 @@ const config = {
// unmockedModulePathPatterns: undefined,

// Indicates whether each individual test should be reported during the run
// verbose: undefined,
// verbose: true,

// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
// watchPathIgnorePatterns: [],
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "sap-ai-sdk",
"version": "0.0.1",
"version": "0.0.0",
"description": "",
"keywords": [],
"license": "Apache-2.0",
"repository": "github:SAP/ai-sdk-js",
"private": true,
"type": "module",
"types": "type-tests",
"types": "tests/type-tests",
"tsd": {
"directory": "type-tests"
"directory": "tests/type-tests"
},
"scripts": {
"postinstall": "pnpm compile",
Expand All @@ -20,6 +20,7 @@
"lint:fix": "pnpm -r run lint:fix"
},
"devDependencies": {
"@changesets/cli": "^2.27.7",
"@sap-cloud-sdk/eslint-config": "^3.17.0",
"@sap-cloud-sdk/connectivity": "^3.17.0",
"@sap-cloud-sdk/http-client": "^3.17.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/ai-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ai-sdk/ai-core",
"version": "0.0.1",
"version": "0.0.0",
"description": "",
"license": "Apache-2.0",
"keywords": [
Expand All @@ -23,7 +23,6 @@
"lint:fix": "eslint . --fix && prettier . --config ../../.prettierrc --ignore-path ../../.prettierignore -w --log-level error"
},
"dependencies": {
"@sap-cloud-sdk/connectivity": "^3.17.0",
"@sap-cloud-sdk/openapi": "^3.17.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/gen-ai-hub/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ai-sdk/gen-ai-hub",
"version": "0.0.1",
"version": "0.0.0",
"description": "",
"license": "Apache-2.0",
"keywords": [
Expand Down
1 change: 1 addition & 0 deletions packages/gen-ai-hub/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export {
LlmConfig,
ChatMessages
} from './orchestration/index.js';
export { getAiCoreDestination } from './core/index.js';
Loading

0 comments on commit 63e7139

Please sign in to comment.