WireFormatExtensions Class

Definition

Extension methods for translating between model types that share the same underlying JSON wire contract. The Azure Responses models and the OpenAI .NET SDK models are wire-compatible — OpenAI payloads are generally a subset while Azure Responses is a superset with additional item types and extensions.

Important: Only use this for types whose JSON serialization is wire-compatible. If the source and target types do not share the same JSON schema (property names, discriminators, structure), deserialization may silently produce incomplete objects or throw.

public static class WireFormatExtensions
type WireFormatExtensions = class
Public Module WireFormatExtensions
Inheritance
WireFormatExtensions

Methods

Name Description
Translate<T>(T)

Serializes model to its JSON wire format, returning an intermediate WireFormatData that can be deserialized as a different (wire-compatible) model type via To<T>().

Applies to