Using Azure open AI Assistant throws TypeError: create() got an unexpected keyword argument 'file_ids'

Anonymous
2024-05-13T11:20:37.2033333+00:00

I am working on Azure notebook and while creating Azure Open AI Assistant api(source, source2) I am getting TypeError: create() got an unexpected keyword argument 'file_ids', I tried the solution mentioned here even though it is not from AZURE but it gives me different error TypeError: Assistants.create() got an unexpected keyword argument 'attachments', The same code works fine locally without any TypeError: create() got an unexpected keyword argument 'file_ids' is there an update for creating assistants api on AZURE notebook(or any other cloud based notebook) or it is a new bug related to this bug ? I am using gpt-35-turbo-16k-0613 model

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,092 questions
{count} votes

2 answers

Sort by: Most helpful
  1. romungi-MSFT 48,911 Reputation points Microsoft Employee Moderator
    2024-09-10T05:26:40.2+00:00

    Please see this thread with similar error details.

    https://learn.microsoft.com/en-us/answers/questions/2028283/azure-openai-assistants-code-interpreter-(preview)

    We now need to use tool_resources with the assistant.

    assistant = client.beta.assistants.create( instructions="You are an AI assistant that can write code to help answer math questions.", model=ENGINE_GPT4, tools=[{"type": "code_interpreter"}], tool_resources={ "code_interpreter": {"file_ids": [file.id]}} )

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    2 people found this answer helpful.
    0 comments No comments

  2. Melo, Carmo 16 Reputation points
    2025-04-15T11:12:48.9366667+00:00
    Hi,
    
    Hello, it works, but it's not as elegant as the native Open AI,
    when running it we depend on the prompt to search for the files and we can't fix the file_ids, when you have a better solution, please report it in this forum.
    
    
    print("🤖 Creating assistant with associated files...")
    assistant = client.beta.assistants.create(
      name="Doc sample",
      instructions="You are an expert in Doc Sample. Answer based on the content of the provided   document.",
      tools=[{"type": "file_search"}], # or "retrieval", depending on the usage
      model=deployment,
      #file_ids=file_ids # <- associated files here (deprecread)
      tool_resources={ "code_interpreter": {"file_ids": file_ids}} # <- associated files here
    )
    
    run = client.beta.threads.runs.create(
      thread_id=thread.id,
      assistant_id=assistant.id
    )
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.