Skip to content

Comments

[sdk_v2] updates js documentation#453

Open
prathikr wants to merge 2 commits intomainfrom
prathikrao/update-js-docs
Open

[sdk_v2] updates js documentation#453
prathikr wants to merge 2 commits intomainfrom
prathikrao/update-js-docs

Conversation

@prathikr
Copy link
Contributor

JS SDK Documentation Updates

What Changed

README.md — Rewritten

Replaced the minimal quick start with a comprehensive, feature-focused guide:

  • Features list at the top highlighting all SDK capabilities
  • WinML section — prominent callout for --winml install flag and automatic EP management
  • Usage sections for catalog browsing, model loading, chat completions, streaming, audio transcription, embedded web service, and configuration
  • Fixed package name and removed stale docs/index.html references

typedoc.json — Added

New config controlling API doc generation: hides @internal exports, removes source links, renders params as tables, expands object types inline, and only generates per-class pages.

package.json — Updated docs script

Now reads from typedoc.json and strips the auto-generated index page (interfaces/enums already covered in README).


Result

README.md              ← Hand-written guide (edit directly)
docs/classes/*.md      ← Auto-generated per class (edit TSDoc in source, then npm run docs)

@vercel
Copy link

vercel bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Feb 23, 2026 8:43pm

Request Review

@prathikr prathikr changed the title [sdk_v2] updates documentation [sdk_v2] updates js documentation Feb 23, 2026
@prathikr prathikr requested a review from Copilot February 24, 2026 19:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the JS SDK’s documentation and API doc generation setup to provide a richer hand-written README and a slimmer, class-focused auto-generated Markdown reference.

Changes:

  • Rewrites sdk_v2/js/README.md into a feature-focused guide with usage examples and links into generated class docs.
  • Adds sdk_v2/js/typedoc.json and updates sdk_v2/js/package.json to generate docs via TypeDoc + typedoc-plugin-markdown.
  • Removes previously generated TypeDoc pages for interfaces/enums/globals and refreshes the generated class Markdown under sdk_v2/js/docs/classes/.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
sdk_v2/js/typedoc.json Adds TypeDoc config for Markdown output and class-per-page generation.
sdk_v2/js/package.json Simplifies docs script to run TypeDoc using config defaults.
sdk_v2/js/docs/interfaces/Runtime.md Removes old generated interface page.
sdk_v2/js/docs/interfaces/PromptTemplate.md Removes old generated interface page.
sdk_v2/js/docs/interfaces/Parameter.md Removes old generated interface page.
sdk_v2/js/docs/interfaces/ModelSettings.md Removes old generated interface page.
sdk_v2/js/docs/interfaces/ModelInfo.md Removes old generated interface page.
sdk_v2/js/docs/interfaces/IModel.md Removes old generated interface page.
sdk_v2/js/docs/interfaces/FoundryLocalConfig.md Removes old generated interface page.
sdk_v2/js/docs/globals.md Removes old generated globals index page.
sdk_v2/js/docs/enumerations/DeviceType.md Removes old generated enum page.
sdk_v2/js/docs/classes/ModelVariant.md Refreshes generated class docs formatting/links for ModelVariant.
sdk_v2/js/docs/classes/ModelLoadManager.md Refreshes generated class docs formatting/links for ModelLoadManager.
sdk_v2/js/docs/classes/Model.md Refreshes generated class docs formatting/links for Model.
sdk_v2/js/docs/classes/FoundryLocalManager.md Refreshes generated class docs formatting/links for FoundryLocalManager.
sdk_v2/js/docs/classes/CoreInterop.md Removes old generated internal class page.
sdk_v2/js/docs/classes/Configuration.md Removes old generated internal class page.
sdk_v2/js/docs/classes/ChatClientSettings.md Refreshes generated class docs formatting; hides internal members.
sdk_v2/js/docs/classes/ChatClient.md Refreshes generated class docs formatting; hides internal ctor.
sdk_v2/js/docs/classes/Catalog.md Refreshes generated class docs formatting/links for Catalog.
sdk_v2/js/docs/classes/AudioClientSettings.md Refreshes generated class docs formatting; hides internal members.
sdk_v2/js/docs/classes/AudioClient.md Refreshes generated class docs formatting; hides internal ctor.
sdk_v2/js/docs/README.md Removes old generated docs index/README page.
sdk_v2/js/README.md Replaces minimal quick start with a comprehensive guide and API reference links.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +94 to +103
// Download if not cached (with optional progress tracking)
if (!model.isCached) {
model.download((progress) => {
console.log(`Download: ${progress}%`);
});
}

// Load into memory and run inference
await model.load();
const chatClient = model.createChatClient();
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example uses model.download(progressCallback) and then immediately calls await model.load(). In the current implementation, Model.download() is void and does not await the underlying async ModelVariant.download() when a progress callback is provided, so load() can run before the download completes. Consider changing the example to await a specific ModelVariant.download(...) (which returns a Promise) or remove the progress callback here to keep the download path synchronous.

Copilot uses AI. Check for mistakes.
"entryPoints": ["src/index.ts"],
"out": "docs",
"plugin": ["typedoc-plugin-markdown"],
"readme": "none",
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readme: "none" removes the generated docs/README.md, but the committed Markdown output under docs/classes/* still links to ../README.md and uses ../README.md#... anchors for types. Either adjust the TypeDoc markdown configuration so generated pages don't reference ../README.md, or generate/commit a docs/README.md entry document so these links resolve.

Suggested change
"readme": "none",
"readme": "README.md",

Copilot uses AI. Check for mistakes.
***

[@prathikrao/foundry-local-sdk](../globals.md) / AudioClient
[@prathikrao/foundry-local-sdk](../README.md) / AudioClient
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page links to ../README.md, but sdk_v2/js/docs/README.md is deleted in this PR, so the breadcrumb and any ../README.md#... type links will be broken on GitHub. Either keep a docs/README.md entry page (even a stub that redirects to ../../README.md) or adjust the TypeDoc markdown output/settings so these links point at an existing document.

Suggested change
[@prathikrao/foundry-local-sdk](../README.md) / AudioClient
[@prathikrao/foundry-local-sdk](../../README.md) / AudioClient

Copilot uses AI. Check for mistakes.
***

[@prathikrao/foundry-local-sdk](../globals.md) / Catalog
[@prathikrao/foundry-local-sdk](../README.md) / Catalog
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page links to ../README.md, but sdk_v2/js/docs/README.md is deleted in this PR, so the breadcrumb and any ../README.md#... type links will be broken. Either keep a docs/README.md entry page (even a stub that redirects to ../../README.md) or adjust the TypeDoc markdown output/settings so these links point at an existing document.

Suggested change
[@prathikrao/foundry-local-sdk](../README.md) / Catalog
[@prathikrao/foundry-local-sdk](../../README.md) / Catalog

Copilot uses AI. Check for mistakes.
Comment on lines +1 to 2
[@prathikrao/foundry-local-sdk](../README.md) / FoundryLocalManager

Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page links to ../README.md, but sdk_v2/js/docs/README.md is deleted in this PR, so the breadcrumb and any ../README.md#... type links will be broken. Either keep a docs/README.md entry page (even a stub that redirects to ../../README.md) or adjust the TypeDoc markdown output/settings so these links point at an existing document.

Copilot uses AI. Check for mistakes.
***

[@prathikrao/foundry-local-sdk](../globals.md) / ModelLoadManager
[@prathikrao/foundry-local-sdk](../README.md) / ModelLoadManager
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page links to ../README.md, but sdk_v2/js/docs/README.md is deleted in this PR, so the breadcrumb and any ../README.md#... type links will be broken. Either keep a docs/README.md entry page (even a stub that redirects to ../../README.md) or adjust the TypeDoc markdown output/settings so these links point at an existing document.

Suggested change
[@prathikrao/foundry-local-sdk](../README.md) / ModelLoadManager
[@prathikrao/foundry-local-sdk](../../README.md) / ModelLoadManager

Copilot uses AI. Check for mistakes.
***

[@prathikrao/foundry-local-sdk](../globals.md) / AudioClientSettings
[@prathikrao/foundry-local-sdk](../README.md) / AudioClientSettings
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page links to ../README.md, but sdk_v2/js/docs/README.md is deleted in this PR, so the breadcrumb and any ../README.md#... type links will be broken. Either keep a docs/README.md entry page (even a stub that redirects to ../../README.md) or adjust the TypeDoc markdown output/settings so these links point at an existing document.

Suggested change
[@prathikrao/foundry-local-sdk](../README.md) / AudioClientSettings
[@prathikrao/foundry-local-sdk](../../README.md) / AudioClientSettings

Copilot uses AI. Check for mistakes.
***

[@prathikrao/foundry-local-sdk](../globals.md) / ChatClientSettings
[@prathikrao/foundry-local-sdk](../README.md) / ChatClientSettings
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page links to ../README.md, but sdk_v2/js/docs/README.md is deleted in this PR, so the breadcrumb and any ../README.md#... type links will be broken. Either keep a docs/README.md entry page (even a stub that redirects to ../../README.md) or adjust the TypeDoc markdown output/settings so these links point at an existing document.

Suggested change
[@prathikrao/foundry-local-sdk](../README.md) / ChatClientSettings
[@prathikrao/foundry-local-sdk](../../README.md) / ChatClientSettings

Copilot uses AI. Check for mistakes.
***

[@prathikrao/foundry-local-sdk](../globals.md) / ChatClient
[@prathikrao/foundry-local-sdk](../README.md) / ChatClient
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page links to ../README.md, but sdk_v2/js/docs/README.md is deleted in this PR, so the breadcrumb and any ../README.md#... type links will be broken. Either keep a docs/README.md entry page (even a stub that redirects to ../../README.md) or adjust the TypeDoc markdown output/settings so these links point at an existing document.

Suggested change
[@prathikrao/foundry-local-sdk](../README.md) / ChatClient
[@prathikrao/foundry-local-sdk](../../README.md) / ChatClient

Copilot uses AI. Check for mistakes.
Comment on lines 201 to 204
#### Throws

Error - If progress callback is provided (not implemented).

Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The download() docs say the progress callback is "not implemented", but the implementation in src/modelVariant.ts does stream chunks and invokes the callback. This is misleading for users; please update the TSDoc for ModelVariant.download and regenerate these docs so the Throws section reflects actual behavior.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant