transitive-bullshit / agentic

AI agent stdlib that works with any LLM and TypeScript AI SDK.
https://agentic.so
MIT License
16.44k stars 2.14k forks source link

tracking conversation #650

Closed pashupatisah112 closed 3 months ago

pashupatisah112 commented 3 months ago

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 commented 3 months ago

The chatgpt npm package has been deprecated. For more info, please see https://github.com/transitive-bullshit/agentic/issues/644 which gives recommendations for alternatives to use.