feat: Add OpenAI-compatible provider nodes
- Support multiple OpenAI-compatible providers with custom prefix/baseUrl - Add provider nodes CRUD (create/read/update/delete) - URL building: baseUrl + /chat/completions or /responses - Model import from /models endpoint - API key validation via /models - Usage type safety across all translators - OAuth token auto-refresh for expired tokens
This commit is contained in:
@@ -31,7 +31,10 @@ export async function POST(request) {
|
||||
};
|
||||
|
||||
// Build URL and headers using provider service
|
||||
const url = buildProviderUrl(provider, body.model || "test-model", true, { baseUrlIndex: 0 });
|
||||
const url = buildProviderUrl(provider, body.model || "test-model", true, {
|
||||
baseUrlIndex: 0,
|
||||
baseUrl: connection.providerSpecificData?.baseUrl
|
||||
});
|
||||
console.log("🚀 ~ POST ~ url:", url)
|
||||
const headers = buildProviderHeaders(provider, credentials, true, body);
|
||||
console.log("🚀 ~ POST ~ headers:", headers)
|
||||
|
||||
@@ -91,7 +91,10 @@ export async function POST(request) {
|
||||
};
|
||||
|
||||
// Build URL and headers
|
||||
const url = buildProviderUrl(provider, model, true, { baseUrlIndex: 0 });
|
||||
const url = buildProviderUrl(provider, model, true, {
|
||||
baseUrlIndex: 0,
|
||||
baseUrl: connection.providerSpecificData?.baseUrl
|
||||
});
|
||||
const headers = buildProviderHeaders(provider, credentials, true, actualBody);
|
||||
|
||||
result = {
|
||||
|
||||
Reference in New Issue
Block a user