MCPcopy Create free account
hub / github.com/developersdigest/llm-answer-engine / generateFollowUpQuestions

Function generateFollowUpQuestions

express-api/index.js:139–151  ·  view source on GitHub ↗
(responseText)

Source from the content-addressed store, hash-verified

137});
138// 22. Generate follow-up questions
139async function generateFollowUpQuestions(responseText) {
140 const groqResponse = await openai.chat.completions.create({
141 model: "mixtral-8x7b-32768",
142 messages: [
143 { role: "system", content: "You are a question generator. Generate 3 follow-up questions based on the provided text. Return the questions in an array format." },
144 {
145 role: "user",
146 content: `Generate 3 follow-up questions based on the following text:\n\n${responseText}\n\nReturn the questions in the following format: ["Question 1", "Question 2", "Question 3"]`
147 }
148 ],
149 });
150 return JSON.parse(groqResponse.choices[0].message.content);
151}
152// 23. Notify when the server starts listening
153app.listen(port, () => {
154 console.log(`Server is listening on port ${port}`);

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected