Exception: Ollama::Errors::BadRequestError

Inherits:
Error
  • Object
show all
Defined in:
lib/ollama/errors.rb

Overview

Ollama error class for handling cases where a requested resource is not found.

This exception is raised when the Ollama API returns a 400 status code, indicating that the request was bad, e. g. think mode was requested from a non-thinking model.

Examples:

Handling a bad request error

begin
  ollama.generate(model: 'llama3.1', prompt: 'Hello World', think: true)
rescue Ollama::Errors::BadRequestError
  puts "Thinking not supported"
end