XYenon asked how /v1/embeddings and /v1/audio/speech reach a plugin
whose models are all on Gemini's API. serveRetrieval sent them under
the provider's Chat base, which a plugin has only with an
@ai-sdk/openai-compatible model, so such a plugin was turned away 400
"has no OpenAI-style API". Provider.OpenAIBase is plugin://<id>/v1 for
a plugin (the Chat base for any other provider), and serveRetrieval
(embeddings, rerank, speech, transcriptions, translations) sends under
it: the request reaches the plugin's fetch OpenAI-shaped at
<base>/embeddings or /audio/speech, with the model's own id, for the
plugin to put in its vendor's shape. magpie converts none of them to
Gemini's embedContent or TTS; the plugin owns its vendor's protocol.
Key holds, account holds, masking and usage are serveRetrieval's, as
before.
Test: TestGooglePluginTakesEmbeddingsAndSpeech (fake $FAKE_GOOGLE: every
model on @ai-sdk/google, with $FAKE_KINDS' embedding and TTS): both
reach the vendor through the fetch, both are in the usage ledger, a
key held to other models gets 403 on each. Broken by hand: with the
old Base(provider.Chat) it is red (400 "has no OpenAI-style API").
Run on mote: gofmt -l clean; go vet ./internal/gateway ./internal/provider
./internal/plugin for darwin, linux (-tags nogui) and windows; go test
-count=1 -timeout 45m ./internal/gateway ./internal/plugin
./internal/provider ok at the tree of the video commit (7b8456f88), the three plugin-media commits
rebased on abd94e0b1 (gateway 504s, plugin 265s, provider 95s).
Not tried: a real Google AI Studio account through XYenon's plugin.