#Assistant API - UI

1 messages · Page 1 of 1 (latest)

vale axle
slow patrol
#

I have been looking for an Assistants UI. Any plans to allow the user to provide file attachments in the query? My assistant helps users format documents they attach.

vale axle
slow patrol
#

Awesome! Yours would be the first I know of that could do that. I'm sure there are a lot of people working on UIs for the Assistant API but I haven't seen much out there yet

vale axle
slow patrol
slow patrol
#

I did some quick experimenting running OpenAI-Assistant-API-Chat locally. Here are a few notes as you continue to build:

  • I was getting an app error with attachments. I tracked down the line const path = /tmp/${file.name}; in route.ts and the error was fixed after I created a 'tmp' directory.
  • After that was fixed, the Assistant continues to reply with errors like this one: "I apologize, but it seems there was a technical issue which prevents me from accessing the file you've uploaded..." with every kind of file I try (pdf, txt, docx, json). However, those files DO appear in the Files folder on OpenAI, so they were uploaded, they just can't be read for some reason. When I use the Playground to attach the same files, it is able to read them.
  • I wanted to remove the initial message in useChatState.ts const [initialThreadMessage, setInitialThreadMessage] = useState('You are a Pirate! introduce yourself');' However, setting this to null or an empty string crashes the app.
  • In line const [assistantModel, setAssistantModel] = useState('gpt-3.5-turbo-1106'); in useChatState.ts, does the model need to be redefined to match the model of my assistant? Or does that get detected and overridden? I tried putting in 'gpt-4-1106-preview' (what I'm using) and nothing seemed to change.
  • It would be great if it was able to log the token usage of each run.
  • It would be great if there was an exposed app API route for posting a message. For instance, I want the user to fill out a form and have that form data programatically added to a message and posted.

I know JS but not TS, and limited React, so my ability to fix/tinker with this stuff on my own is limited at best 😆

Thanks for building this!

vale axle
#

Hi, thank you for the input, will check every point later.

The problem with the Assistant and fileUplpad is, that openai needs time to index. Thats the biggest problem. I can fix that maybe by directly uploading as soon as selected. (Like in the Assistant Builder project)

#

---> tmp file: i tested the webapp (hosted on vercel) on different devices , so this bug is new for me.

#

----->remove the initial message: its not crashing, it just does not have a message to run on. We need a Message in a thread to get an answer. i did that because i didnt want to hardcode a welcome message from the assistant and its like a test if openai server are online

#

---> const [assistantModel, setAssistantModel] = useState('gpt-3.5-turbo-1106'); ...means that the default model is the 3.5 . if you change it to 4, its the new default.... you can check the assistant model in the OpenAI Assistant Playground. it should work. (100% tested it rn)

#

--->Route for posting in chat ... soon, its on my list

#

---> token usage of each run. .... i dont know if thats possible... knowledge retrieval is input tokens as i understand it...they are handling everything so i cannot keep track of

vale axle
#

You can chat with the whole codebase

slow patrol
slow patrol
# vale axle Hi, thank you for the input, will check every point later. The problem with the...

Ah, so I would need to attach the file and send something like "please confirm when this file is ready for reference". Then make the request about it. I will try this later.
Update: I tried this and the Assistant still gives an error about reading the document. However, if I wait some arbitrary time like a minute, it can then read the document. So I guess they need to add some sort of event for when the file is ready. I wonder why it works in the Playground though...

slow patrol
vale axle
slow patrol
vale axle
#

but i added multiple file upload