update samples#38747
Open
bobogogo1990 wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the @azure/ai-projects samples (both samples-dev sources and the generated samples/v2/typescript and samples/v2/javascript outputs, plus their READMEs) to align with the latest customized SDK surface, and adds a new toolbox-with-guardrail sample.
Changes:
- Update skills, routines, and hosted-agent samples to match the current API shapes (
createFromFiles,inlineContent, single-optionscreateOrUpdate,container_configuration/protocol_versions,createVersionFromCode, paginatedlistSessionFiles). - Add a new
agentToolboxWithGuardrailsample demonstrating an MCP-backed toolbox with an RAI policy and update both READMEs to list it. - Add README entries for a
skillAsToolsample.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/ai/ai-projects/samples-dev/agents/tools/agentToolboxWithGuardrail.ts | New sample source for toolbox + RAI guardrail. |
| sdk/ai/ai-projects/samples/v2/typescript/src/agents/tools/agentToolboxWithGuardrail.ts | Generated TS version of the new guardrail sample. |
| sdk/ai/ai-projects/samples/v2/javascript/agents/tools/agentToolboxWithGuardrail.js | Generated JS version of the new guardrail sample. |
| sdk/ai/ai-projects/samples/v2/typescript/src/skills/skillBasic.ts | Switch to inlineContent body and id field on returned Skill. |
| sdk/ai/ai-projects/samples/v2/javascript/skills/skillBasic.js | Same skill API update for the JS sample. |
| sdk/ai/ai-projects/samples/v2/typescript/src/skills/skillUploadAndDownload.ts | Replace createFromPackage with createFromFiles multipart upload. |
| sdk/ai/ai-projects/samples/v2/javascript/skills/skillUploadAndDownload.js | Same upload API update for the JS sample. |
| sdk/ai/ai-projects/samples/v2/typescript/src/routine/routineBasics.ts | Use the new single-options-object createOrUpdate shape. |
| sdk/ai/ai-projects/samples/v2/javascript/routine/routineBasics.js | Same routine API update for the JS sample. |
| sdk/ai/ai-projects/samples/v2/typescript/src/agents/betaAgents.ts | Use container_configuration/protocol_versions and byPage() for session files. |
| sdk/ai/ai-projects/samples/v2/javascript/agents/betaAgents.js | Same hosted-agent and pagination updates for JS. |
| sdk/ai/ai-projects/samples/v2/typescript/src/agents/hostedAgents/sessionLogStream.ts | Update hosted-agent definition fields. |
| sdk/ai/ai-projects/samples/v2/javascript/agents/hostedAgents/sessionLogStream.js | Same hosted-agent definition update for JS. |
| sdk/ai/ai-projects/samples/v2/typescript/src/agents/hostedAgents/createHostedAgentFromCode.ts | Rename call to createVersionFromCode. |
| sdk/ai/ai-projects/samples/v2/javascript/agents/hostedAgents/createHostedAgentFromCode.js | Same rename, but also introduces import.meta.url in a CommonJS file. |
| sdk/ai/ai-projects/samples/v2/typescript/README.md | Add guardrail and skillAsTool sample entries. |
| sdk/ai/ai-projects/samples/v2/javascript/README.md | Add guardrail and skillAsTool sample entries. |
| | [responses/responseBasic.ts][responses_responsebasic] | This sample demonstrates how to create responses with and without conversation context. | | ||
| | [responses/responseBasicWithoutAIProjectClient.ts][responses_responsebasicwithoutaiprojectclient] | This sample demonstrates how to create an OpenAI client directly with Azure credentials and use it for a basic responses operation. See also https://platform.openai.com/docs/api-reference/responses/create | | ||
| | [responses/responseStream.ts][responses_responsestream] | This sample demonstrates how to create a non-streaming response and then use streaming for a follow-up response with conversation context. | | ||
| | [skills/skillAsTool.ts][skills_skillastool] | Demonstrates adding a skill to a toolbox and invoking it via a Prompt Agent. | |
| | [responses/responseBasic.js][responses_responsebasic] | This sample demonstrates how to create responses with and without conversation context. | | ||
| | [responses/responseBasicWithoutAIProjectClient.js][responses_responsebasicwithoutaiprojectclient] | This sample demonstrates how to create an OpenAI client directly with Azure credentials and use it for a basic responses operation. See also https://platform.openai.com/docs/api-reference/responses/create | | ||
| | [responses/responseStream.js][responses_responsestream] | This sample demonstrates how to create a non-streaming response and then use streaming for a follow-up response with conversation context. | | ||
| | [skills/skillAsTool.js][skills_skillastool] | Demonstrates adding a skill to a toolbox and invoking it via a Prompt Agent. | |
Comment on lines
+28
to
+32
| const { fileURLToPath } = require("node:url"); | ||
| const { buffer } = require("node:stream/consumers"); | ||
| require("dotenv/config"); | ||
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); |
…sdk-for-js into add_toolbox_guardrail_sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Packages impacted by this PR
Issues associated with this PR
Describe the problem that is addressed by this PR
What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
Are there test cases added in this PR? (If not, why?)
Provide a list of related PRs (if any)
Command used to generate this PR:**(Applicable only to SDK release request PRs)
Checklists