Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds explicit execution-provider (EP) discovery/download/registration APIs across SDKs (C#, Rust, Python, JS) and updates catalogs/examples/docs to avoid implicitly blocking catalog access on EP downloads.
Changes:
- Introduces
discover_epsanddownload_and_register_epsAPIs (plus new EP result/info types) in multiple SDKs. - Removes client-side catalog refresh TTL/invalidator logic so catalog refresh behavior relies on the core’s caching.
- Updates docs and samples to use explicit EP registration (and removes some legacy/implicit EP behavior).
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| www/src/routes/models/service.ts | Removes DirectML EP from the UI/service EP list. |
| sdk/rust/src/types.rs | Adds EpInfo and EpDownloadResult Rust types (serde PascalCase). |
| sdk/rust/src/model_variant.rs | Removes catalog cache invalidation hooks from model variant operations. |
| sdk/rust/src/lib.rs | Re-exports new EP types from the Rust crate. |
| sdk/rust/src/foundry_local_manager.rs | Adds discover_eps and download_and_register_eps APIs to the Rust manager. |
| sdk/rust/src/catalog.rs | Removes TTL/invalidation-based caching; always refreshes via core. |
| sdk/rust/README.md | Documents explicit EP management for Rust SDK. |
| sdk/python/test/test_foundry_local_manager.py | Adds tests for EP discovery/download APIs and deprecated wrapper behavior. |
| sdk/python/src/foundry_local_manager.py | Adds EP APIs and deprecates ensure_eps_downloaded() in favor of explicit registration. |
| sdk/python/src/ep_types.py | Adds Python EpInfo / EpDownloadResult dataclasses + parsers. |
| sdk/python/src/catalog.py | Removes 6-hour TTL refresh guard for catalog updates. |
| sdk/python/src/init.py | Exports EP types from Python package surface. |
| sdk/python/examples/chat_completion.py | Demonstrates EP discovery and explicit registration in example. |
| sdk/python/README.md | Updates backend table + adds explicit EP management docs and API list entries. |
| sdk/js/src/types.ts | Adds JS EP type interfaces. |
| sdk/js/src/foundryLocalManager.ts | Adds discoverEps() and downloadAndRegisterEps() methods to JS manager. |
| sdk/js/src/catalog.ts | Removes 6-hour TTL refresh guard for catalog updates. |
| sdk/js/examples/chat-completion.ts | Refactors example toward audio transcription flow (but currently inconsistent/buggy). |
| sdk/js/README.md | Adds explicit EP management docs for JS. |
| sdk/cs/src/FoundryLocalManager.cs | Adds DiscoverEps() + DownloadAndRegisterEpsAsync() and updates catalog remarks. |
| sdk/cs/src/EpInfo.cs | Adds .NET EP DTOs (EpInfo, EpDownloadResult). |
| sdk/cs/src/Detail/JsonSerializationContext.cs | Registers EP DTOs for source-generated JSON serialization. |
| sdk/cs/src/Catalog.cs | Removes 6-hour TTL refresh guard for catalog updates. |
| sdk/cs/docs/api/microsoft.ai.foundry.local.foundrylocalmanager.md | Updates .NET API docs to reflect explicit EP flow. |
| sdk/cs/README.md | Updates guidance to use explicit EP management APIs. |
| samples/cs/GettingStarted/src/ToolCallingFoundryLocalWebServer/Program.cs | Updates sample to call DownloadAndRegisterEpsAsync(). |
| samples/cs/GettingStarted/src/ToolCallingFoundryLocalSdk/Program.cs | Updates sample to call DownloadAndRegisterEpsAsync(). |
| samples/cs/GettingStarted/src/ModelManagementExample/Program.cs | Updates sample to call DownloadAndRegisterEpsAsync(). |
| samples/cs/GettingStarted/src/HelloFoundryLocalSdk/Program.cs | Adds EP discovery output + switches to DownloadAndRegisterEpsAsync(). |
| samples/cs/GettingStarted/src/FoundryLocalWebServer/Program.cs | Updates sample to call DownloadAndRegisterEpsAsync(). |
| samples/cs/GettingStarted/src/AudioTranscriptionExample/Program.cs | Updates sample EP call + sets audio transcription language. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| /** | ||
| * Discovers available execution providers (EPs) and their registration status. | ||
| * @returns An array of EpInfo describing each available EP. |
There was a problem hiding this comment.
The JSDoc block for discoverEps() has inconsistent indentation on the @returns line, which can lead to messy generated docs and makes the comment harder to read. Align the * indentation with the surrounding JSDoc lines.
| * @returns An array of EpInfo describing each available EP. | |
| * @returns An array of EpInfo describing each available EP. |
| return JsonSerializer.Deserialize(result.Data!, JsonSerializationContext.Default.EpInfoArray) | ||
| ?? Array.Empty<EpInfo>(); |
There was a problem hiding this comment.
DiscoverEps() can throw a raw JsonException if the core returns invalid JSON (or unexpected shape). Other public manager APIs wrap unexpected exceptions via Utils.CallWithExceptionHandling, but this method currently returns JsonSerializer.Deserialize(...) directly. Consider catching JsonException (and/or validating result.Data is non-null) and rethrowing a FoundryLocalException with context so callers get consistent error semantics.
| return JsonSerializer.Deserialize(result.Data!, JsonSerializationContext.Default.EpInfoArray) | |
| ?? Array.Empty<EpInfo>(); | |
| if (string.IsNullOrWhiteSpace(result.Data)) | |
| { | |
| throw new FoundryLocalException( | |
| "Error discovering execution providers: core returned no data.", | |
| _logger); | |
| } | |
| try | |
| { | |
| return JsonSerializer.Deserialize(result.Data, JsonSerializationContext.Default.EpInfoArray) | |
| ?? Array.Empty<EpInfo>(); | |
| } | |
| catch (JsonException ex) | |
| { | |
| throw new FoundryLocalException( | |
| "Error discovering execution providers: invalid JSON payload from core.", | |
| ex, | |
| _logger); | |
| } |
No description provided.