MCPcopy
hub / github.com/openai/openai-go / TestVectorStoreFileBatchCancel

Function TestVectorStoreFileBatchCancel

vectorstorefilebatch_test.go:91–116  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func TestVectorStoreFileBatchCancel(t *testing.T) {
92 baseURL := "http://localhost:4010"
93 if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
94 baseURL = envURL
95 }
96 if !testutil.CheckTestServer(t, baseURL) {
97 return
98 }
99 client := openai.NewClient(
100 option.WithBaseURL(baseURL),
101 option.WithAPIKey("My API Key"),
102 option.WithAdminAPIKey("My Admin API Key"),
103 )
104 _, err := client.VectorStores.FileBatches.Cancel(
105 context.TODO(),
106 "vector_store_id",
107 "batch_id",
108 )
109 if err != nil {
110 var apierr *openai.Error
111 if errors.As(err, &apierr) {
112 t.Log(string(apierr.DumpRequest(true)))
113 }
114 t.Fatalf("err should be nil: %s", err.Error())
115 }
116}
117
118func TestVectorStoreFileBatchListFilesWithOptionalParams(t *testing.T) {
119 baseURL := "http://localhost:4010"

Callers

nothing calls this directly

Calls 7

DumpRequestMethod · 0.95
CheckTestServerFunction · 0.92
WithBaseURLFunction · 0.92
WithAPIKeyFunction · 0.92
WithAdminAPIKeyFunction · 0.92
CancelMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…