@@ -581,26 +581,26 @@ The file name and content-type can be customized by implementing `Name() string`
581
581
string` on the run-time type of ` io.Reader` . Note that ` os.File` implements ` Name() string`, so a
582
582
file returned by ` os.Open ` will be sent with the file name on disk.
583
583
584
- We also provide a helper ` openai.FileParam (reader io.Reader, filename string, contentType string) `
584
+ We also provide a helper ` openai.File (reader io.Reader, filename string, contentType string) `
585
585
which can be used to wrap any ` io.Reader ` with the appropriate file name and content type.
586
586
587
587
``` go
588
588
// A file from the file system
589
589
file , err := os.Open (" input.jsonl" )
590
590
openai.FileNewParams {
591
- File : openai. F [io. Reader ]( file) ,
591
+ File : file,
592
592
Purpose : openai.FilePurposeFineTune ,
593
593
}
594
594
595
595
// A file from a string
596
596
openai.FileNewParams {
597
- File : openai. F [io. Reader ]( strings.NewReader (" my file contents" ) ),
597
+ File : strings.NewReader (" my file contents" ),
598
598
Purpose : openai.FilePurposeFineTune ,
599
599
}
600
600
601
601
// With a custom filename and contentType
602
602
openai.FileNewParams {
603
- File : openai.FileParam (strings.NewReader (` {"hello": "foo"}` ), " file.go" , " application/json" ),
603
+ File : openai.File (strings.NewReader (` {"hello": "foo"}` ), " file.go" , " application/json" ),
604
604
Purpose : openai.FilePurposeFineTune ,
605
605
}
606
606
```
0 commit comments