miurla / morphic

An AI-powered search engine with a generative UI
https://morphic.sh
Apache License 2.0
5.06k stars 1.18k forks source link

Using StreamUI #130

Closed miurla closed 2 months ago

miurla commented 2 months ago

Try to simplify the code by applying it to Researcher

https://sdk.vercel.ai/docs/reference/ai-sdk-rsc/stream-ui

Nil2000 commented 2 months ago

Hi @miurla Do you mean to use streamUI instead of streamText like this? image

miurla commented 2 months ago

Yes. When using render, the streamed text couldn't be displayed smoothly. If it's not a problem, it would be better to use streamUI.

If it's usable, since a writer has been added, we need to branch with USE_SPECIFIC_API_FOR_WRITER.

miurla commented 2 months ago

I'm working on this now.

miurla commented 2 months ago

I tried streamUI, and while it's convenient for making single tool calls, it wasn't suitable for replacing the researcher, so no replacement was made. Instead, refactoring was carried out. #148