nlkitai / nlux

The 𝗣𝗼𝘄𝗲𝗿𝗳𝘂𝗹 Conversational AI JavaScript Library 💬 — UI for any LLM, supporting LangChain / HuggingFace / Vercel AI, and more 🧡 React, Next.js, and plain JavaScript ⭐️
https://docs.nlkit.com/nlux
Other
937 stars 48 forks source link

Issue with rendering back from history code blocks #57

Closed mstfash closed 3 weeks ago

mstfash commented 2 months ago

My issue is I saved history with code blocks and md blocks but they are saved as string which is understandable, now when I render inititalConversation it just give me text without highlight syntax or code blocks, pre, code html tags is there a way from nlux to handle this ?

Screenshot 2024-04-22 at 12 29 44 AM

Thanks in advance!

mstfash commented 2 months ago

Anything regarding that ?

salmenus commented 2 months ago

Hi @mstfash — Thanks for reporting this.

I have noticed the issue as well, while re-writing the React layer of NLUX.

I will fix it as part of the v2 release — expect it in a few days, mid next week.

jlev commented 2 months ago

Is it also possible to remove the typing effect when rendering the conversation history? I'd like to save that for content that is streamed back live.

salmenus commented 2 months ago

@jlev — This is in the lastest branch, right ? Or maybe in v2.0.0-alpha.1 ?

I don't think it has been published as a stable version yet.

But yes, you're right: It should not be there.

salmenus commented 2 months ago

Progress:

mstfash commented 1 month ago

Thanks for your support @salmenus

I have tried version 2.0.6-alpha there are a lot of changes regarding css and how AIChat used to work so I had to change a lot of my custom css to its like before anyways I have got this done, but the real issue here that popped up that Events are not doing anything, usually Events map for messageSent and messageReceived I usually get a callback with the message, suddenly both of them are not working.

Could you please look into this ?

Thanks again!

salmenus commented 1 month ago

hey @mstfash

All is published in 2.0.9-alpha

Doc to follow later this week.

mstfash commented 1 month ago

Hey @salmenus Thank you for your fast responses and continuous support. After installing version 2.0.9-alpha and Events layer work fine so I can save messages of user and ai just fine but. when using useLocalStorage with initialConversation it renders double messages for user and ai, they disappear though when reloading the page which is understandable. but this is not a good behavior

Screenshot 2024-05-14 at 5 12 52 PM

Thanks in advance

salmenus commented 3 weeks ago

Issues here fixed in latest v2 and later:

I'll be closing this issue unless

@mstfash @jlev if you still have issues related to history reloading, please raise a separate issue and make sure you provide a reproducible example (via CodeSandbox or similar)