Package org.mockserver.llm.codec
Class AnthropicCodec
java.lang.Object
org.mockserver.llm.codec.AnthropicCodec
- All Implemented Interfaces:
ProviderCodec
Codec for Anthropic Messages API (version 2024-10-22).
Encodes MockServer Completion objects into Anthropic-format HTTP responses
for both non-streaming and streaming (SSE) paths.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode(HttpRequest request) encode(Completion completion, String model) encodeEmbedding(EmbeddingResponse embedding, String input) encodeStreaming(Completion completion, String model, StreamingPhysics physics) provider()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mockserver.llm.ProviderCodec
streamingFormat
-
Constructor Details
-
AnthropicCodec
public AnthropicCodec()
-
-
Method Details
-
provider
- Specified by:
providerin interfaceProviderCodec
-
apiVersion
- Specified by:
apiVersionin interfaceProviderCodec
-
encode
- Specified by:
encodein interfaceProviderCodec
-
encodeStreaming
public List<SseEvent> encodeStreaming(Completion completion, String model, StreamingPhysics physics) - Specified by:
encodeStreamingin interfaceProviderCodec
-
decode
- Specified by:
decodein interfaceProviderCodec
-
encodeEmbedding
- Specified by:
encodeEmbeddingin interfaceProviderCodec
-