-
Notifications
You must be signed in to change notification settings - Fork 267
Update typescript quickstart samples #427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update typescript quickstart samples #427
Conversation
|
@dargilco @bobogogo1990 |
|
Could someone in azure-ai-foundry/ai-platform-docs please take a look at this PR? |
|
@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?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this update valid ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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' }
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bobogogo1990 Is this acceptable?
This pull request updates TypeScript quickstart samples for Azure AI Projects, including adding project configuration files, updating code to use the new
openAIClientinterface for conversations and responses, and switching to agent-based interactions.Project setup and configuration:
package.jsonwith scripts, dependencies, and devDependencies for TypeScript, Azure SDKs, and development tooling.tsconfig.jsonwith strict TypeScript settings and output configuration.Sample code updates:
quickstart-chat-with-agent.tsto use agent-based requests, passing the agent name and type in the request body, and removing the use of the deprecatedmodelparameter.