Add custom OpenAI- and Anthropic-compatible providers
New 'Custom OpenAI-compatible' and 'Custom Anthropic-compatible' providers let an agent run against any compatible endpoint by base URL + key: the turn posts Chat Completions (/chat/completions) or Anthropic Messages (/v1/messages) at the configured base URL. Backfilled into existing orgs by migration 037.
This commit is contained in:
1 parent
937fdfa23f
commit
6c68836455
12 files changed
+170
-4
No files matched your search
@@ -0,0 +1,12 @@
|
||||
export const customProvidersSchema = `
|
||||
insert or ignore into providers(id, org_id, provider_key, label, auth_type, model, credential_id, enabled, created_at)
|
||||
select 'prv_' || lower(hex(randomblob(16))), organizations.id, 'custom-openai', 'Custom OpenAI-compatible', 'cloud', null, null, 0, datetime('now')
|
||||
from organizations;
|
||||
|
||||
insert or ignore into providers(id, org_id, provider_key, label, auth_type, model, credential_id, enabled, created_at)
|
||||
select 'prv_' || lower(hex(randomblob(16))), organizations.id, 'custom-anthropic', 'Custom Anthropic-compatible', 'cloud', null, null, 0, datetime('now')
|
||||
from organizations;
|
||||
|
||||
insert into schema_migrations(version, name, applied_at)
|
||||
values (37, 'custom_providers', datetime('now'));
|
||||
`;
|
||||
@@ -35,6 +35,7 @@ import { auditEventImmutabilitySchema } from "./migrations/033-audit-event-immut
|
||||
import { providerAuthSessionsSchema } from "./migrations/034-provider-auth-sessions";
|
||||
import { taskRunIsolationSchema } from "./migrations/035-task-run-isolation";
|
||||
import { additionalConnectorsSchema } from "./migrations/036-additional-connectors";
|
||||
import { customProvidersSchema } from "./migrations/037-custom-providers";
|
||||
|
||||
interface Migration {
|
||||
version: number;
|
||||
@@ -79,6 +80,7 @@ const MIGRATIONS: Migration[] = [
|
||||
{ version: 34, name: "provider_auth_sessions", sql: providerAuthSessionsSchema },
|
||||
{ version: 35, name: "task_run_isolation", sql: taskRunIsolationSchema },
|
||||
{ version: 36, name: "additional_connectors", sql: additionalConnectorsSchema },
|
||||
{ version: 37, name: "custom_providers", sql: customProvidersSchema },
|
||||
];
|
||||
|
||||
const SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1].version;
|
||||
|
||||
Reference in new issue
Block a user