Skip to content

Help needed with type: input_file #362

@SimpleApp

Description

@SimpleApp

I'm trying to see how one can send files (not images) as message args, and couldn't find anything matching the open ai spec here : https://platform.openai.com/docs/guides/pdf-files?api-mode=responses

The openAPI doc mentions two ways of sending a file.

1/ by first uploading it, then referencing the file id as a chat input. I think i found a way to upload the file using CreateUploadRequestArgs (not sure how to attach the file though), however i couldn't find any way to mention the file id in the following message.
2/ by directly inputing a base64-encoded url as a input_file.

I looked at ChatCompletionRequestUserMessageContentPart which seems like a good candidate. However, the only thing i could find was :
pub enum ChatCompletionRequestUserMessageContentPart {
Text(ChatCompletionRequestMessageContentPartText),
ImageUrl(ChatCompletionRequestMessageContentPartImage),
InputAudio(ChatCompletionRequestMessageContentPartAudio),
}

I'm 100% sure i'm missing something, however at this point i feel stuck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions