Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions packages/cli/src/modules/chat-hub/chat-hub.constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import type { ChatHubLLMProvider } from '@n8n/api-types';
import type { INodeTypeNameVersion } from 'n8n-workflow';

export const CONVERSATION_TITLE_GENERATION_PROMPT = `Generate a concise, descriptive title for this conversation based on the user's message.

Requirements:
Expand All @@ -7,3 +10,37 @@ Requirements:
- Only output the title, nothing else
- Use the same language as the user's message
`;

export const PROVIDER_NODE_TYPE_MAP: Record<ChatHubLLMProvider, INodeTypeNameVersion> = {
openai: {
name: '@n8n/n8n-nodes-langchain.lmChatOpenAi',
version: 1.2,
},
anthropic: {
name: '@n8n/n8n-nodes-langchain.lmChatAnthropic',
version: 1.3,
},
google: {
name: '@n8n/n8n-nodes-langchain.lmChatGoogleGemini',
version: 1.2,
},
};

export const NODE_NAMES = {
CHAT_TRIGGER: 'When chat message received',
REPLY_AGENT: 'AI Agent',
TITLE_GENERATOR_AGENT: 'Title Generator Agent',
CHAT_MODEL: 'Chat Model',
MEMORY: 'Memory',
RESTORE_CHAT_MEMORY: 'Restore Chat Memory',
CLEAR_CHAT_MEMORY: 'Clear Chat Memory',
} as const;

/* eslint-disable @typescript-eslint/naming-convention */
export const JSONL_STREAM_HEADERS = {
'Content-Type': 'application/json-lines; charset=utf-8',
'Transfer-Encoding': 'chunked',
'Cache-Control': 'no-cache',
Connection: 'keep-alive',
};
/* eslint-enable @typescript-eslint/naming-convention */
Loading
Loading