1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-25 16:39:02 +02:00

fix: add explain topic

This commit is contained in:
Arik Chakma
2025-05-02 19:01:21 +06:00
parent d50e29a9fd
commit 5f4964124f

View File

@@ -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 (