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:
decolua committed 2026-02-02 19:45:12 +07:00
1 parent 1b14c9d66b
commit 0a28f9f924
25 files changed
+1276 -151

No files matched your search

+4 -1
View File
@@ -32,7 +32,7 @@ export async function PUT(request, { params }) {
try {
const { id } = await params;
const body = await request.json();
const { name, priority, globalPriority, defaultModel, isActive, apiKey } = body;
const { name, priority, globalPriority, defaultModel, isActive, apiKey, testStatus, lastError, lastErrorAt } = body;
const existing = await getProviderConnectionById(id);
if (!existing) {
@@ -46,6 +46,9 @@ export async function PUT(request, { params }) {
if (defaultModel !== undefined) updateData.defaultModel = defaultModel;
if (isActive !== undefined) updateData.isActive = isActive;
if (apiKey && existing.authType === "apikey") updateData.apiKey = apiKey;
if (testStatus !== undefined) updateData.testStatus = testStatus;
if (lastError !== undefined) updateData.lastError = lastError;
if (lastErrorAt !== undefined) updateData.lastErrorAt = lastErrorAt;
const updated = await updateProviderConnection(id, updateData);