While reading through the SDK, I noticed several places in the generated code where the conditional branches for BackendVertexAI and the default fallback contain completely identical logic.
For example, in models.go (around line 4557):
if m.apiClient.ClientConfig().Backend == BackendVertexAI {
path, err = InternalFormatMap("{model}:generateContent", urlParams)
} else {
path, err = InternalFormatMap("{model}:generateContent", urlParams)
}
This exact pattern repeats across other generated API methods too.
I'd normally just open a PR to clean this up, but I noticed the file headers (// Code generated by the Google Gen AI SDK generator DO NOT EDIT.) and past PRs (like #562) which suggest the generator source lives upstream and is synced here via Copybara.
Could you folks look into updating the internal generator templates to remove these redundant branches? Or, if the generator repo is public, let me know where it is and I'd be happy to submit a PR there.
While reading through the SDK, I noticed several places in the generated code where the conditional branches for
BackendVertexAIand the default fallback contain completely identical logic.For example, in
models.go(around line 4557):This exact pattern repeats across other generated API methods too.
I'd normally just open a PR to clean this up, but I noticed the file headers (
// Code generated by the Google Gen AI SDK generator DO NOT EDIT.) and past PRs (like #562) which suggest the generator source lives upstream and is synced here via Copybara.Could you folks look into updating the internal generator templates to remove these redundant branches? Or, if the generator repo is public, let me know where it is and I'd be happy to submit a PR there.