Llm4s

org.llm4s.javaapi.Llm4s
object Llm4s

Entry-point factory for Java callers.

All methods return LlmResult so Java code never imports Scala Either or deals with implicit/given parameters directly. The Scala-level ModelRegistryService given is resolved internally and passed explicitly.

=== Quick-start (Java) ===

LlmResult<JLlmClient> r = Llm4s.createDefaultClient();
if (r.isSuccess()) {
   JLlmClient client = r.get();
   client.complete("Hello").ifSuccess(System.out::println);
}

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Llm4s.type

Members list

Value members

Concrete methods

def createAgent(client: JLlmClient): JAgent

Wraps a JLlmClient in a JAgent ready to accept natural-language queries and call tools.

Wraps a JLlmClient in a JAgent ready to accept natural-language queries and call tools.

Attributes

Creates a JLlmClient from an explicit ProviderConfig. Useful when the caller constructs the config programmatically rather than relying on environment variables.

Creates a JLlmClient from an explicit ProviderConfig. Useful when the caller constructs the config programmatically rather than relying on environment variables.

Attributes

Creates a JLlmClient from the default provider configured via environment variables (e.g. LLM_MODEL, OPENAI_API_KEY).

Creates a JLlmClient from the default provider configured via environment variables (e.g. LLM_MODEL, OPENAI_API_KEY).

Attributes