Completion

org.llm4s.llmconnect.model.Completion
case class Completion(id: String, created: Long, content: String, model: String, message: AssistantMessage, toolCalls: List[ToolCall], usage: Option[TokenUsage], thinking: Option[String])

Represents a completion response from an LLM. This includes the ID, creation timestamp, the assistant's message, and optional token usage statistics.

Value parameters

content

The main content of the response.

created

Timestamp of when the completion was created.

id

Unique identifier for the completion.

message

The assistant's message in response to the user's input.

model

The model that generated this completion.

thinking

Optional thinking/reasoning content from extended thinking models. Present when using reasoning modes with Claude or o1/o3 models.

toolCalls

List of tool calls made by the assistant.

usage

Optional token usage statistics for the completion.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def asText: String

Extract content as text (for compatibility)

Extract content as text (for compatibility)

Attributes

def fullContent: String

Get the full response including thinking content (if available).

Get the full response including thinking content (if available).

Returns thinking wrapped in XML-style tags followed by the main content. Useful for logging or debugging the model's reasoning process.

Attributes

def hasThinking: Boolean

Check if completion includes thinking/reasoning content.

Check if completion includes thinking/reasoning content.

Attributes

def hasToolCalls: Boolean

Check if completion contains tool calls

Check if completion contains tool calls

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product