Skip to content

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

Closed
@jlewi

Description

@jlewi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions