mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(Anthropic Chat Model Node): Add configurable base URL for Anthropic API (#15063)
This commit is contained in:
@@ -266,8 +266,10 @@ export class LmChatAnthropic implements INodeType {
|
||||
};
|
||||
|
||||
async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {
|
||||
const credentials = await this.getCredentials('anthropicApi');
|
||||
|
||||
const credentials = await this.getCredentials<{ url?: string; apiKey?: string }>(
|
||||
'anthropicApi',
|
||||
);
|
||||
const baseURL = credentials.url ?? 'https://api.anthropic.com';
|
||||
const version = this.getNode().typeVersion;
|
||||
const modelName =
|
||||
version >= 1.3
|
||||
@@ -317,8 +319,9 @@ export class LmChatAnthropic implements INodeType {
|
||||
}
|
||||
|
||||
const model = new ChatAnthropic({
|
||||
anthropicApiKey: credentials.apiKey as string,
|
||||
anthropicApiKey: credentials.apiKey,
|
||||
modelName,
|
||||
anthropicApiUrl: baseURL,
|
||||
maxTokens: options.maxTokensToSample,
|
||||
temperature: options.temperature,
|
||||
topK: options.topK,
|
||||
|
||||
Reference in New Issue
Block a user