mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 03:21:23 +00:00
Allow Claude model requests to route through Google Vertex AI (#23985)
* feat: add anthropic-vertex provider for Claude via GCP Vertex AI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * docs: add anthropic-vertex provider guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com> * Agents: validate Anthropic Vertex project env * Changelog: format update for Vertex entry * Providers: rename Anthropic Vertex to Google Vertex Claude * Providers: remove Vertex Claude provider path * Models: normalize Vercel Claude shorthand refs * Onboarding: default Vercel model to Claude shorthand * Changelog: add @vincentkoc credit for #23985 * Onboarding: keep canonical Vercel default model ref * Tests: expand Vercel model normalization coverage --------- Signed-off-by: sallyom <somalley@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
@@ -97,6 +97,31 @@ describe("model-selection", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("normalizes Vercel Claude shorthand to anthropic-prefixed model ids", () => {
|
||||
expect(parseModelRef("vercel-ai-gateway/claude-opus-4.6", "openai")).toEqual({
|
||||
provider: "vercel-ai-gateway",
|
||||
model: "anthropic/claude-opus-4.6",
|
||||
});
|
||||
expect(parseModelRef("vercel-ai-gateway/opus-4.6", "openai")).toEqual({
|
||||
provider: "vercel-ai-gateway",
|
||||
model: "anthropic/claude-opus-4-6",
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps already-prefixed Vercel Anthropic models unchanged", () => {
|
||||
expect(parseModelRef("vercel-ai-gateway/anthropic/claude-opus-4.6", "openai")).toEqual({
|
||||
provider: "vercel-ai-gateway",
|
||||
model: "anthropic/claude-opus-4.6",
|
||||
});
|
||||
});
|
||||
|
||||
it("passes through non-Claude Vercel model ids unchanged", () => {
|
||||
expect(parseModelRef("vercel-ai-gateway/openai/gpt-5.2", "openai")).toEqual({
|
||||
provider: "vercel-ai-gateway",
|
||||
model: "openai/gpt-5.2",
|
||||
});
|
||||
});
|
||||
|
||||
it("should handle invalid slash usage", () => {
|
||||
expect(parseModelRef("/", "anthropic")).toBeNull();
|
||||
expect(parseModelRef("anthropic/", "anthropic")).toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user