1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-25 08:35:42 +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 =
'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(
() => [
{
@@ -243,8 +243,8 @@ export function TopicDetailAI(props: TopicDetailAIProps) {
message: testMyKnowledgePrompt,
},
{
label: 'Summarize in 2 sentences',
message: summarizePrompt,
label: 'Explain Topic',
message: explainTopicPrompt,
},
],
[],
@@ -382,14 +382,14 @@ export function TopicDetailAI(props: TopicDetailAIProps) {
const isTextMyKnowledgePrompt =
chat.role === 'user' &&
chat.content === testMyKnowledgePrompt;
const isTextSummarizePrompt =
chat.role === 'user' && chat.content === summarizePrompt;
const isTextExplainTopicPrompt =
chat.role === 'user' && chat.content === explainTopicPrompt;
let content = chat.content;
if (isTextMyKnowledgePrompt) {
content = 'Starting Interview';
} else if (isTextSummarizePrompt) {
content = 'Summarize in 2 sentences';
} else if (isTextExplainTopicPrompt) {
content = 'Explain Topic';
}
return (