File Upload with C# to an specific assistant

Hello, everyone!

I was wondering if it’s possible to upload files (e.g., .docx or .pdf) for my GPT assistant to use as a knowledge base. I’m looking to create an interface that would allow an admin to upload, retrieve, and delete files directly for the assistant. Has anyone implemented something similar? Any advice or insights would be greatly appreciated.

I’m using C# for my backend development.

Thanks in advance!

Hey @franklin.romero1207 -For a straightforward implementation, I recommend checking out file search in the Assistant API.

2 Likes

If I understand correctly, you are trying to achieve:

sequenceDiagram
    participant Admin
    participant Interface
    participant Backend
    participant Storage

    Note over Admin, Interface: Admin interacts with the interface to manage files

    Admin->>Interface: Upload File
    Interface->>Backend: Send File Data
    Backend->>Storage: Store File
    Storage-->>Backend: Confirm Storage
    Backend-->>Interface: Confirm Upload
    Interface-->>Admin: Upload Successful

    Admin->>Interface: Retrieve File
    Interface->>Backend: Request File
    Backend->>Storage: Fetch File
    Storage-->>Backend: Return File
    Backend-->>Interface: Send File Data
    Interface-->>Admin: Display File

    Admin->>Interface: Delete File
    Interface->>Backend: Request Deletion
    Backend->>Storage: Delete File
    Storage-->>Backend: Confirm Deletion
    Backend-->>Interface: Confirm Deletion
    Interface-->>Admin: Deletion Successful

    Note right of Admin: Admin can manage files through the interface

The best starting point would be to check out the file search mentioned by @Munna23 .

From there you could check references of other people implementing the OpenAI API using C#

Feel free to elaborate further.

Good luck! :hugs:

2 Likes

Thanks for the response, @Munna23

@j.wischnat hi there. Thanks for the response. Could you please provide the repo’s URL again, it’s broken.

1 Like

I deliberately linked multiple projects generally using the OpenAI API so you can look at their implementations to figure out how you should do your own.
I don’t think there’s a perfectly fitting solution for your problem!

Let me know if you need any further help! :innocent: