const API_KEY = process.env.TELA_API_KEY;
// Multiple test cases
const testCases = [
{
title: "Customer Support Query - Order Status",
promptId: "prompt_uuid",
messages: [
{
role: "system",
content: "You are a helpful customer support assistant."
},
{
role: "user",
content: "My order hasn't arrived yet."
}
],
variables: {
"customer_name": "John Doe",
"order_id": "ORD-12345"
},
variablesRichContent: {},
expectedOutput: "I'll help you track down your order, John. Let me look up order ORD-12345 for you.",
metadata: {
source: "craft"
}
},
{
title: "Customer Support Query - Return Policy",
promptId: "prompt_uuid",
messages: [
{
role: "system",
content: "You are a helpful customer support assistant."
},
{
role: "user",
content: "What's your return policy?"
}
],
variables: {
"customer_name": "Jane Smith"
},
variablesRichContent: {},
expectedOutput: "Our return policy allows returns within 30 days of purchase with a receipt.",
metadata: {
source: "craft"
}
}
];
const response = await fetch('https://api.tela.ai/test-case', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(testCases)
});
const data = await response.json();
console.log(data);