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_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