Package org.mockserver.model
Class Completion
java.lang.Object
org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
org.mockserver.model.ObjectWithJsonToString
org.mockserver.model.Completion
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletionbooleangetText()getUsage()inthashCode()withOutputSchema(String outputSchema) Optional JSON Schema (as a JSON string) that this completion'stextis expected to conform to.withStopReason(String stopReason) withStreaming(Boolean streaming) withStreamingPhysics(Object... parts) Compose streaming physics from independent values.withStreamingPhysics(StreamingPhysics streamingPhysics) withToolCall(ToolUse toolCall) withToolCalls(List<ToolUse> toolCalls) withToolCalls(ToolUse... toolCalls) Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
Completion
public Completion()
-
-
Method Details
-
completion
-
withText
-
getText
-
withToolCalls
-
withToolCalls
-
withToolCall
-
getToolCalls
-
withStopReason
-
getStopReason
-
withUsage
-
getUsage
-
withStreaming
-
streaming
-
getStreaming
-
withStreamingPhysics
-
withStreamingPhysics
Compose streaming physics from independent values. Accepts any combination ofDelay(interpreted as time-to-first-token) andStreamingPhysicsfragments (each typically carrying a single field — e.g.tokensPerSecond(50)orjitter(0.2)). Non-null fields from the fragments are merged left-to-right onto a singleStreamingPhysicsinstance which is then assigned to this completion. Calling implicitly enables streaming. -
getStreamingPhysics
-
withOutputSchema
Optional JSON Schema (as a JSON string) that this completion'stextis expected to conform to. When set, the LLM response handler validates the configured text against the schema as the response is encoded. Validation is fail-soft: a mismatch does not alter the response body — it adds anx-mockserver-structured-output-invaliddiagnostic header and logs a warning, so a deliberately non-conforming fixture still returns exactly as configured while malformed structured-output fixtures are surfaced. -
getOutputSchema
-
equals
- Overrides:
equalsin classObjectWithReflectiveEqualsHashCodeToString
-
hashCode
public int hashCode()- Overrides:
hashCodein classObjectWithReflectiveEqualsHashCodeToString
-