Skip to content

Conversation

@tsuzaki430
Copy link
Collaborator

@tsuzaki430 tsuzaki430 commented Oct 12, 2025

Background

This pull request doesn't update any features to @ai-sdk/azure.
However, it adds tests that will help ensure the soundness of future updates.
I would like to add tests for when doStream and doGenerate are processed in the Responses API.
In the tests for the Responses API in @ai-sdk/openai, it is possible to obtain idempotent results for doGenerate and doStream by passing the result data chunks to the function in advance.
I would like to add similar tests for the Responses API in @ai-sdk/azure.

Summary

This pull request doesn't update any features to @ai-sdk/azure.
I created the Azure test code by referring to the OpenAI test code. I copied some parts.

  • add createModel function for idempotent results for doGenerate and doStream.
  • add tool using test
  • add code interpreter test
  • add file search test
  • add image generation test ( doGenerate only because not supported stream on azure platform )

Manual Verification

Since there were no functional changes, I confirmed that there was no change in the test results.

  • ai-core
    src/generate-text/azure-responses-code-interpreter.ts
    src/stream-text/azure-responses-code-interpreter.ts

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)
  • I have reviewed this pull request (self-review)

Future Work

Related Issues

@tsuzaki430 tsuzaki430 changed the title chore(azure) doStream tests for azure provider Responses API chore(azure) doGenerate and doStream tests for azure provider Responses API Oct 12, 2025
@tsuzaki430
Copy link
Collaborator Author

tsuzaki430 commented Oct 13, 2025

memo: how to make fixtures files

  • xxxxx/fixtures/xxxxxxxxxxxxxx.n.chunks.txt
  const result = streamText({
    model: azure.responses('gpt-5-mini'), // use your own deployment
    prompt:
      'Create a program that generates five random numbers between 1 and 100 with two decimal places, and show me the execution results.',
    tools: {
      code_interpreter: azure.tools.codeInterpreter(),
    },
    includeRawChunks:true,
  });

  for await (const part of result.fullStream) {
    if(part.type==="raw"){
      console.log(JSON.stringify(part.rawValue));
    }
  }
}
  • xxxxx/fixtures/xxxxxxxxxxxxxx.n.json
  const basicResult = await generateText({
    model: azure.responses('gpt-5-mini'),
    prompt:
      'Create a program that generates five random numbers between 1 and 100 with two decimal places, and show me the execution results.',
    tools: {
      code_interpreter: azure.tools.codeInterpreter(),
    },
  });


  console.log(JSON.stringify(basicResult.response.body,null,2));

@tsuzaki430 tsuzaki430 changed the title chore(azure) doGenerate and doStream tests for azure provider Responses API chore(azure) add built-in tools tests for azure provider Responses API Oct 13, 2025
@tsuzaki430 tsuzaki430 marked this pull request as ready for review October 13, 2025 12:27
@tsuzaki430
Copy link
Collaborator Author

@vercel/ai-sdk-azure

Hello , my review is finished.

@tsuzaki430
Copy link
Collaborator Author

Is @vercel/ai-sdk-azure enabled to notification between members?

@tsuzaki430
Copy link
Collaborator Author

@gr2m

Hello , I want to send message to azure members for the review using @vercel/ai-sdk-azure.

@vercel/ai-sdk-azure
@vercel/ai-sdk-azure doesn't change clickable link.
The notification may not reach members.

@rahulbhadja
Copy link
Collaborator

Hi @tsuzaki430 , I reviewed the code as well. Yes, I manually checked this in PR, so there is no way to know if anyone mentioned @vercel/ai-sdk-azure.

@tsuzaki430
Copy link
Collaborator Author

@rahulbhadja

Thank you for review this PR!
It was the message from gr2m about @vercel/ai-sdk-azure.
(Maybe I'm using it incorrectly.)

Thank you so much for coming here and leaving a message😊

@gr2m
Copy link
Collaborator

gr2m commented Oct 29, 2025

Is @vercel/ai-sdk-azure enabled to notification between members?

unfortunately it didn't work out with the team. You can ping the team and other interested folks in #9863.

Sorry it took to respond, we have all been busy with https://vercel.com/ship/ai 😁

Copy link
Collaborator

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

This is much appreciated, thank you @tsuzaki430!

@gr2m gr2m enabled auto-merge (squash) October 29, 2025 03:29
@gr2m gr2m added the backport label Oct 29, 2025
@gr2m gr2m self-assigned this Oct 29, 2025
@gr2m gr2m merged commit f1eed1c into vercel:main Oct 31, 2025
19 of 20 checks passed
vercel-ai-sdk bot pushed a commit that referenced this pull request Oct 31, 2025
@vercel-ai-sdk vercel-ai-sdk bot removed the backport label Oct 31, 2025
@vercel-ai-sdk
Copy link
Contributor

vercel-ai-sdk bot commented Oct 31, 2025

⚠️ Backport to release-v5.0 created but has conflicts: #9937

@tsuzaki430 tsuzaki430 deleted the tsuz/add-azure-tests branch October 31, 2025 09:59
@tsuzaki430
Copy link
Collaborator Author

@rahulbhadja @gr2m

Thank you for your review. I was very happy to have this pull request merged.

@gr2m
Copy link
Collaborator

gr2m commented Nov 4, 2025

fyi I'm looking into the failed backport now

gr2m added a commit that referenced this pull request Nov 6, 2025
…sponses API (#9937)

This is an automated backport of #9431 to the release-v5.0 branch

---------

Co-authored-by: tsuzaki430 <[email protected]>
Co-authored-by: Gregor Martynus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants