Update Model Types from SAP Notes
Syncs packages/core/src/model-types.ts and the deprecated models table in the SAP/ai-sdk docs with the current model table on SAP Notes (me.sap.com/notes/3437766).
Steps
Navigate to the SAP Notes page using the Playwright MCP tool:
- Use
browser_navigateto go tohttps://me.sap.com/notes/3437766 - Use
browser_wait_forto wait forAvailability of Generative AI Models - If the page shows a login screen, tell the user to log in to me.sap.com in the Playwright browser window and wait for their confirmation, then retry.
- Use
Extract the model tables (then close the browser tab when done):
- Read
scripts/extract-model-table.jsand pass its contents as the function body tobrowser_evaluate. - The script returns either
{ active: [...], retired: [...], batch: [...] }(success) or{ error: '...' }(failure). - If the result is an error or
result.activeis empty, the session has expired — tell the user to log in to me.sap.com in the Playwright browser window and wait for their confirmation, then retry. - On success, sync models into
scripts/sap-models.json:- Remove duplicate scraped rows, keeping the latest version first: both tables include a
Versioncolumn. Whenresult.activeorresult.retiredcontains multiple rows for the samemodelname, compare theirversionstrings and keep only the row with the latest version (use your judgment — versions may be date-like2024-11-20, semantic1.2, or arbitrary strings; pick the one a human would call newest). Discard the older-versioned rows entirely. - Status is determined by the latest version only: if the latest-versioned row of a model is active (not deprecated/retired), treat the model as active even if older-versioned rows are marked deprecated or retired. Conversely, only treat a model as deprecated/retired when its latest version carries that status.
- For each de-duplicated model in
result.active: update the existing entry matched bymodelfield (update all fields includingversion), or append it if not already present. Clear theretiredfield (set to"") if it was previously set. - For each de-duplicated model in
result.retired: if already present insap-models.json, setretired: "yes"and updatesuggestedReplacementandversionfromresult.retired. If not present at all, append a new entry withretired: "yes"and the fields fromresult.retired(setavailableInOrchestration: "",deprecated: "",retirementDate: ""). - Do not remove any entries from
sap-models.json— retired models stay in the file withretired: "yes". - If both
result.activeandresult.retiredlist a model (after per-table de-duplication), treat it as retired. - After merging, verify no duplicate
modelvalues exist insap-models.json. If any remain, remove the older/less-complete entry and report the duplicate removal to the user.
- Remove duplicate scraped rows, keeping the latest version first: both tables include a
- Sync batch models into the
batchModelskey ofscripts/sap-models.json:result.batchis a string array of model names from the SAP Notes "Batch Consumption Supported Models" section.- The SAP Notes batch list is authoritatively incomplete — the LLM batch service supports models not listed there.
The
batchModelskey insap-models.jsonis the ground truth and must never be shrunk by a scrape. - Merge non-destructively: take the union of the existing
batchModelsarray andresult.batch, de-duplicated and sorted ascending. Add any scraped model not already in the array. - Never auto-remove a model that is in
batchModelsbut absent fromresult.batch— it is likely a service-only model the SAP Notes omit. Instead, list those models to the user and let them decide whether to remove any. Only remove on explicit user confirmation. - If
result.batchis empty (section not found), keepbatchModelsunchanged and warn the user.
- Close the browser tab using
browser_closeto avoid stale session issues on future runs.
- Read
Patch model-types.ts by running the sync script:
pnpm tsx scripts/sync-model-types.tsIf the output ends with a
⚠ Skipped N model(s)warning, show the user the listed model names and theirexecutableIdvalues and ask whether they want to add a mapping. If yes, add the appropriate entry toEXECUTABLE_ID_TO_TYPEinscripts/sync-model-types.tsand re-run the script before proceeding. The script also checks which synced models are available in your landscape using the foundation-models API.Sync the deprecated models table in
docs-js/overview.mdx(SAP/ai-sdk repository):a. Clone the SAP/ai-sdk repository into a temp directory:
DOCS_DIR=$(mktemp -d) git clone --depth=1 https://github.com/SAP/ai-sdk "$DOCS_DIR"b. Using the Edit tool, make the following targeted changes to
$DOCS_DIR/docs-js/overview.mdx:- Remove rows where the model has
retired: "yes"insap-models.json— note removed models to the user. Only list models that are still active (not retired) but deprecated (deprecated: "yes"or retirement date set insap-models.json). Fully retired models must be removed from the table. - Update the replacement cell of any existing row whose replacement differs from the script output.
If the replacement is not listed in
sap-models.jsonadd it as<!-- MODEL_NAME -->in the cell so the user can decide how to handle it. - Append rows for newly deprecated models (not yet in the table) to the bottom, one per line. Preserve existing row order — new entries go at the end.
c. Use the Edit tool to replace the entire markdown table (header row through last data row) in
$DOCS_DIR/docs-js/overview.mdx. Write rows without padding —lint:fixwill normalize column widths.d. Run install, lint fix, and build to verify:
cd "$DOCS_DIR" && npm ci && npm run lint:fix && npm run buildIf any step fails, show the error to the user and stop.
e. Show the diff:
git -C "$DOCS_DIR" diff docs-js/overview.mdx- Remove rows where the model has
Check for deprecated model usage in the ai-sdk-js codebase:
- From
scripts/sap-models.json, collect names of all models whereretiredis"yes",deprecatedis"yes", or a retirement date is set. - Grep the repository for any of those model names (exclude
scripts/sap-models.jsonitself,packages/core/src/model-types.ts, OpenAPI specs and generated files likepackages/*/src/client/**/*.ts). - If matches are found, report them to the user so they can decide whether to update or remove those usages.
- From
Show the ai-sdk-js diff to the user:
git diff packages/core/src/model-types.tsIf neither file changed, tell the user everything is already up to date and stop.
Ask the user if they want to open PRs with these changes.
If yes, create branches and open PRs — one per repository:
ai-sdk-js (model types):
git checkout -b model-types-update/$(date +%Y-%m-%d) git add scripts/sap-models.json packages/core/src/model-types.ts git commit -m "chore: sync model types from SAP Notes 3437766" gh pr create --draft --base main --title "chore: Sync model types from SAP Notes" --body "Automated sync of model types from [SAP Notes 3437766](https://me.sap.com/notes/3437766).\n\n## Changes\n\nUpdated LiteralUnion type blocks in \`packages/core/src/model-types.ts\` to reflect current model availability.\n\n## Definition of Done\n- [ ] Model names are correct\n- [ ] Compilation passes\n- [ ] Release notes / Changeset updated if needed"SAP/ai-sdk (docs), if
docs-js/overview.mdxchanged:BRANCH="docs/update-deprecated-models-js-$(date +%Y-%m-%d)" git -C "$DOCS_DIR" checkout -b "$BRANCH" git -C "$DOCS_DIR" add docs-js/overview.mdx git -C "$DOCS_DIR" commit -m "docs: update deprecated models table" git -C "$DOCS_DIR" push origin "$BRANCH" gh pr create --draft --repo SAP/ai-sdk --base main --head "$BRANCH" \ --title "docs: Update deprecated models table" \ --body "Sync of the deprecated models table in \`docs-js/overview.mdx\` from [SAP Notes 3437766](https://me.sap.com/notes/3437766).\n\n## Changes\n\n- Added newly deprecated models\n- Removed retired models (no longer listed in SAP Notes)\n- Updated replacement suggestions\n\n## Definition of Done\n- [ ] Table entries are correct\n- [ ] Retired models removed\n- [ ] Replacement suggestions accurate"
Prerequisites
playwright@claude-plugins-officialmust be enabled as a Claude Code plugin — install it via/pluginin Claude CodeghCLI must be authenticated: rungh auth loginif not already done- First run: me.sap.com credentials required for manual login in the Playwright browser window (the session is saved automatically for future runs)