Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filename with the files API is truncated to the base name #222

Open
jlewi opened this issue Feb 9, 2025 · 1 comment · May be fixed by #223
Open

filename with the files API is truncated to the base name #222

jlewi opened this issue Feb 9, 2025 · 1 comment · May be fixed by #223

Comments

@jlewi
Copy link

jlewi commented Feb 9, 2025

When uploading a file I set a filename with a path such as "docs/techdocs/content/docs/overview.md". But the file ends up being named
"overview.md".

I upload a file like so

    fParam := openai.FileParam(fileData, info.vsName, MarkdownMimeType)
    
    fileParams := openai.FileNewParams{
    	File:    fParam,
    	Purpose: openai.F(openai.FilePurposeAssistants),
    }    

It looks like the problem is here

filename = path.Base(named.Name())

filename is being set to base

@jacobzim-stl
Copy link
Collaborator

Thanks for raising, this will be a nice fix. I'll review the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants