The documentation is about implementation details and isn't considered customer facing or binding - implementation can change at any time, provided it maintains compatibility with our published interfaces.
azopenai/azopenaiassistants
These clients are both generated. We compile the TypeSpec locally (see build.go for the exact commands), which is emitted into a Swagger file, which read using autorest.
The basics, assuming everything is working correctly, are just:
Update testdata/tsp-location.yaml to point to the proper Git commit for the TypeSpec.
Run go generate
There are some caveats that you'll need to manually write code for:
Union types typically don't generate properly. In TypeSpec, if you see things like this:
union ChatMessageContent {
string,
@added(ServiceApiVersions.v2024_02_15_Preview)
ChatMessageContentItem[],
}
Note, this is different than a standard polymorphic type, where you'll see an 'extends' relationship. For these types the 'leaf types' (like ChatMessageContentItem) will generate, but the envelope/union type (ChatMessageContent) will not generate. There are two ways to handle this:
At this time, we don't have a standard Azure SDK way of handling this pattern. In the azopenai packages we've gone with this: