feat: support dual protocols (OpenAI/Anthropic) for custom providers (#389)

This commit is contained in:
paisley
2026-03-10 17:35:51 +08:00
committed by GitHub
Unverified
parent 80e89ddc5c
commit 99681777a0
12 changed files with 187 additions and 44 deletions

8
test-anthropic.js Normal file
View File

@@ -0,0 +1,8 @@
const { Anthropic } = require('@anthropic-ai/sdk');
const client = new Anthropic({ apiKey: 'test', baseURL: 'https://api.minimaxi.com/anthropic' });
const req = client.buildRequest({ method: 'post', path: '/messages', body: {} });
console.log('Build Request URL 1:', req.url);
const client2 = new Anthropic({ apiKey: 'test', baseURL: 'https://api.minimaxi.com/anthropic/v1' });
const req2 = client2.buildRequest({ method: 'post', path: '/messages', body: {} });
console.log('Build Request URL 2:', req2.url);