Skip to content

Commit

Permalink
Merge pull request #575
Browse files Browse the repository at this point in the history
[BUG] Fixes text on AI Personas Creator panel
  • Loading branch information
enricoros authored Jul 7, 2024
2 parents bddd91d + 3178f4e commit 92206d9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/apps/personas/creator/Creator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ const Prompts: string[] = [
'Compare the draft character sheet with the original transcript, validating its content and ensuring it captures both the speaker’s overt characteristics and the subtler undertones. Omit unknown information, fine-tune any areas that require clarity, have been overlooked, or require more authenticity. Use clear and illustrative examples from the transcript to refine your sheet and offer meaningful, tangible reference points. Your output is a coherent, comprehensive, and nuanced instruction that begins with \'You are a...\' and serves as a go-to guide for an actor recreating the persona.',
];

const PromptTitles: string[] = [
'Common: Creator System Prompt',
'Analyze the transcript',
'Define the character',
'Cross the t\'s',
];
const PromptTitles = (selectedTab: number): string[] => {
const analyzeSubject: string = selectedTab ? 'text' : 'transcript';
return [
'Common: Creator System Prompt',
`Analyze the ${analyzeSubject}`,
'Define the character',
'Cross the t\'s',
]
};

// chain to convert a text input string (e.g. youtube transcript) into a persona prompt
function createChain(instructions: string[], titles: string[]): LLMChainStep[] {
Expand Down Expand Up @@ -101,11 +104,11 @@ export function Creator(props: { display: boolean }) {
// editable prompts
const {
strings: editedInstructions, stringEditors: instructionEditors,
} = useFormEditTextArray(Prompts, PromptTitles);
} = useFormEditTextArray(Prompts, PromptTitles(selectedTab));

const { steps: creationChainSteps, id: chainId } = React.useMemo(() => {
return {
steps: createChain(editedInstructions, PromptTitles),
steps: createChain(editedInstructions, PromptTitles(selectedTab)),
id: uuidv4(),
};
}, [editedInstructions]);
Expand Down

0 comments on commit 92206d9

Please sign in to comment.