@@ -123,7 +123,10 @@ func getFileFromRequest(c *fiber.Ctx) (*File, error) {
123123 return nil , fmt .Errorf ("unable to find file id %s" , id )
124124}
125125
126- // GetFilesEndpoint https://platform.openai.com/docs/api-reference/files/retrieve
126+ // GetFilesEndpoint is the OpenAI API endpoint to get files https://platform.openai.com/docs/api-reference/files/retrieve
127+ // @Summary Returns information about a specific file.
128+ // @Success 200 {object} File "Response"
129+ // @Router /v1/files/{file_id} [get]
127130func GetFilesEndpoint (cm * config.BackendConfigLoader , appConfig * config.ApplicationConfig ) func (c * fiber.Ctx ) error {
128131 return func (c * fiber.Ctx ) error {
129132 file , err := getFileFromRequest (c )
@@ -135,13 +138,17 @@ func GetFilesEndpoint(cm *config.BackendConfigLoader, appConfig *config.Applicat
135138 }
136139}
137140
138- // DeleteFilesEndpoint https://platform.openai.com/docs/api-reference/files/delete
141+ type DeleteStatus struct {
142+ Id string
143+ Object string
144+ Deleted bool
145+ }
146+
147+ // DeleteFilesEndpoint is the OpenAI API endpoint to delete files https://platform.openai.com/docs/api-reference/files/delete
148+ // @Summary Delete a file.
149+ // @Success 200 {object} DeleteStatus "Response"
150+ // @Router /v1/files/{file_id} [delete]
139151func DeleteFilesEndpoint (cm * config.BackendConfigLoader , appConfig * config.ApplicationConfig ) func (c * fiber.Ctx ) error {
140- type DeleteStatus struct {
141- Id string
142- Object string
143- Deleted bool
144- }
145152
146153 return func (c * fiber.Ctx ) error {
147154 file , err := getFileFromRequest (c )
@@ -174,7 +181,11 @@ func DeleteFilesEndpoint(cm *config.BackendConfigLoader, appConfig *config.Appli
174181 }
175182}
176183
177- // GetFilesContentsEndpoint https://platform.openai.com/docs/api-reference/files/retrieve-contents
184+ // GetFilesContentsEndpoint is the OpenAI API endpoint to get files content https://platform.openai.com/docs/api-reference/files/retrieve-contents
185+ // @Summary Returns information about a specific file.
186+ // @Success 200 {string} binary "file"
187+ // @Router /v1/files/{file_id}/content [get]
188+ // GetFilesContentsEndpoint
178189func GetFilesContentsEndpoint (cm * config.BackendConfigLoader , appConfig * config.ApplicationConfig ) func (c * fiber.Ctx ) error {
179190 return func (c * fiber.Ctx ) error {
180191 file , err := getFileFromRequest (c )
0 commit comments