Skip to content

Commit

Permalink
feat: update generatingPrompt for assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
a-ghorbani committed Feb 11, 2025
1 parent fd4ec5d commit 62410b6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/components/PalsSheets/SystemPromptSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@ export const SystemPromptSection = observer(
required: ['prompt'],
};

const result = await generate(
`
Generate a system prompt for an assistant scenario using the following structured details:
${getValues().generatingPrompt}
Output the system prompt in JSON format with the key "prompt" containing the full system prompt as a string.
`.trim(),
schema,
);
const generatingPrompt = [
'Generate a concise and professional system prompt for an AI assistant with the following role:',
`Topic: "${getValues().generatingPrompt}"\n`,
'The system prompt should:',
"- Be clear and direct but concise about the assistant's primary function",
'- Be written in second person ("You are...")',
'Output the system prompt in JSON format with the key "prompt".',
].join('\n');
const result = await generate(generatingPrompt, schema);
setValue('systemPrompt', result?.prompt);
setValue('originalSystemPrompt', result?.prompt);
setValue('isSystemPromptChanged', false);
Expand Down

0 comments on commit 62410b6

Please sign in to comment.