class

Smith::LLM::Provider

Inherits Reference < Object

Instance methods

complete(request : Request) : Response
Source
complete_streaming(request : Request, &on_delta : String -> Nil) : Response

Streaming entry point. The default does no streaming at all — it runs complete() and hands the text over in one piece.

That default is what makes deltas universal: callers always see them, whether or not the provider streams, so neither the agent loop nor the renderers need a special case. Providers override this; when streaming is switched off they call super.

Source
default_model
Source
name
Source
on_thinking

Live thinking chunks, when a provider produces them. A property rather than a second block parameter, so the streaming signature every adapter implements stays as it is.

Source
on_thinking=(on_thinking : Proc(String, Nil) | Nil)

Live thinking chunks, when a provider produces them. A property rather than a second block parameter, so the streaming signature every adapter implements stays as it is.

Source
supports_documents?

PDFs are narrower. Anthropic parses one natively; the OpenAI shape has no equivalent, so everywhere else the answer is to say so and point at bash and a real tool, rather than ship a PDF parser inside smith.

Source
supports_images?

Whether an image block can be sent at all. Every provider smith ships with can carry one, so the default is true — but for Ollama that depends on the model, which nothing here can see, and a provider added later may not take images at all. What this gates is honest: a provider that says no gets a line of text describing the attachment instead of a request it would reject.

Source
supports_tool_result_media?

Whether an attachment may travel inside a tool result, which is a narrower question than supports_images? and deliberately its own. The OpenAI shape takes an image in a user message but has nowhere to put one under role: "tool", and quietly conflating the two would drop a picture the model was told it had. Only Anthropic says yes today.

Source
timeouts
Source