@@ -269,6 +269,31 @@ func (r FileObjectStatus) IsKnown() bool {
269269 return false
270270}
271271
272+ // The intended purpose of the uploaded file.
273+ //
274+ // Use "assistants" for
275+ // [Assistants](https://platform.openai.com/docs/api-reference/assistants) and
276+ // [Message](https://platform.openai.com/docs/api-reference/messages) files,
277+ // "vision" for Assistants image file inputs, "batch" for
278+ // [Batch API](https://platform.openai.com/docs/guides/batch), and "fine-tune" for
279+ // [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning).
280+ type FilePurpose string
281+
282+ const (
283+ FilePurposeAssistants FilePurpose = "assistants"
284+ FilePurposeBatch FilePurpose = "batch"
285+ FilePurposeFineTune FilePurpose = "fine-tune"
286+ FilePurposeVision FilePurpose = "vision"
287+ )
288+
289+ func (r FilePurpose ) IsKnown () bool {
290+ switch r {
291+ case FilePurposeAssistants , FilePurposeBatch , FilePurposeFineTune , FilePurposeVision :
292+ return true
293+ }
294+ return false
295+ }
296+
272297type FileNewParams struct {
273298 // The File object (not file name) to be uploaded.
274299 File param.Field [io.Reader ] `json:"file,required" format:"binary"`
@@ -280,7 +305,7 @@ type FileNewParams struct {
280305 // "vision" for Assistants image file inputs, "batch" for
281306 // [Batch API](https://platform.openai.com/docs/guides/batch), and "fine-tune" for
282307 // [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning).
283- Purpose param.Field [FileNewParamsPurpose ] `json:"purpose,required"`
308+ Purpose param.Field [FilePurpose ] `json:"purpose,required"`
284309}
285310
286311func (r FileNewParams ) MarshalMultipart () (data []byte , contentType string , err error ) {
@@ -298,31 +323,6 @@ func (r FileNewParams) MarshalMultipart() (data []byte, contentType string, err
298323 return buf .Bytes (), writer .FormDataContentType (), nil
299324}
300325
301- // The intended purpose of the uploaded file.
302- //
303- // Use "assistants" for
304- // [Assistants](https://platform.openai.com/docs/api-reference/assistants) and
305- // [Message](https://platform.openai.com/docs/api-reference/messages) files,
306- // "vision" for Assistants image file inputs, "batch" for
307- // [Batch API](https://platform.openai.com/docs/guides/batch), and "fine-tune" for
308- // [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning).
309- type FileNewParamsPurpose string
310-
311- const (
312- FileNewParamsPurposeAssistants FileNewParamsPurpose = "assistants"
313- FileNewParamsPurposeBatch FileNewParamsPurpose = "batch"
314- FileNewParamsPurposeFineTune FileNewParamsPurpose = "fine-tune"
315- FileNewParamsPurposeVision FileNewParamsPurpose = "vision"
316- )
317-
318- func (r FileNewParamsPurpose ) IsKnown () bool {
319- switch r {
320- case FileNewParamsPurposeAssistants , FileNewParamsPurposeBatch , FileNewParamsPurposeFineTune , FileNewParamsPurposeVision :
321- return true
322- }
323- return false
324- }
325-
326326type FileListParams struct {
327327 // Only return files with the given purpose.
328328 Purpose param.Field [string ] `query:"purpose"`
0 commit comments