Skip to content

adjust selectVariant input type#535

Merged
prathikr merged 4 commits intomainfrom
prathikrao/select-variant-input-type-2
Mar 18, 2026
Merged

adjust selectVariant input type#535
prathikr merged 4 commits intomainfrom
prathikrao/select-variant-input-type-2

Conversation

@prathikr
Copy link
Contributor

Now it accepts a modelVariant object similar to c# SDK. Also updates docs.

Copilot AI review requested due to automatic review settings March 18, 2026 20:18
@vercel
Copy link

vercel bot commented Mar 18, 2026

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

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Mar 18, 2026 9:13pm

Request Review

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

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.selectVariant to take a ModelVariant and added basic runtime argument validation.
  • Updated JS integration/unit tests to pass the full ModelVariant instead of variant.id.
  • Updated the JS SDK README example to match the new selectVariant signature.

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>
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

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.selectVariant to accept a ModelVariant object and select the matching internal variant by id.
  • Update JS tests and README example code to pass ModelVariant objects to selectVariant.
  • 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.

@prathikr prathikr merged commit c7f06ed into main Mar 18, 2026
22 of 27 checks passed
@prathikr prathikr deleted the prathikrao/select-variant-input-type-2 branch March 18, 2026 23:18
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.

3 participants