mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-07 07:42:13 +03:00
support custom user agent for third-party providers
This commit is contained in:
@@ -31,9 +31,12 @@ export async function POST(request) {
|
||||
if (isValidationFailure(validation)) {
|
||||
return NextResponse.json({ error: validation.error }, { status: 400 });
|
||||
}
|
||||
const { provider, apiKey, validationModelId } = validation.data;
|
||||
const { provider, apiKey, validationModelId, customUserAgent } = validation.data;
|
||||
|
||||
let providerSpecificData: any = { validationModelId };
|
||||
if (customUserAgent) {
|
||||
providerSpecificData.customUserAgent = customUserAgent;
|
||||
}
|
||||
|
||||
if (isOpenAICompatibleProvider(provider) || isAnthropicCompatibleProvider(provider)) {
|
||||
const node: any = await getProviderNodeById(provider);
|
||||
|
||||
Reference in New Issue
Block a user