[Bug] includeHighlights is not working when includeHighlights is set to true for chatStream
Is this a new bug? This seems to be a bug with the NodeJS api. I believe it is passing includeHighlights back in the Post, but it should be include_highlights.
If this is a request for help or troubleshooting code in your own Pinecone project, please join the Pinecone Community Forum.
- [ x] I believe this is a new bug
- [x ] I have searched the existing Github issues and Community Forum, and I could not find an existing post for this bug
Describe the bug If I call: const stream = await this.assistant.chatStream({ messages: [{ role: 'user', content: enhancedQuestion }], includeHighlights: true // This parameter should be supported for citation-like data });
the highlight field in each citation is always null.
Error information If you have one, please include the full stack trace here. If not, please share as much as you can about the error.
Steps to reproduce the issue locally
Stream a chat message using chatStream and set includeHighlights to true const stream = await this.assistant.chatStream({ messages: [{ role: 'user', content: enhancedQuestion }], includeHighlights: true // This parameter should be supported for citation-like data });
look at the returned citations, the highlight field is always null.
If you look at the documentation for the curl call, you need to pass include_highlights: true chatStream will error if you try to set include_highlights: true. I believe lines 38 - 48 n src/assistant/data/chatStream.js should be: const response = await fetch(chatUrl, { method: 'POST', headers: requestHeaders, body: JSON.stringify({ messages: messagesValidation(options), stream: true, model: modelValidation(options), filter: options.filter, include_highlights: options.includeHighlights, }), });
Environment
- OS and version: OSX
- Node version: Node v22.14.0
- Typescript SDK version: 5.1.1
Additional context Add any other context about the problem here.