How can I upload two .md files and ask about their contents?

I’m new to OpenAI and want to try uploading two .md files. After that, I need to ask about their contents. The original .md file is very large, which is why I split it into two sections. I’ve read the documentation, but I’m still unsure about what (thread_id) is.

def uploading_file(path_1,path_2):
    
    file_1 = client.files.create(

        file = open(path_1, "rb"),
        purpose='assistants'
    )
    print(f"file {file_1.filename} uploaded!")  
    
    file_2 = client.files.create(

        file = open(path_2, "rb"),
        purpose='assistants'
    )
    print(f"file {file_2.filename} uploaded!")  

    '''
    assistant = client.beta.assistants.create(
            instructions= 'You will be provided with a long document. Your task is to answer the question ....etc',
            model='gpt-4-0125-preview',
            tools=[{'type':'retrieval'}])


    # my assistant id is => #############################

    '''

    answer = client.beta.threads.messages.create(
        thread_id="", #### ????
        role="user",
        content="I want to know about ...etc",
        
        )
    
    return answer

Any idea how to do this?

1 Like