ProviderExchange

org.llm4s.llmconnect.ProviderExchange
See theProviderExchange companion object
@Stable
final case class ProviderExchange

Minimal first-pass representation of a captured provider exchange.

This intentionally starts small, but now carries enough timing and correlation metadata to serve as a low-level debugging record that higher level tracing or tooling can reference later.

Build one with ProviderExchange.apply and change it with the with* setters (an Option field's setter takes the value or an Option); the constructor and copy are private, so a new field never breaks callers.

Attributes

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

Members list

Value members

Concrete methods

def withCompletedAt(completedAt: Instant): ProviderExchange

Sets when the exchange completed.

Sets when the exchange completed.

Attributes

def withCorrelationId(correlationId: String): ProviderExchange

Sets the caller's correlation id.

Sets the caller's correlation id.

Attributes

def withCorrelationId(correlationId: Option[String]): ProviderExchange

Sets, or with None clears, the caller's correlation id.

Sets, or with None clears, the caller's correlation id.

Attributes

def withDuration(duration: FiniteDuration): ProviderExchange

Sets how long the exchange took.

Sets how long the exchange took.

Attributes

def withErrorMessage(errorMessage: String): ProviderExchange

Sets the error message.

Sets the error message.

Attributes

def withErrorMessage(errorMessage: Option[String]): ProviderExchange

Sets, or with None clears, the error message.

Sets, or with None clears, the error message.

Attributes

def withExchangeId(exchangeId: String): ProviderExchange

Sets the exchange's identifier.

Sets the exchange's identifier.

Attributes

def withModel(model: String): ProviderExchange

Sets the model.

Sets the model.

Attributes

def withModel(model: Option[String]): ProviderExchange

Sets, or with None clears, the model.

Sets, or with None clears, the model.

Attributes

Sets the exchange's outcome.

Sets the exchange's outcome.

Attributes

def withProvider(provider: String): ProviderExchange

Sets the provider name.

Sets the provider name.

Attributes

def withRequestBody(requestBody: String): ProviderExchange

Sets the raw request body.

Sets the raw request body.

Attributes

def withRequestId(requestId: String): ProviderExchange

Sets the provider's request id.

Sets the provider's request id.

Attributes

def withRequestId(requestId: Option[String]): ProviderExchange

Sets, or with None clears, the provider's request id.

Sets, or with None clears, the provider's request id.

Attributes

def withResponseBody(responseBody: String): ProviderExchange

Sets the raw response body.

Sets the raw response body.

Attributes

def withResponseBody(responseBody: Option[String]): ProviderExchange

Sets, or with None clears, the raw response body.

Sets, or with None clears, the raw response body.

Attributes

def withStartedAt(startedAt: Instant): ProviderExchange

Sets when the exchange started.

Sets when the exchange started.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product