// Initialize conversation
const sessionId = generateSessionId();
const threadId = `user-${userId}-${sessionId}`;
const response = await openai.chat.completions.create({
model: "openai/gpt-4o",
messages: [{ role: "user", content: "How do I reset my password?" }],
orq: {
thread: {
id: threadId,
tags: ["support", "password-reset", `user-${userId}`],
},
},
});
// Continue conversation
const followUp = await openai.chat.completions.create({
model: "openai/gpt-4o",
messages: [
{ role: "user", content: "How do I reset my password?" },
{ role: "assistant", content: response.choices[0].message.content },
{ role: "user", content: "I didn't receive the reset email" },
],
orq: {
thread: {
id: threadId, // Same thread ID
tags: ["support", "email-issue", `user-${userId}`],
},
},
});