Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobzim-stl committed Oct 16, 2024
1 parent 2ec3977 commit 5355e58
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions examples/beta/vectorstorefilebatch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ func main() {
rdr, err := os.Open(arg)
defer rdr.Close()
if err != nil {
panic(err.Error())
panic("file open failed:" + err.Error())
}

fileParams = append(fileParams, openai.FileNewParams{
File: openai.F[io.Reader](rdr),
Purpose: openai.F(openai.FilePurposeAssistants),
})

if err != nil {
panic(err.Error())
}
}

println("Creating a new vector store and uploading files")
Expand All @@ -52,15 +48,15 @@ func main() {
)

if err != nil {
panic(err.Error())
panic(err)
}

// 0 uses default polling interval
batch, err := client.Beta.VectorStores.FileBatches.UploadAndPoll(ctx, vectorStore.ID, fileParams,
[]string{}, 0)

if err != nil {
panic(err.Error())
panic(err)
}

println("Listing the files from the vector store")
Expand All @@ -69,7 +65,7 @@ func main() {
openai.BetaVectorStoreFileBatchListFilesParams{})

if err != nil {
panic(err.Error())
panic(err)
}

for filesCursor != nil {
Expand All @@ -78,7 +74,7 @@ func main() {
}
filesCursor, err = filesCursor.GetNextPage()
if err != nil {
panic(err.Error())
panic(err)
}
}
}

0 comments on commit 5355e58

Please sign in to comment.