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

Function TestVectorStoreFileBatchGet

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

Source from the content-addressed store, hash-verified

62}
63
64func TestVectorStoreFileBatchGet(t *testing.T) {
65 baseURL := "http://localhost:4010"
66 if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
67 baseURL = envURL
68 }
69 if !testutil.CheckTestServer(t, baseURL) {
70 return
71 }
72 client := openai.NewClient(
73 option.WithBaseURL(baseURL),
74 option.WithAPIKey("My API Key"),
75 option.WithAdminAPIKey("My Admin API Key"),
76 )
77 _, err := client.VectorStores.FileBatches.Get(
78 context.TODO(),
79 "vs_abc123",
80 "vsfb_abc123",
81 )
82 if err != nil {
83 var apierr *openai.Error
84 if errors.As(err, &apierr) {
85 t.Log(string(apierr.DumpRequest(true)))
86 }
87 t.Fatalf("err should be nil: %s", err.Error())
88 }
89}
90
91func TestVectorStoreFileBatchCancel(t *testing.T) {
92 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
GetMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…