Class StreamingPhysics


public class StreamingPhysics extends ObjectWithJsonToString
  • Constructor Details

    • StreamingPhysics

      public StreamingPhysics()
  • Method Details

    • streamingPhysics

      public static StreamingPhysics streamingPhysics()
    • withTimeToFirstToken

      public StreamingPhysics withTimeToFirstToken(Delay timeToFirstToken)
    • getTimeToFirstToken

      public Delay getTimeToFirstToken()
    • withTokensPerSecond

      public StreamingPhysics withTokensPerSecond(Integer tokensPerSecond)
    • getTokensPerSecond

      public Integer getTokensPerSecond()
    • withJitter

      public StreamingPhysics withJitter(Double jitter)
    • getJitter

      public Double getJitter()
    • withSeed

      public StreamingPhysics withSeed(Long seed)
    • getSeed

      public Long getSeed()
    • withSubwordStreaming

      public StreamingPhysics withSubwordStreaming(Boolean subwordStreaming)
      Controls streaming delta granularity. Subword-sized deltas (a lightweight BPE approximation, see org.mockserver.llm.TokenCounter) are now the default: leaving this unset (null) — or setting it true — emits finer, more realistic per-token deltas. Set it explicitly to false to opt back into the legacy whole-word (whitespace-boundary) splitting. The per-event timing math is unchanged — each delta is still one physics event — so subword mode simply produces more, smaller events, closer to a real provider's per-token stream (and therefore a slightly longer total stream duration for the same tokensPerSecond).
    • getSubwordStreaming

      public Boolean getSubwordStreaming()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class ObjectWithReflectiveEqualsHashCodeToString
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ObjectWithReflectiveEqualsHashCodeToString