LLM4STemplate

org.llm4s.spring.LLM4STemplate
final class LLM4STemplate(client: JLlmClient, executor: ExecutorService)

Spring-friendly entry point to an LLM.

complete and tryComplete block the calling thread. completeAsync never does: it is JLlmClient.completeAsync with the call on executor (the llm4sTaskExecutor bean), and the returned future completes from there. Cancelling the future with cancel(true) interrupts the provider call, which is how llm4s cancels work; a failure completes the future exceptionally with the LlmException, and so does an executor that refuses the call (its RejectedExecutionException the cause).

Attributes

Source
LLM4STemplate.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def complete(query: String): String

Attributes

Source
LLM4STemplate.scala
def complete(conversation: Conversation): String

Attributes

Source
LLM4STemplate.scala
def complete(conversation: Conversation, options: CompletionOptions): String

Attributes

Source
LLM4STemplate.scala

Attributes

Source
LLM4STemplate.scala

Attributes

Source
LLM4STemplate.scala
def tryComplete(conversation: Conversation): LlmResult[String]

Attributes

Source
LLM4STemplate.scala