fetch('https://api.squiggle.ai/api/configure', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
apiKey: 'your-open-ai-api-key',
configuration: {
identifier: 'customConfigIdentifier',
insightFrequency: 10, // Generate insights for every 10 conversation items
customFields: [
{
name: 'userName',
description: 'The name of the current user.',
type: 'string'
},
{
name: 'requestedProduct',
description: 'The name of the product or service the user is requesting.',
type: 'string'
},
],
flagInstructions: "Flag any instances of abusive or inappropriate content from users, and identify any potential AI safety risks or concerning AI behaviors in the conversation.",
highlightInstructions: "Provide at least 3 and up to 10 key highlights (quotes or notes) that capture key aspects of the conversation. Specifically highlight any positive or negative quotes shared about the company's products or services."
}
})
})
.then(response => response.json())
.then(data => console.log('Configuration updated:', data));