Skip to content

[sdk_v2] adjust selectVariant input type#529

Closed
prathikr wants to merge 10 commits intomainfrom
prathikrao/select-variant-input-type
Closed

[sdk_v2] adjust selectVariant input type#529
prathikr wants to merge 10 commits intomainfrom
prathikrao/select-variant-input-type

Conversation

@prathikr
Copy link
Contributor

@prathikr prathikr commented Mar 18, 2026

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

@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 6:56am

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 Model.selectVariant API to take a ModelVariant object (aligning with the C# SDK style), and updates one model integration test to use the new call signature.

Changes:

  • Changed Model.selectVariant to accept a ModelVariant instead of a variant ID string.
  • Updated sdk_v2/js/test/model.test.ts to pass a ModelVariant object to selectVariant.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
sdk_v2/js/src/model.ts Updates selectVariant signature + docstring to accept ModelVariant.
sdk_v2/js/test/model.test.ts Updates test to call selectVariant with a ModelVariant object.

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

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 Model.selectVariant API to accept a ModelVariant object (matching the C# SDK style), and adjusts tests to use the new call pattern.

Changes:

  • Changed Model.selectVariant to take a ModelVariant instead of a variant id string.
  • Updated JS integration/unit tests to pass cachedVariant objects into selectVariant.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk_v2/js/src/model.ts Changes selectVariant signature and selection logic to accept ModelVariant.
sdk_v2/js/test/model.test.ts Updates model selection in tests to pass ModelVariant.
sdk_v2/js/test/openai/chatClient.test.ts Updates model selection in chat client tests.
sdk_v2/js/test/openai/audioClient.test.ts Updates model selection in audio client tests.
sdk_v2/js/test/openai/responsesClient.test.ts Updates model selection in responses client test setup.

💡 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

Adjusts the JS SDK Model.selectVariant API to accept a ModelVariant object (aligning with the C# SDK style) and updates usage sites accordingly.

Changes:

  • Update Model.selectVariant signature from variant id (string) to ModelVariant.
  • Update JS integration/unit tests to pass ModelVariant objects instead of ids.
  • Update the JS SDK README example to reflect the new call pattern.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk_v2/js/src/model.ts Changes selectVariant to accept a ModelVariant and validates membership via id lookup.
sdk_v2/js/README.md Updates example usage to pass variants[0] rather than variants[0].id.
sdk_v2/js/test/model.test.ts Updates selectVariant usage to pass a ModelVariant.
sdk_v2/js/test/openai/chatClient.test.ts Updates selectVariant usage to pass a ModelVariant across multiple tests.
sdk_v2/js/test/openai/audioClient.test.ts Updates selectVariant usage to pass a ModelVariant across multiple tests.
sdk_v2/js/test/openai/responsesClient.test.ts Updates selectVariant usage to pass a ModelVariant in integration setup.

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

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

Adjusts the JS SDK’s variant-selection API to take a ModelVariant object (aligning with the C# SDK approach) and updates tests/docs accordingly.

Changes:

  • Update Model.selectVariant to accept a ModelVariant instead of a variant ID string.
  • Update JS tests and README usage examples to pass a ModelVariant.
  • Add/update generated API docs for ResponsesClient, settings, and related types.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk_v2/js/src/model.ts Changes selectVariant to accept ModelVariant and selects by matching ID.
sdk_v2/js/test/model.test.ts Updates tests to pass a ModelVariant to selectVariant.
sdk_v2/js/test/openai/chatClient.test.ts Updates tests to pass a ModelVariant to selectVariant.
sdk_v2/js/test/openai/audioClient.test.ts Updates tests to pass a ModelVariant to selectVariant.
sdk_v2/js/test/openai/responsesClient.test.ts Updates tests to pass a ModelVariant to selectVariant.
sdk_v2/js/README.md Updates example usage to pass a ModelVariant.
sdk_v2/js/docs/README.md Updates generated docs index and type listings (incl. Responses API types).
sdk_v2/js/docs/classes/Model.md Updates generated docs for selectVariant signature + adds createResponsesClient.
sdk_v2/js/docs/classes/ModelVariant.md Updates generated docs + adds createResponsesClient.
sdk_v2/js/docs/classes/FoundryLocalManager.md Updates generated docs to include isWebServiceRunning and createResponsesClient.
sdk_v2/js/docs/classes/ResponsesClient.md Adds generated docs for ResponsesClient.
sdk_v2/js/docs/classes/ResponsesClientSettings.md Adds generated docs for ResponsesClientSettings.
sdk_v2/js/docs/classes/ChatClient.md Updates generated docs formatting/signatures for chat methods.
sdk_v2/js/docs/classes/ChatClientSettings.md Updates generated docs for additional settings properties.

💡 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 updates the JS SDK Model.selectVariant API to accept a ModelVariant object (aligning with the C# SDK) and regenerates/updates the JS API reference docs accordingly.

Changes:

  • Change Model.selectVariant to accept a ModelVariant instead of a variant ID string.
  • Update tests and README usage to pass a ModelVariant object.
  • Add/regenerate TypeDoc markdown for ResponsesClient and related types/settings.

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_v2/js/src/model.ts Changes selectVariant to accept ModelVariant and validates membership via ID lookup.
sdk_v2/js/test/openai/chatClient.test.ts Updates test calls to pass a ModelVariant object.
sdk_v2/js/test/openai/audioClient.test.ts Updates test calls to pass a ModelVariant object.
sdk_v2/js/test/openai/responsesClient.test.ts Updates test calls to pass a ModelVariant object.
sdk_v2/js/test/model.test.ts Updates test calls to pass a ModelVariant object.
sdk_v2/js/README.md Updates sample usage to pass a ModelVariant object.
sdk_v2/js/docs/classes/Model.md Updates generated docs for selectVariant(variant).
sdk_v2/js/docs/classes/ModelVariant.md Adds generated docs for createResponsesClient and fixes anchors.
sdk_v2/js/docs/classes/ResponsesClient.md Adds generated docs for ResponsesClient.
sdk_v2/js/docs/classes/ResponsesClientSettings.md Adds generated docs for ResponsesClientSettings.
sdk_v2/js/docs/classes/FoundryLocalManager.md Adds generated docs for isWebServiceRunning and createResponsesClient.
sdk_v2/js/docs/classes/ChatClientSettings.md Adds generated docs for responseFormat/toolChoice.
sdk_v2/js/docs/classes/ChatClient.md Updates generated docs formatting and overload descriptions.
sdk_v2/js/docs/README.md Updates generated docs index/types to include Responses API shapes.

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

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 Model.selectVariant API to accept a ModelVariant object (instead of a variant ID string) to align with the C# SDK, and regenerates/updates the JS SDK documentation and tests accordingly.

Changes:

  • Change Model.selectVariant to take a ModelVariant and validate membership in the model’s variant list.
  • Update JS tests and README snippet to pass ModelVariant objects to selectVariant.
  • Add/regenerate TypeDoc markdown for Responses API-related types/clients and other doc updates.

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_v2/js/src/model.ts Changes selectVariant signature to accept ModelVariant and adds runtime validation helper.
sdk_v2/js/test/openai/responsesClient.test.ts Updates selectVariant call sites to pass a ModelVariant.
sdk_v2/js/test/openai/chatClient.test.ts Updates selectVariant call sites to pass a ModelVariant.
sdk_v2/js/test/openai/audioClient.test.ts Updates selectVariant call sites to pass a ModelVariant.
sdk_v2/js/test/model.test.ts Updates selectVariant call sites to pass a ModelVariant.
sdk_v2/js/README.md Updates usage example to pass a ModelVariant to selectVariant.
sdk_v2/js/docs/classes/Model.md Updates generated API docs for selectVariant parameter type/signature.
sdk_v2/js/docs/classes/ModelVariant.md Updates generated docs (including Responses client method references/anchors).
sdk_v2/js/docs/classes/FoundryLocalManager.md Updates generated docs to include Responses client/web service members.
sdk_v2/js/docs/classes/ChatClientSettings.md Updates generated docs with additional settings fields.
sdk_v2/js/docs/classes/ChatClient.md Updates generated docs formatting and overload documentation.
sdk_v2/js/docs/classes/ResponsesClient.md Adds generated docs for the Responses client.
sdk_v2/js/docs/classes/ResponsesClientSettings.md Adds generated docs for Responses client settings.
sdk_v2/js/docs/README.md Regenerates/updates TypeDoc README index and type/interface listings (notably Responses API types).

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

@prathikr
Copy link
Contributor Author

continued in #535

@prathikr prathikr closed this Mar 18, 2026
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.

2 participants