org.llm4s.types

package org.llm4s.types

Comprehensive type aliases and newtypes for the LLM4S library.

Key Features:

  • Core result types and error handling
  • ID newtypes for type safety
  • Async and streaming type aliases
  • Configuration and metadata types
  • Tool and MCP related types
  • Future extensibility for various domains
  • Consistent and clear type definitions
  • Type safety without performance cost (AnyVal newtypes)
  • Consistent naming patterns across the library
  • Clear distinction between sync/async operations
  • Extensible for future requirements
  • Backwards compatibility with legacy types

Attributes

Members list

Packages

Type members

Classlikes

final case class AgentId(value: String) extends AnyVal

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object AgentId

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
AgentId.type
final case class ApiKey(value: String) extends AnyVal

Type-safe wrapper for API keys (prevents accidental logging)

Type-safe wrapper for API keys (prevents accidental logging)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object ApiKey

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
ApiKey.type
final case class ArtifactKey(value: String) extends AnyVal

Type-safe wrapper for artifact store keys

Type-safe wrapper for artifact store keys

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object ArtifactKey

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class AudioId(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class CacheKey(value: String) extends AnyVal

Type-safe wrapper for cache keys

Type-safe wrapper for cache keys

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class CodeTaskId(value: String) extends AnyVal

Type-safe wrapper for code task IDs

Type-safe wrapper for code task IDs

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class CompletionId(value: String) extends AnyVal

Type-safe wrapper for completion IDs

Type-safe wrapper for completion IDs

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object CompletionId

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class CompressionTarget(ratio: Double) extends AnyVal

Type-safe wrapper for compression target ratios with validation

Type-safe wrapper for compression target ratios with validation

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class ContentSize(bytes: Long) extends AnyVal

Type-safe wrapper for content size in bytes with validation

Type-safe wrapper for content size in bytes with validation

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object ContentSize

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class ContextSummary(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class ConversationId(value: String) extends AnyVal

Type-safe wrapper for conversation IDs

Type-safe wrapper for conversation IDs

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class DirectoryPath(value: String) extends AnyVal

Type-safe wrapper for directory paths

Type-safe wrapper for directory paths

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object DirectoryPath

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class EmbeddingId(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait EstimationAccuracy

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object High
object Low
object Medium
case class ExternalizedContent(key: ArtifactKey, originalSize: ByteCount, contentType: String, summary: String)

Information about externalized content

Information about externalized content

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class FilePath(value: String) extends AnyVal

Type-safe wrapper for file paths

Type-safe wrapper for file paths

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object FilePath

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
FilePath.type
final case class FineTuningJobId(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final implicit class FutureOps[A](val fa: Future[A]) extends AnyVal

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final case class HeadroomPercent(value: Double) extends AnyVal

Type-safe wrapper for headroom percentage with validation

Type-safe wrapper for headroom percentage with validation

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class ImageId(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class ImagePrompt(value: String) extends AnyVal

Future extensibility types. These types are placeholders for future extensibility.

Future extensibility types. These types are placeholders for future extensibility.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class JwtToken(value: String) extends AnyVal

Type-safe wrapper for JWT tokens

Type-safe wrapper for JWT tokens

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class MCPClientName(value: String) extends AnyVal

Type-safe wrapper for MCP client names

Type-safe wrapper for MCP client names

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class MCPProtocolVersion(value: String) extends AnyVal

Type-safe wrapper for MCP protocol version

Type-safe wrapper for MCP protocol version

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class MCPServerName(value: String) extends AnyVal

Type-safe wrapper for MCP server names

Type-safe wrapper for MCP server names

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class MessageId(value: String) extends AnyVal

Type-safe wrapper for message IDs

Type-safe wrapper for message IDs

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class MetricName(value: String) extends AnyVal

Type alias for metric name

Type alias for metric name

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class ModelName(value: String) extends AnyVal

Type-safe wrapper for LLM model names

Type-safe wrapper for LLM model names

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object ModelName

Validation and smart constructors for type-safe IDs and names. These objects provide methods to create and validate type-safe IDs and names, ensuring they meet specific criteria. They also provide common constants for frequently used models and providers. These methods return Result types for error handling, allowing users to create type-safe IDs and names with confidence that they are valid. This approach ensures type safety without runtime overhead, and provides a clear and consistent API for creating and validating IDs and names.

Validation and smart constructors for type-safe IDs and names. These objects provide methods to create and validate type-safe IDs and names, ensuring they meet specific criteria. They also provide common constants for frequently used models and providers. These methods return Result types for error handling, allowing users to create type-safe IDs and names with confidence that they are valid. This approach ensures type safety without runtime overhead, and provides a clear and consistent API for creating and validating IDs and names.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
ModelName.type
final case class OAuthToken(value: String) extends AnyVal

Type-safe wrapper for OAuth tokens

Type-safe wrapper for OAuth tokens

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final implicit class OptionOps[A](val oa: Option[A]) extends AnyVal

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final case class OrganizationId(value: String) extends AnyVal

Type-safe wrapper for organization IDs

Type-safe wrapper for organization IDs

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class PaginationInfo(page: Int, pageSize: Int, totalItems: Long, totalPages: Int, hasNext: Boolean, hasPrevious: Boolean)

Pagination information for large result sets

Pagination information for large result sets

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class PlanId(value: String) extends AnyVal

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object PlanId

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
PlanId.type
final case class PluginId(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class PluginVersion(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class ProjectId(value: String) extends AnyVal

Type-safe wrapper for project IDs

Type-safe wrapper for project IDs

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class ProviderName(value: String) extends AnyVal

Type-safe wrapper for provider names

Type-safe wrapper for provider names

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object ProviderName

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class RequestId(value: String) extends AnyVal

Type-safe wrapper for request IDs for tracing

Type-safe wrapper for request IDs for tracing

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class SearchQuery(value: String) extends AnyVal

Type alias for search query

Type alias for search query

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class SemanticBlockId(value: String) extends AnyVal

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class SessionId(value: String) extends AnyVal

Type-safe wrapper for session IDs

Type-safe wrapper for session IDs

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object SessionId

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
SessionId.type
final case class StepId(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class TeamId(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class TemplateName(value: String) extends AnyVal

Type-safe wrapper for template names

Type-safe wrapper for template names

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class TokenEstimate(tokens: Int) extends AnyVal

Type-safe wrapper for token estimates with accuracy indicators

Type-safe wrapper for token estimates with accuracy indicators

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object TokenEstimate

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class ToolCallId(value: String) extends AnyVal

Type-safe wrapper for tool call IDs

Type-safe wrapper for tool call IDs

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object ToolCallId

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
ToolCallId.type
final case class ToolName(value: String) extends AnyVal

Type-safe wrapper for tool names

Type-safe wrapper for tool names

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object ToolName

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
ToolName.type
final case class TraceId(value: String) extends AnyVal

Type-safe wrapper for trace IDs for distributed tracing

Type-safe wrapper for trace IDs for distributed tracing

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final implicit class TryOps[A](val t: Try[A]) extends AnyVal

Syntax: Try/Option/Future to Result conversions

Syntax: Try/Option/Future to Result conversions

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final case class Url(value: String) extends AnyVal

Type alias for URL string with validation

Type alias for URL string with validation

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object Url

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Url.type
final case class VideoId(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class WorkflowId(value: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
final case class WorkspaceId(value: String) extends AnyVal

Type-safe wrapper for workspace IDs

Type-safe wrapper for workspace IDs

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all

Types

type AgentCapabilities = Set[String]
type AgentMemory = Map[String, Any]

Type alias for async streaming completions

Type alias for async streaming completions

Attributes

type AsyncResult[+A] = Future[Result[A]]

Async result type for Future-based operations

Async result type for Future-based operations

Attributes

type AudioContent = Array[Byte]
type AuthCredentials = Either[ApiKey, JwtToken]

Type alias for authentication credentials

Type alias for authentication credentials

Attributes

type BlockPriority = Int

Type alias for semantic block priority (higher = more important to preserve)

Type alias for semantic block priority (higher = more important to preserve)

Attributes

type ByteCount = Long

Type alias for byte count

Type alias for byte count

Attributes

type CacheConfig = Map[String, Any]

Type alias for cache configuration

Type alias for cache configuration

Attributes

type CacheTTL = Long

Type alias for cache TTL (time to live) in seconds

Type alias for cache TTL (time to live) in seconds

Attributes

type CachedValue[A] = (A, Instant, CacheTTL)

Type alias for cached value with metadata

Type alias for cached value with metadata

Attributes

type CancellationToken = () => Boolean

Type alias for cancellation token

Type alias for cancellation token

Attributes

type CodeGenContext = Map[String, Any]

Type alias for code generation context

Type alias for code generation context

Attributes

Type alias for completion streaming with callback

Type alias for completion streaming with callback

Attributes

type CompletionStream = Iterator[StreamedChunk]

Type alias for streaming completion chunks

Type alias for streaming completion chunks

Attributes

type CompressionRatio = Double

Type alias for compression ratio (0.0 to 1.0, lower = more compression)

Type alias for compression ratio (0.0 to 1.0, lower = more compression)

Attributes

type ConfigResult[A] = Result[A]

Type alias for configuration loading result

Type alias for configuration loading result

Attributes

type ConfigSection = Map[String, Any]

Type alias for configuration section

Type alias for configuration section

Attributes

Type alias for configuration validation result

Type alias for configuration validation result

Attributes

type ContextWindowSize = Int

Type alias for context window size in semantic blocks

Type alias for context window size in semantic blocks

Attributes

type Duration = Long

Type alias for duration in milliseconds

Type alias for duration in milliseconds

Attributes

type EffectiveBudget = Int

Type alias for effective token budget (after applying headroom)

Type alias for effective token budget (after applying headroom)

Attributes

type EmbeddingVector = Array[Float]

Type alias for endpoint configuration

Type alias for endpoint configuration

Attributes

type EnvironmentConfig = Map[String, String]

Type alias for environment variable map

Type alias for environment variable map

Attributes

type ErrorCallback = () => LLMError

Type alias for error handling callback

Type alias for error handling callback

Attributes

Type alias for externalization threshold in bytes

Type alias for externalization threshold in bytes

Attributes

type FileContent = Array[Byte]

Type alias for file content

Type alias for file content

Attributes

type FileMetadata = Map[String, String]

Type alias for file metadata

Type alias for file metadata

Attributes

type GeneratedCodeResult = Result[String]

Type alias for generated code result

Type alias for generated code result

Attributes

type HttpHeaders = Map[String, String]

Type alias for HTTP headers

Type alias for HTTP headers

Attributes

type HttpStatus = Int

Type alias for HTTP status code

Type alias for HTTP status code

Attributes

type ImageGenerationResult = Result[Array[Byte]]
type Json = Value

Type alias for JSON values

Type alias for JSON values

Attributes

type JsonArray = Arr

Type alias for JSON arrays

Type alias for JSON arrays

Attributes

type JsonObject = Obj

Type alias for JSON objects

Type alias for JSON objects

Attributes

type MCPCapabilities = Map[String, Value]

Type alias for MCP capabilities

Type alias for MCP capabilities

Attributes

type MCPServerConfig = Map[String, Any]

Type alias for MCP server configuration

Type alias for MCP server configuration

Attributes

type MetricTags = Map[String, String]

Type alias for metric tags

Type alias for metric tags

Attributes

type MetricValue = Double

Type alias for metric value

Type alias for metric value

Attributes

Type alias for metrics collection

Type alias for metrics collection

Attributes

type MultiAgentResult[A] = Result[Map[AgentId, A]]
type MultiResult[+A] = Result[List[A]]

Multi-value result for operations returning collections

Multi-value result for operations returning collections

Attributes

type OptionalResult[+A] = Result[Option[A]]

Optional result for operations that may not return a value

Optional result for operations that may not return a value

Attributes

type PaginatedResult[+A] = Result[(List[A], PaginationInfo)]

Paginated result for large datasets

Paginated result for large datasets

Attributes

type ParameterValidation = Either[List[String], Value]

Type alias for tool parameter validation

Type alias for tool parameter validation

Attributes

type Percentage = Double

Type alias for percentage (0.0 to 100.0)

Type alias for percentage (0.0 to 100.0)

Attributes

type Permissions = Set[String]

Type alias for permission set

Type alias for permission set

Attributes

type PluginConfig = Map[String, Any]
type Probability = Double

Type alias for probability (0.0 to 1.0)

Type alias for probability (0.0 to 1.0)

Attributes

type ProgressCallback = () => Double

Type alias for progress callback

Type alias for progress callback

Attributes

type Result[+A] = Either[LLMError, A]

Standard synchronous result type used throughout the library

Standard synchronous result type used throughout the library

Attributes

type Role = (String, Permissions)

Type alias for role definition

Type alias for role definition

Attributes

type SearchFilters = Map[String, List[String]]

Type alias for search filters

Type alias for search filters

Attributes

Type alias for search result

Type alias for search result

Attributes

type SecretsMap = Map[String, ApiKey]

Type alias for secrets map

Type alias for secrets map

Attributes

type StreamResult[+A] = Result[Iterator[A]]

Streaming result for real-time data

Streaming result for real-time data

Attributes

type StreamingCallback[A] = A => Unit

Type alias for streaming with callback

Type alias for streaming with callback

Attributes

type SystemTokenCount = Int

Type alias for system message token count

Type alias for system message token count

Attributes

type Temperature = Double

Type alias for temperature parameter (0.0 to 2.0)

Type alias for temperature parameter (0.0 to 2.0)

Attributes

type TemplateVariables = Map[String, String]

Type alias for template variables

Type alias for template variables

Attributes

type TextContent = String

Type alias for text file content

Type alias for text file content

Attributes

type Timeout = Long

Type alias for timeout in milliseconds

Type alias for timeout in milliseconds

Attributes

type Timestamp = Long

Type alias for timestamp (Unix epoch milliseconds)

Type alias for timestamp (Unix epoch milliseconds)

Attributes

type TimingResult[A] = (A, Long)

Type alias for timing measurement

Type alias for timing measurement

Attributes

type TokenBudget = Int

Type alias for token budget

Type alias for token budget

Attributes

type TokenCount = Int

Type alias for token count

Type alias for token count

Attributes

type ToolExecutionContext = Map[String, Any]

Type alias for tool execution context

Type alias for tool execution context

Attributes

type ToolExecutionResult = Result[Value]

Type alias for tool execution result

Type alias for tool execution result

Attributes

type ToolPermissions = Set[String]

Type alias for tool permissions

Type alias for tool permissions

Attributes

Type alias for tool registry

Type alias for tool registry

Attributes

type ToolSchema = Value

Type alias for tool schema definition

Type alias for tool schema definition

Attributes

type TrainingDataset = List[String]
type TryResult[+A] = Try[Result[A]]

Try-based result for exception handling boundaries

Try-based result for exception handling boundaries

Attributes

type ValidatedResult[+A] = ValidatedNec[LLMError, A]

Validated result with accumulating errors (non-empty chain)

Validated result with accumulating errors (non-empty chain)

Attributes

type VideoAnalysisResult = Result[String]
type VideoContent = Array[Byte]
type WorkflowResult[A] = Result[Map[StepId, A]]
type WorkflowStep = Map[String, Any]

Implicits

Implicits

final implicit def FutureOps[A](fa: Future[A]): FutureOps[A]
final implicit def OptionOps[A](oa: Option[A]): OptionOps[A]
final implicit def TryOps[A](t: Try[A]): TryOps[A]

Syntax: Try/Option/Future to Result conversions

Syntax: Try/Option/Future to Result conversions

Attributes