Minor Modifications to openai-assistants-quickstart

Overview When building a chat interface using RAG (Retrieval-augmented generation) with OpenAI’s Assistants API, I used the following repository. https://github.com/openai/openai-assistants-quickstart A modification was needed regarding the handling of citation, so I am documenting it here as a memo. Background I used the above repository to try RAG with OpenAI’s Assistants API. With the default settings, citation markers like “4:13†” were displayed as-is, as shown below. Solution I modified annotateLastMessage as follows. By changing file_path to file_citation, the citation markers could be replaced. ...

November 28, 2024 · 3 min · Nakamura

Deleting All Files in OpenAI Storage

Overview This is a memo on how to delete all files in OpenAI storage. The following page was helpful. https://community.openai.com/t/deleting-everything-in-storage/664945 Background There was a case where I wanted to bulk-delete multiple files uploaded using code like the following. f f # # f # p p i i i r r l l U a l v Y i i e e s n e e o n n _ _ e d _ c u t t p s b t ( ( a t t p a o c f f t r h o t r a i i h e e l c _ n l l s a l h s e e m u t p _ _ = s p t = o r b b l h r i a a g = o e c e n t t l a l _ t c c o [ d s i i h h b o t e d t . . ( p a a n = h s f " e n t t v e t i d n d u . e a l a ( s b c s t e t p p e t t u _ a a o o t o a s c / t l f a r t ) o t h l . _ u u x , t v s s n t S h e t t / " D e c o a s * r K t r n ) . b f o e d t " h i r . x ) e l _ i t t l e s d h " f p t , e ) o e b o r r a r f f t e i i p t c s l l a o h . e e t f s h u f i = c p o l f o i l r e i u n o _ l n a c b e t f d o a _ s i m t s l t p c t o e h l h r f _ e e e e p t s a t a f i . m h t i o u s e h l n p s e . l b ] s o a , a t d c a _ h d a d n t d o t _ h p s e o e m l e l t ( t o h e t h r e e s v u e l c t t o o r f s t t h o i r s e , o p e r a t i o n . Method Running the following code allowed me to perform bulk deletion. ...

July 24, 2024 · 13 min · Nakamura