mdwiltfong / doc-inspector

1 stars 0 forks source link

Document records need a column to differentiate between resource and template #4

Closed mdwiltfong closed 11 months ago

mdwiltfong commented 11 months ago

PDFs will be resources while Markdown files will be templates

Jamesllllllllll commented 11 months ago

I have my front-end code ready to include the role when each file is uploaded.

I see in /document/actions/create.js the onSuccess includes assistantId and fileId from the record. Do I need to do anything on the front-end to connect the newly created assistant with these files, or will that happen in the back-end?

Here are the current UX steps:

  1. Click "start" button that simply creates an assistant.
  2. User uploads a resource and a template. QUESTION --> Do we need to send the assistantId with each file so the back-end knows they are related?

The above question is what I really need to know for the next step. I continued the process below to make sure I'm understanding what's going on:

  1. The assistant is given the resource and template
  2. The assistant starts a thread about the resource
  3. The user can now chat with the assistant about the resource
  4. Assistant modifies the markdown template based on the interactions
mdwiltfong commented 11 months ago

| Do I need to do anything on the front-end to connect the newly created assistant with these files, or will that happen in the back-end?

Yeah! When creating a document, we have to tell OpenAI to "attach" this document to the AI we're creating. Look at this here.

In hindsight this might conflict with the idea that someone can only start talking to the AI after they've provided a document. Would it be possible to make it possible to upload a document at any time?

Jamesllllllllll commented 11 months ago

We can certainly create the assistant first and chatting is disabled in the UI until there is a resource uploaded!

Kind of like above, step 1 is creating the assitant. Step 2 is uploading the resource and template to attach to the AI we have created.

When it is all set up, then the AI can say something to start the interaction. A message like "What would you like to know?" would appear in the chat and then the chat input is enabled.

Jamesllllllllll commented 11 months ago

After absorbing the OpenAI docs you sent last night, I think the UX flow should instead be:

  1. User uploads both documents
  2. THEN and assistant is created with those two documents attached. 3 ... 6 7 Win Hackathon

I'm going to open a new issue about the document uploading process