CassetteMode

org.llm4s.testkit.CassetteMode
@Experimental

How a CassetteHttpClient uses its cassette file.

  • Replay answers every request from the cassette, and never builds or calls a live client.
  • Record starts the cassette over, sends every request through the live client and writes each exchange.
  • RecordIfMissing is Record when the cassette file does not exist and Replay when it does, so a run with the cassette checked in never reaches the network.
  • RecordNew replays every request the cassette holds and records, live, every one it does not, appending it to the file: it completes a cassette a run left partial (a live call that timed out or failed). A 401, 403, 429 or 5xx answer is returned but not written, so the next run asks again. A recording whose response had a value masked (a token exchange's access_token) is not replayed: that request goes live, so the client holds a real token for the requests that follow, and the fresh exchange replaces the old one in the file. Unlike RecordIfMissing, a request the recording lacks reaches the network, so use it to record, not in CI.

Attributes

Source
CassetteHttpClient.scala
Graph
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Type members

Enum entries

case Record extends CassetteMode

Attributes

Source
CassetteHttpClient.scala

Attributes

Source
CassetteHttpClient.scala
case RecordNew extends CassetteMode

Attributes

Source
CassetteHttpClient.scala
case Replay extends CassetteMode

Attributes

Source
CassetteHttpClient.scala