Skip to content

unexpected error when given an unknown mimetype #84

@0x1eef

Description

@0x1eef

Problem

We don't have a mime type for markdown documents (eg files with the extension .md)
and we don't implement a fallback mime type either. This leads to a confusing error deep
within LLM::Multipart. Reproduction steps:

#!/usr/bin/env ruby

llm = LLM.openai(key: ENV["OPENAI_SECRET"])
llm.files.create(file: "/path/to/file.md") # boom

Solutions

  • Fallback on the mime type application/octet-stream for unknown file extensions
  • Add a mime type of text/markdown for markdown documents (md, markdown, mkd).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions