Package org.mockserver.llm.codec
Class AzureOpenAiCodec
java.lang.Object
org.mockserver.llm.codec.AzureOpenAiCodec
- All Implemented Interfaces:
ProviderCodec
Codec for Azure OpenAI Service (API version 2024-10-21).
Azure OpenAI is wire-compatible with OpenAI Chat Completions — the response and
streaming shapes are identical. The differences are in URL paths
(/openai/deployments/{deployment}/chat/completions?api-version=...)
and authentication headers (api-key instead of Authorization: Bearer).
This codec delegates all encoding and decoding to OpenAiChatCompletionsCodec,
overriding only provider() and apiVersion().
-
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
-
AzureOpenAiCodec
public AzureOpenAiCodec()
-
-
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
-