n8n
Version:
n8n Workflow Automation Tool
34 lines (33 loc) • 1.47 kB
TypeScript
import { OutboundHttp } from '@n8n/backend-network';
import type { User } from '@n8n/db';
import { CredentialsFinderService } from '../../../credentials/credentials-finder.service';
import { CredentialsService } from '../../../credentials/credentials.service';
import { AiGatewayService } from '../../../services/ai-gateway.service';
export type ModelCatalogPolicy = 'curated' | 'endpoint-only' | 'managed';
export type LiveModelLookupResult = {
status: 'success';
models: Array<{
name: string;
value: string;
}>;
policy: ModelCatalogPolicy;
} | {
status: 'unavailable';
error: unknown;
policy: ModelCatalogPolicy;
};
export declare class BuilderModelLiveLookupService {
private readonly credentialsService;
private readonly credentialsFinderService;
private readonly outboundHttp;
private readonly aiGatewayService;
constructor(credentialsService: CredentialsService, credentialsFinderService: CredentialsFinderService, outboundHttp: OutboundHttp, aiGatewayService: AiGatewayService);
list(user: User, projectId: string, credentialId: string, credentialType: string, provider: string): Promise<Array<{
name: string;
value: string;
}>>;
lookup(user: User, projectId: string, credentialId: string, credentialType: string, provider: string): Promise<LiveModelLookupResult>;
private lookupAiGatewayManagedModels;
private discoverModels;
private getOpenAiHeaders;
}