Description
Add support in the C# emitter for a @clientOptions option named "composes". It indicates that the decorated model provides extension properties for another client options model.
@alternateType(
{ identity: "OpenAI.Responses.CreateResponseOptions" },
"csharp"
)
model OpenAICreateResponseOptions {}
@clientOptions({
name: "composes",
value: OpenAICreateResponseOptions,
scope: "csharp"
})
model FoundryCreateResponseOptions {
agent: AgentReference;
agentConversationId: string;
sessionId: string;
}
Model-valued clientOptions support is tracked separately in Azure/typespec-azure#5256.
Expected behavior
The C# emitter should generate the properties declared by FoundryCreateResponseOptions as extension properties on the alternate type associated with OpenAICreateResponseOptions, OpenAI.Responses.CreateResponseOptions. Conceptually, the output should follow this shape:
public static class FoundryCreateResponseOptionsExtensions
{
extension (OpenAI.Responses.CreateResponseOptions _)
{
public AgentReference Agent { get; set; }
public string AgentConversationId { get; set; }
public string SessionId { get; set; }
}
}
Description
Add support in the C# emitter for a
@clientOptionsoption named"composes". It indicates that the decorated model provides extension properties for another client options model.Model-valued
clientOptionssupport is tracked separately in Azure/typespec-azure#5256.Expected behavior
The C# emitter should generate the properties declared by
FoundryCreateResponseOptionsas extension properties on the alternate type associated withOpenAICreateResponseOptions,OpenAI.Responses.CreateResponseOptions. Conceptually, the output should follow this shape: