openai / openai-dotnet

The official .NET library for the OpenAI API
https://www.nuget.org/packages/OpenAI
MIT License
707 stars 60 forks source link

FileUpload and chunk strategy on the Vector store #96

Open Clive321A opened 2 days ago

Clive321A commented 2 days ago

Hi, I'm uploading a File using the FileClient (all works fine), which creates a temporary vector store in the background. Is it possible to set the chunk size and overlap on the temporary vector store?.

OR do you have to create a VectorStore and upload your file into it?

                     FileClient fileClient = openAIClient.GetFileClient();
                    byte[] fileBytes = Convert.FromBase64String(base64Content);

                    using (MemoryStream document = new MemoryStream(fileBytes))
                    {
                        document.Seek(0, SeekOrigin.Begin);

                        OpenAIFileInfo pdfFile = await fileClient.UploadFileAsync(
                            document,
                            fileIdentifier,

                            FileUploadPurpose.Assistants);

                        var result = FileUploadResult.SuccessResult<FileUploadResult>();
                        result.FileId = pdfFile.Id;
                        return result;
                    }