Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the JS SDK’s Model.selectVariant API to accept a ModelVariant object (aligning with the C# SDK approach) and updates usage sites accordingly.
Changes:
- Changed
Model.selectVariantto take aModelVariantand added basic runtime argument validation. - Updated JS integration/unit tests to pass the full
ModelVariantinstead ofvariant.id. - Updated the JS SDK README example to match the new
selectVariantsignature.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/js/src/model.ts | Updates selectVariant signature and adds runtime validation helper. |
| sdk/js/README.md | Updates documentation example to pass a ModelVariant object. |
| sdk/js/test/model.test.ts | Adjusts test to call selectVariant with a ModelVariant. |
| sdk/js/test/openai/chatClient.test.ts | Adjusts tests to call selectVariant with a ModelVariant. |
| sdk/js/test/openai/audioClient.test.ts | Adjusts tests to call selectVariant with a ModelVariant. |
| sdk/js/test/openai/responsesClient.test.ts | Adjusts test to call selectVariant with a ModelVariant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR aligns the JS SDK’s Model.selectVariant API with the C# SDK by switching it from selecting by variant ID (string) to selecting by a ModelVariant object, and updates tests + generated TypeDoc docs accordingly.
Changes:
- Update
Model.selectVariantto accept aModelVariantobject and select the matching internal variant byid. - Update JS tests and README example code to pass
ModelVariantobjects toselectVariant. - Regenerate/add JS API docs (TypeDoc) including Responses client documentation.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/js/src/model.ts | Changes selectVariant signature to accept ModelVariant and adds shared runtime input validation. |
| sdk/js/test/model.test.ts | Updates tests to call selectVariant(cachedVariant) instead of using cachedVariant.id. |
| sdk/js/test/openai/chatClient.test.ts | Updates tests to use the new selectVariant(ModelVariant) signature. |
| sdk/js/test/openai/audioClient.test.ts | Updates tests to use the new selectVariant(ModelVariant) signature. |
| sdk/js/test/openai/responsesClient.test.ts | Updates integration test setup to use the new selectVariant(ModelVariant) signature. |
| sdk/js/README.md | Updates public README example to match the new selectVariant input type. |
| sdk/js/docs/classes/Model.md | Updates generated docs for Model.selectVariant(variant) signature/description. |
| sdk/js/docs/classes/ModelVariant.md | Updates generated docs (including ResponsesClient creation API). |
| sdk/js/docs/classes/FoundryLocalManager.md | Updates generated docs (includes Responses client API documentation). |
| sdk/js/docs/classes/ChatClientSettings.md | Updates generated docs for settings fields. |
| sdk/js/docs/classes/ChatClient.md | Updates generated docs for overload/call signatures and parameter docs. |
| sdk/js/docs/classes/ResponsesClient.md | Adds generated docs for ResponsesClient. |
| sdk/js/docs/classes/ResponsesClientSettings.md | Adds generated docs for ResponsesClientSettings. |
| sdk/js/docs/README.md | Updates the generated docs index/types list to include Responses-related APIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Now it accepts a modelVariant object similar to c# SDK. Also updates docs.