fix: add explain topic

feat/topic-chat
Arik Chakma 1 week ago
parent d50e29a9fd
commit 5f4964124f
  1. 14
      src/components/TopicDetail/TopicDetailAI.tsx

@ -231,7 +231,7 @@ export function TopicDetailAI(props: TopicDetailAIProps) {
const testMyKnowledgePrompt = const testMyKnowledgePrompt =
'Act as an interviewer and test my understanding of this topic'; 'Act as an interviewer and test my understanding of this topic';
const summarizePrompt = 'Summarize this topic in no more than two sentences'; const explainTopicPrompt = 'Explain this topic in detail';
const predefinedMessages = useMemo( const predefinedMessages = useMemo(
() => [ () => [
{ {
@ -243,8 +243,8 @@ export function TopicDetailAI(props: TopicDetailAIProps) {
message: testMyKnowledgePrompt, message: testMyKnowledgePrompt,
}, },
{ {
label: 'Summarize in 2 sentences', label: 'Explain Topic',
message: summarizePrompt, message: explainTopicPrompt,
}, },
], ],
[], [],
@ -382,14 +382,14 @@ export function TopicDetailAI(props: TopicDetailAIProps) {
const isTextMyKnowledgePrompt = const isTextMyKnowledgePrompt =
chat.role === 'user' && chat.role === 'user' &&
chat.content === testMyKnowledgePrompt; chat.content === testMyKnowledgePrompt;
const isTextSummarizePrompt = const isTextExplainTopicPrompt =
chat.role === 'user' && chat.content === summarizePrompt; chat.role === 'user' && chat.content === explainTopicPrompt;
let content = chat.content; let content = chat.content;
if (isTextMyKnowledgePrompt) { if (isTextMyKnowledgePrompt) {
content = 'Starting Interview'; content = 'Starting Interview';
} else if (isTextSummarizePrompt) { } else if (isTextExplainTopicPrompt) {
content = 'Summarize in 2 sentences'; content = 'Explain Topic';
} }
return ( return (

Loading…
Cancel
Save