HttpResponse

org.llm4s.http.HttpResponse
See theHttpResponse companion class
object HttpResponse

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Extensions

Extensions

extension (response: HttpResponse)
def ensureSuccess(provider: String): Result[HttpResponse]

The response when its status is 2xx, else a ServiceError carrying the status and the body. The body in the error is redacted and capped (Redaction.safeBody, 2048 characters), since a provider's error body can echo the request's credentials.

The response when its status is 2xx, else a ServiceError carrying the status and the body. The body in the error is redacted and capped (Redaction.safeBody, 2048 characters), since a provider's error body can echo the request's credentials.

Attributes

def toJson(fieldName: String): Result[JsonHttpResponse]
extension [A](result: Result[A])
def mapServiceError(provider: String, message: String): Result[A]