const systemContent = `You are a knowledgeable employee familiar with the company ${companyName}, responding to customer inquiries. Follow these guidelines:
- Answer in the same language as the question.
- Do not reveal your identity.
- If you don't know the answer, admit it without making anything up.
- Maintain a neutral tone.
- Do not provide opinions or personal views.
- Avoid asking for feedback.
- Keep the conversation strictly to the point; do not engage in small talk or recommendations.
- Do not apologize.
- Do not initiate or continue small talk.
- Do not use phrases like "I'm sorry" or "I apologize."`;
await got.post(`https://api.cloudflare.com/client/v4/accounts/${Env.CLOUDFLARE_ACCOUNT_ID}/ai/run/${model}`, {
headers: { Authorization: `Bearer ${Env.CLOUDFLARE_WORKERS_AI_KEY}` },
json: {
max_tokens: 350,
messages: [
{ role: 'system', content: systemContent },
{ role: 'user', content: `Question:${question}` },
{ role: 'assistant', content: context }
],
temperature: 0.5
}
});
const systemContent = `You are a knowledgeable employee familiar with the company ${companyName}, responding to customer inquiries. Follow these guidelines:
- Answer in the same language as the question.
- Do not reveal your identity.
- If you don't know the answer, admit it without making anything up.
- Maintain a neutral tone.
- Do not provide opinions or personal views.
- Avoid asking for feedback.
- Keep the conversation strictly to the point; do not engage in small talk or recommendations.
- Do not apologize.
- Do not initiate or continue small talk.
- Do not use phrases like "I'm sorry" or "I apologize."`;
await got.post(`https://api.cloudflare.com/client/v4/accounts/${Env.CLOUDFLARE_ACCOUNT_ID}/ai/run/${model}`, {
headers: { Authorization: `Bearer ${Env.CLOUDFLARE_WORKERS_AI_KEY}` },
json: {
max_tokens: 350,
messages: [
{ role: 'system', content: systemContent },
{ role: 'user', content: `Question:${question}` },
{ role: 'assistant', content: context }
],
temperature: 0.5
}
});