(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func TestFileListWithOptionalParams(t *testing.T) { |
| 73 | baseURL := "http://localhost:4010" |
| 74 | if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { |
| 75 | baseURL = envURL |
| 76 | } |
| 77 | if !testutil.CheckTestServer(t, baseURL) { |
| 78 | return |
| 79 | } |
| 80 | client := openai.NewClient( |
| 81 | option.WithBaseURL(baseURL), |
| 82 | option.WithAPIKey("My API Key"), |
| 83 | option.WithAdminAPIKey("My Admin API Key"), |
| 84 | ) |
| 85 | _, err := client.Files.List(context.TODO(), openai.FileListParams{ |
| 86 | After: openai.String("after"), |
| 87 | Limit: openai.Int(0), |
| 88 | Order: openai.FileListParamsOrderAsc, |
| 89 | Purpose: openai.String("purpose"), |
| 90 | }) |
| 91 | if err != nil { |
| 92 | var apierr *openai.Error |
| 93 | if errors.As(err, &apierr) { |
| 94 | t.Log(string(apierr.DumpRequest(true))) |
| 95 | } |
| 96 | t.Fatalf("err should be nil: %s", err.Error()) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func TestFileDelete(t *testing.T) { |
| 101 | baseURL := "http://localhost:4010" |
nothing calls this directly
no test coverage detected
searching dependent graphs…