const API_URL = 'https://sdk.senso.ai/api/v1';
const API_KEY = 'YOUR_API_KEY';
async function createContentPrompt() {
try {
// Create a prompt for generating summaries
const summaryResponse = await fetch(`${API_URL}/prompts`, {
method: 'POST',
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Product Summary Generator',
text: 'Based on the {{content_type}} information provided, create a concise summary that highlights the key features, benefits, and important details. Focus on making it accessible to {{audience}} and ensure the tone is {{tone}}.'
})
});
const summaryPrompt = await summaryResponse.json();
console.log('Summary prompt created:', summaryPrompt.prompt_id);
// Create a prompt for FAQ generation
const faqResponse = await fetch(`${API_URL}/prompts`, {
method: 'POST',
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'FAQ Generator',
text: 'Analyze the {{content_type}} content and generate a comprehensive FAQ section. Create at least {{num_questions}} frequently asked questions with detailed answers. Ensure the questions address common concerns and the answers are clear and helpful.'
})
});
const faqPrompt = await faqResponse.json();
console.log('FAQ prompt created:', faqPrompt.prompt_id);
} catch (error) {
console.error('Error creating prompts:', error);
}
}
createContentPrompt();