Skip to content

update samples#38747

Open
bobogogo1990 wants to merge 6 commits into
mainfrom
bg/add_more_samples
Open

update samples#38747
bobogogo1990 wants to merge 6 commits into
mainfrom
bg/add_more_samples

Conversation

@bobogogo1990
Copy link
Copy Markdown
Member

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

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)

Copilot AI review requested due to automatic review settings May 30, 2026 00:09
Copy link
Copy Markdown
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 @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-options createOrUpdate, container_configuration / protocol_versions, createVersionFromCode, paginated listSessionFiles).
  • Add a new agentToolboxWithGuardrail sample demonstrating an MCP-backed toolbox with an RAI policy and update both READMEs to list it.
  • Add README entries for a skillAsTool sample.

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