Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c09872c

Browse files
committed
fix model verification
1 parent 4f0d966 commit c09872c

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/server/middleware/anthropic-proxy.middleware.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const passThroughHeaders = [
1212
export const proxyAnthropic = async (
1313
ctx: Context,
1414
body: unknown,
15-
_provider: ModelProvider,
1615
targetPath: string
1716
): Promise<Response> => {
1817
const req = ctx.req

src/server/routes/anthropic-proxy.route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { validateAPIToken } from '../middleware/validate-token.middleware'
44
import { MiddlewareHandler } from 'hono'
55
import { Env } from '../types'
66
import { proxyAnthropic } from '../middleware/anthropic-proxy.middleware'
7-
import { processRequest, chatCompletionsValidator } from './proxy.route'
7+
import { chatCompletionsValidator } from './proxy.route'
88

99
const anthropicChatCompletions: MiddlewareHandler<Env> = async c => {
10-
const { result, provider } = await processRequest(c)
11-
return proxyAnthropic(c, result, provider, '/v1/chat/completions')
10+
const result = await c.req.valid('json')
11+
return proxyAnthropic(c, result, '/v1/chat/completions')
1212
}
1313

1414
const handler = createHandler()
1515

1616
handler
1717
// ANTHROPIC PROXY FROM AZURE APIs
1818
.post(
19-
'/deployments/*/chat/completions',
19+
'/openai/deployments/*/chat/completions',
2020
zValidator('json', chatCompletionsValidator),
2121
validateAPIToken,
2222
anthropicChatCompletions

src/server/routes/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const routes = [
1717
handler: OpenAIProxyRoute,
1818
},
1919
{
20-
path: '/anthropic/openai',
20+
path: '/anthropic',
2121
handler: AnthropicProxyRoute,
2222
},
2323
]

0 commit comments

Comments
 (0)