Skip to content

Conversation

@horihiro
Copy link

@horihiro horihiro commented Dec 13, 2025

This pull request updates TypeScript quickstart samples for Azure AI Projects, including adding project configuration files, updating code to use the new openAIClient interface for conversations and responses, and switching to agent-based interactions.

Project setup and configuration:

  • Added a new package.json with scripts, dependencies, and devDependencies for TypeScript, Azure SDKs, and development tooling.
  • Added a tsconfig.json with strict TypeScript settings and output configuration.

Sample code updates:

  • Updated quickstart-chat-with-agent.ts to use agent-based requests, passing the agent name and type in the request body, and removing the use of the deprecated model parameter.

@horihiro horihiro requested a review from a team as a code owner December 13, 2025 02:58
@horihiro horihiro changed the title Update typescript sample Update typescript quickstart samples Dec 13, 2025
@horihiro
Copy link
Author

@dargilco @bobogogo1990
Could you please take a look at this PR?

@horihiro
Copy link
Author

@sdgilley or @msakande Can you take a look at these changes?
I wonder how the current quickstart-chat-with-agent.ts works without using agent information.

@horihiro
Copy link
Author

Could someone in azure-ai-foundry/ai-platform-docs please take a look at this PR?

@dargilco
Copy link
Contributor

@horihiro thank you for this PR. I'd like @bobogogo1990 to review, as he is one of the owners of the JS ai-projects client library and is in the process of updating JS code in public learn.microsoft docs. I'll reach out to him, but due to holidays in the US, I doubt there will be any progress until after the New Year.

});
const response2 = await openAIClient.responses.create({
model: deploymentName,
input: "And what is the capital city?",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this update valid ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using both of model and body: { agent: { name: agentName, type: "agent_reference"} }, API returns an error.
To specify the agent, I removed the model parameter.

Copy link
Author

@horihiro horihiro Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API error is:

error: {
    code: 'invalid_payload',
    message: 'Not allowed when agent is specified.',
    param: 'model',
    type: 'invalid_request_error',
    details: [],
    additionalInfo: { request_id: '30328a8338107310fbae0e07d476ef9c' }
  },

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bobogogo1990 Is this acceptable?

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