go/resources/files/methods/content/index.md +0 −40 deleted
File Deleted View Diff
1## Retrieve file content
2
3`client.Files.Content(ctx, fileID) (*Response, error)`
4
5**get** `/files/{file_id}/content`
6
7Returns the contents of the specified file.
8
9### Parameters
10
11- `fileID string`
12
13### Returns
14
15- `type FileContentResponse interface{…}`
16
17### Example
18
19```go
20package main
21
22import (
23 "context"
24 "fmt"
25
26 "github.com/openai/openai-go"
27 "github.com/openai/openai-go/option"
28)
29
30func main() {
31 client := openai.NewClient(
32 option.WithAPIKey("My API Key"),
33 )
34 response, err := client.Files.Content(context.TODO(), "file_id")
35 if err != nil {
36 panic(err.Error())
37 }
38 fmt.Printf("%+v\n", response)
39}
40```