Operations
Best practices
Keep ThinkFeel integrations clear, efficient, and secure.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Keep ThinkFeel integrations clear, efficient, and secure.
const conversation = [];
// First exchange
conversation.push({ role: 'user', content: 'What do you do for fun?' });
let response = await thinkFeel.generate({ messages: conversation });
conversation.push({ role: 'assistant', content: response.finalReply });
// Second exchange - includes full history
conversation.push({ role: 'user', content: 'That sounds cool!' });
response = await thinkFeel.generate({ messages: conversation });
function trimConversation(messages, maxMessages = 20) {
if (messages.length <= maxMessages) return messages;
return messages.slice(-maxMessages);
}
const response = await fetch(url, {
headers: {
'x-api-key': 'abc123...',
},
});
const response = await fetch(url, {
headers: {
'x-api-key': process.env.THINKFEEL_API_KEY,
},
});
Was this page helpful?
