Skip to content

Commit 4771864

Browse files
shubhamgupta731Shubham Guptadaniel-lxs
authored
Expand Vertex AI region config to include all available regions in GCP Vertex AI (#5557)
Co-authored-by: Shubham Gupta <[email protected]> Co-authored-by: Daniel Riccio <[email protected]>
1 parent 5cfd98d commit 4771864

File tree

2 files changed

+88
-1
lines changed

2 files changed

+88
-1
lines changed

packages/types/src/providers/vertex.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,35 @@ export const vertexModels = {
277277

278278
export const VERTEX_REGIONS = [
279279
{ value: "global", label: "global" },
280-
{ value: "us-east5", label: "us-east5" },
281280
{ value: "us-central1", label: "us-central1" },
281+
{ value: "us-east1", label: "us-east1" },
282+
{ value: "us-east4", label: "us-east4" },
283+
{ value: "us-east5", label: "us-east5" },
284+
{ value: "us-west1", label: "us-west1" },
285+
{ value: "us-west2", label: "us-west2" },
286+
{ value: "us-west3", label: "us-west3" },
287+
{ value: "us-west4", label: "us-west4" },
288+
{ value: "northamerica-northeast1", label: "northamerica-northeast1" },
289+
{ value: "northamerica-northeast2", label: "northamerica-northeast2" },
290+
{ value: "southamerica-east1", label: "southamerica-east1" },
282291
{ value: "europe-west1", label: "europe-west1" },
292+
{ value: "europe-west2", label: "europe-west2" },
293+
{ value: "europe-west3", label: "europe-west3" },
283294
{ value: "europe-west4", label: "europe-west4" },
295+
{ value: "europe-west6", label: "europe-west6" },
296+
{ value: "europe-central2", label: "europe-central2" },
297+
{ value: "asia-east1", label: "asia-east1" },
298+
{ value: "asia-east2", label: "asia-east2" },
299+
{ value: "asia-northeast1", label: "asia-northeast1" },
300+
{ value: "asia-northeast2", label: "asia-northeast2" },
301+
{ value: "asia-northeast3", label: "asia-northeast3" },
302+
{ value: "asia-south1", label: "asia-south1" },
303+
{ value: "asia-south2", label: "asia-south2" },
284304
{ value: "asia-southeast1", label: "asia-southeast1" },
305+
{ value: "asia-southeast2", label: "asia-southeast2" },
306+
{ value: "australia-southeast1", label: "australia-southeast1" },
307+
{ value: "australia-southeast2", label: "australia-southeast2" },
308+
{ value: "me-west1", label: "me-west1" },
309+
{ value: "me-central1", label: "me-central1" },
310+
{ value: "africa-south1", label: "africa-south1" },
285311
]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Tests for VERTEX_REGIONS "global" region handling
2+
3+
import { describe, it, expect } from "vitest"
4+
import { VERTEX_REGIONS } from "../../../../../../packages/types/src/providers/vertex"
5+
6+
describe("VERTEX_REGIONS", () => {
7+
it('should include the "global" region as the first entry', () => {
8+
expect(VERTEX_REGIONS[0]).toEqual({ value: "global", label: "global" })
9+
})
10+
11+
it('should contain "global" region exactly once', () => {
12+
const globalRegions = VERTEX_REGIONS.filter((r: { value: string; label: string }) => r.value === "global")
13+
expect(globalRegions).toHaveLength(1)
14+
})
15+
16+
it('should contain all expected regions including "global"', () => {
17+
// The expected list is the imported VERTEX_REGIONS itself
18+
expect(VERTEX_REGIONS).toEqual([
19+
{ value: "global", label: "global" },
20+
{ value: "us-central1", label: "us-central1" },
21+
{ value: "us-east1", label: "us-east1" },
22+
{ value: "us-east4", label: "us-east4" },
23+
{ value: "us-east5", label: "us-east5" },
24+
{ value: "us-west1", label: "us-west1" },
25+
{ value: "us-west2", label: "us-west2" },
26+
{ value: "us-west3", label: "us-west3" },
27+
{ value: "us-west4", label: "us-west4" },
28+
{ value: "northamerica-northeast1", label: "northamerica-northeast1" },
29+
{ value: "northamerica-northeast2", label: "northamerica-northeast2" },
30+
{ value: "southamerica-east1", label: "southamerica-east1" },
31+
{ value: "europe-west1", label: "europe-west1" },
32+
{ value: "europe-west2", label: "europe-west2" },
33+
{ value: "europe-west3", label: "europe-west3" },
34+
{ value: "europe-west4", label: "europe-west4" },
35+
{ value: "europe-west6", label: "europe-west6" },
36+
{ value: "europe-central2", label: "europe-central2" },
37+
{ value: "asia-east1", label: "asia-east1" },
38+
{ value: "asia-east2", label: "asia-east2" },
39+
{ value: "asia-northeast1", label: "asia-northeast1" },
40+
{ value: "asia-northeast2", label: "asia-northeast2" },
41+
{ value: "asia-northeast3", label: "asia-northeast3" },
42+
{ value: "asia-south1", label: "asia-south1" },
43+
{ value: "asia-south2", label: "asia-south2" },
44+
{ value: "asia-southeast1", label: "asia-southeast1" },
45+
{ value: "asia-southeast2", label: "asia-southeast2" },
46+
{ value: "australia-southeast1", label: "australia-southeast1" },
47+
{ value: "australia-southeast2", label: "australia-southeast2" },
48+
{ value: "me-west1", label: "me-west1" },
49+
{ value: "me-central1", label: "me-central1" },
50+
{ value: "africa-south1", label: "africa-south1" },
51+
])
52+
})
53+
54+
it('should contain "asia-east1" region exactly once', () => {
55+
const asiaEast1Regions = VERTEX_REGIONS.filter(
56+
(r: { value: string; label: string }) => r.value === "asia-east1" && r.label === "asia-east1",
57+
)
58+
expect(asiaEast1Regions).toHaveLength(1)
59+
expect(asiaEast1Regions[0]).toEqual({ value: "asia-east1", label: "asia-east1" })
60+
})
61+
})

0 commit comments

Comments
 (0)