From 31c92b43b4a57c0e3d5fdff9e356cbe12e8dae79 Mon Sep 17 00:00:00 2001 From: Faruk AYDIN Date: Wed, 28 Feb 2024 14:18:55 +0100 Subject: [PATCH] feat: Add optional system prompt variable to Helix app --- .../src/apps/helix/actions/new-chat/index.js | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/packages/backend/src/apps/helix/actions/new-chat/index.js b/packages/backend/src/apps/helix/actions/new-chat/index.js index c0ba74da..c430fbb0 100644 --- a/packages/backend/src/apps/helix/actions/new-chat/index.js +++ b/packages/backend/src/apps/helix/actions/new-chat/index.js @@ -5,14 +5,6 @@ export default defineAction({ key: 'newChat', description: 'Create a new chat session for Helix AI.', arguments: [ - { - label: 'Input', - key: 'input', - type: 'string', - required: true, - description: 'Prompt to start the chat with.', - variables: true, - }, { label: 'Session ID', key: 'sessionId', @@ -22,11 +14,29 @@ export default defineAction({ 'ID of the chat session to continue. Leave empty to start a new chat.', variables: true, }, + { + label: 'System Prompt', + key: 'systemPrompt', + type: 'string', + required: false, + description: + 'Optional system prompt to start the chat with. It will be used only for new chat sessions.', + variables: true, + }, + { + label: 'Input', + key: 'input', + type: 'string', + required: true, + description: 'User input to start the chat with.', + variables: true, + }, ], async run($) { const response = await $.http.post('/api/v1/sessions/chat', { session_id: $.step.parameters.sessionId, + system: $.step.parameters.systemPrompt, messages: [ { role: 'user',