Error occurred when using Retrieval feature in Azure Assistant : Retrieval Tools Not Supported

Su Myat Hlaing 75 Reputation points

I encountered an error while trying to use the Retrieval feature in Azure Assistant and would appreciate any help resolving it. Below are the details of the error:

could you also support how to download the file by fileID?User's image


const { OpenAIClient, AzureKeyCredential,AssistantsClient } = require("@azure/openai-assistants");

async function main() {
  const assistantsClient = new AssistantsClient(endpoint, new AzureKeyCredential(azureApiKey));
  // File upload sample code
  const filename = "sample_file_for_upload.txt";
  const uint8array = new TextEncoder().encode(
    "The word 'apple' uses the code 442345, while the word 'banana' uses the code 673457.",
  const uploadAssistantFile = await assistantsClient.uploadFile(uint8array, "assistants", {
  const fileAssistantResponse = await assistantsClient.createAssistant({
    model: "gpt-4-turbo",
    name: "JS SDK Test Assistant - Retrieval",
    instructions: "Please address the user as Jane Doe. The user has a premium account.",
    tools: [{ type: "retrieval" }],
    fileIds: [],

  const assistantThread = await assistantsClient.assistantThreads.createThread({});

  const question = "I need to know codes for apple and banana. Can you help me?";
  const threadResponse = await assistantsClient.threadMessages.createMessage(,
  let runResponse = await assistantsClient.threadRuns.createRun(,,
      requestOptions: { timeout: 10000 },
        "You are a helpful assistant that can help fetch data from files you know about.",
      tools: [{ type: "retrieval" }],

  do {
    await new Promise((r) => setTimeout(r, 500));
    runResponse = await assistantsClient.threadRuns.retrieveRun(,;
    const runSteps = await assistantsClient.runSteps.listRunSteps(,,
        requestOptions: {},
        limit: 1,
  } while (runResponse.status === "queued" || runResponse.status === "in_progress");

  const runMessages = await assistantsClient.threadMessages.listMessages(;
  for (const runMessageDatum of {
    for (const item of runMessageDatum.content) {
      if (item.type === "text") {
      } else if (item.type === "image_file") {

main().catch((err) => {
  console.error("The sample encountered an error:", err);

module.exports = { main };
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,454 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 29,901 Reputation points

    Su Myat Hlaing

    AFAIK As mentioned here, Tools can currently be of types code_interpreter, or function.

    Our team is actively working on supporting this feature. Currently there is no exact ETA which can be shared on these feature availability.

    Once these updated feature is available in Azure OpenAI, What's new in Azure OpenAI Service and Assistants API (Preview) reference pages will be updated accordingly.

    I hope this helps. Let me know if you have any further queries.