Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracking conversation #650

Closed
pashupatisah112 opened this issue Jul 22, 2024 · 1 comment
Closed

tracking conversation #650

pashupatisah112 opened this issue Jul 22, 2024 · 1 comment

Comments

@pashupatisah112
Copy link

When I copy paste below code from npm docs, conversation is tracked but not when I try to save parentMessageId and use it later. Why? Is there anything that I am missing or must know?

const api = new ChatGPTAPI({ apiKey: process.env.OPENAI_API_KEY })

// send a message and wait for the response
let res = await api.sendMessage('What is OpenAI?')
console.log(res.text)

// send a follow-up
res = await api.sendMessage('Can you expand on that?', {
parentMessageId: res.id
})
console.log(res.text)

// send another follow-up
res = await api.sendMessage('What were we talking about?', {
parentMessageId: res.id
})
console.log(res.text)

@transitive-bullshit
Copy link
Owner

The chatgpt npm package has been deprecated. For more info, please see #644 which gives recommendations for alternatives to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants