Azure OpenAI Uploading Document to Vector Store With API

Yazgan, Özkan 0 Reputation points
2025-01-16T22:03:51.07+00:00

Dear All,

Is there a way to Upload Documents to Open AIs assistant Vector store externally like With API or with power automate?

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

3 answers

Sort by: Most helpful
  1. Saideep Anchuri 1,790 Reputation points Microsoft Vendor
    2025-01-17T04:01:34.13+00:00

    Hi Yazgan, Özkan

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    Yes, you can upload documents to the Azure OpenAI assistant's vector store using the API. You can create a vector store and add files to it in a single API call.

    vector_store = client.beta.vector_stores.create(
      name="Product Documentation",
      file_ids=['file_1', 'file_2', 'file_3', 'file_4', 'file_5']
    )
    
    

    Additionally, you can add files to a vector store after it's created by creating vector store files or by creating batches of up to 500 files

    Kindly refer below link: vector-stores

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful.

    Thank You.


  2. Yazgan, Özkan 0 Reputation points
    2025-01-19T19:02:37.5566667+00:00

    Azure_Upload

    So I found a way to upload like this. I was asking to find a way to upload with Power Automate not with Python. Anyway I managed to do it like that. Just wanted to give feedback for future generations :). So basicly it worked as 2 steps for me. 1 Upload Document to files than attach it to correct vector storage.

    This is the way to attach to Assistant,

    Attach_Document

    And Finally, Check Status finally to make sure everything is right. (GET)

    Check_Status

    Good Luck to everyone out there...

    0 comments No comments

  3. NM 0 Reputation points
    2025-02-07T01:37:48.77+00:00

    for file_upload, is there an option to overwrite if the same file has already been uploaded before, similar to Blob overwrite=True?

    file_batch = client.beta.vector_stores.file_batches.upload_and_poll(
      vector_store_id=AZURE_VECTOR_STORE_ID, 
      files=file_streams
    )
    
    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.