Skip to content

Commit

Permalink
Standardize chat and anthropic chat input order
Browse files Browse the repository at this point in the history
  • Loading branch information
abrenneke committed Aug 1, 2024
1 parent 2f38350 commit 8e66f70
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/core/src/plugins/anthropic/nodes/ChatAnthropicNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ export const ChatAnthropicNodeImpl: PluginNodeImpl<ChatAnthropicNode> = {
getInputDefinitions(data): NodeInputDefinition[] {
const inputs: NodeInputDefinition[] = [];

if (data.model.startsWith('claude-3')) {
inputs.push({
dataType: 'string',
id: 'system' as PortId,
title: 'System Prompt',
});
}

if (data.useModelInput) {
inputs.push({
id: 'model' as PortId,
Expand Down Expand Up @@ -170,13 +178,11 @@ export const ChatAnthropicNodeImpl: PluginNodeImpl<ChatAnthropicNode> = {
});
}

if (data.model.startsWith('claude-3')) {
inputs.push({
dataType: 'string',
id: 'system' as PortId,
title: 'System Prompt',
});
}
inputs.push({
dataType: ['chat-message', 'chat-message[]'] as const,
id: 'prompt' as PortId,
title: 'Prompt',
});

if (data.enableToolUse) {
inputs.push({
Expand All @@ -188,12 +194,6 @@ export const ChatAnthropicNodeImpl: PluginNodeImpl<ChatAnthropicNode> = {
});
}

inputs.push({
dataType: ['chat-message', 'chat-message[]'] as const,
id: 'prompt' as PortId,
title: 'Prompt',
});

return inputs;
},

Expand Down

0 comments on commit 8e66f70

Please sign in to comment.