Skip to content

Commit c788d58

Browse files
authored
fix routing groups (#136)
1 parent cdcfc11 commit c788d58

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

gateway/src/gateway.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export async function gateway(
2323
// Backwards compatibility with the old route format.
2424
if (route === 'openai-responses' || route === 'openai-chat' || route === 'chat' || route === 'responses') {
2525
route = 'openai'
26-
} else if (route === 'gemini') {
27-
route = 'google-vertex'
28-
} else if (route === 'converse') {
29-
route = 'bedrock'
26+
} else if (route === 'google-vertex') {
27+
route = 'gemini'
28+
} else if (route === 'bedrock') {
29+
route = 'converse'
3030
}
3131

3232
const rateLimiter = options.rateLimiter ?? noopLimiter

gateway/test/gateway.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('invalid request', () => {
3333
const text = await response.text()
3434
expect(response.status, `got ${response.status} response: ${text}`).toBe(404)
3535
expect(text).toMatchInlineSnapshot(
36-
`"Route not found: wrong. Supported values: anthropic, bedrock, google-vertex, groq, openai, test"`,
36+
`"Route not found: wrong. Supported values: anthropic, bedrock, converse, gemini, google-vertex, groq, openai, test"`,
3737
)
3838
})
3939
})

gateway/test/worker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ class TestKeysDB extends KeysDbD1 {
136136
openai: [{ key: 'openai' }],
137137
groq: [{ key: 'groq' }],
138138
anthropic: [{ key: 'anthropic' }],
139-
bedrock: [{ key: 'bedrock' }],
140-
'google-vertex': [{ key: 'google-vertex' }],
139+
converse: [{ key: 'bedrock' }],
140+
gemini: [{ key: 'google-vertex' }],
141141
},
142142
otelSettings: {
143143
writeToken: 'write-token',
@@ -158,8 +158,8 @@ class TestKeysDB extends KeysDbD1 {
158158
openai: [{ key: 'openai' }],
159159
groq: [{ key: 'groq' }],
160160
anthropic: [{ key: 'anthropic' }],
161-
bedrock: [{ key: 'bedrock' }],
162-
'google-vertex': [{ key: 'google-vertex' }],
161+
converse: [{ key: 'bedrock' }],
162+
gemini: [{ key: 'google-vertex' }],
163163
},
164164
}
165165
case 'tiny-limit':

0 commit comments

Comments
 (0)