Module: LLM::Anthropic::Response::File

Defined in:
lib/llm/providers/anthropic/response/file.rb

Instance Method Summary collapse

Instance Method Details

#file?Boolean

Always return true

Returns:

  • (Boolean)


8
# File 'lib/llm/providers/anthropic/response/file.rb', line 8

def file? = true

#file_typeSymbol

Returns the file type referenced by a prompt

Returns:

  • (Symbol)


13
14
15
16
17
18
19
20
21
# File 'lib/llm/providers/anthropic/response/file.rb', line 13

def file_type
  if mime_type.start_with?("image/")
    :image
  elsif mime_type == "text/plain" || mime_type == "application/pdf"
    :document
  else
    :container_upload
  end
end