class

LLM::GeneralAdapter

Inherits LLM::Adapter < Reference < Object

Adapter for OpenAI-compatible chat APIs (LLM::General).

Constructors

new(client : LLM::General, native_tool_calling_enabled : Bool = true)
Source

Instance methods

client
Source
request(prompt : String, format : String = "json") : String

Send a single prompt and get a response as a String.

Source
request_bundle(system : String, user : String, format : String) : String

A bundle request: like request_with_context, but an adapter that can tell raises LLM::ContextOverflow instead of returning "", so the bundle can be re-split rather than lost.

Source
request_messages(messages : Messages, format : String = "json") : String

Send chat-style messages (system/user) and get a response as a String.

Source
request_messages_with_tools(messages : Messages, tools : String) : String

Request next step using provider-native tool definitions. Implementations that do not support this can fallback to regular JSON-mode requests.

Source
supports_native_tool_calling?

Whether this adapter can leverage provider-native tool-calling.

Source