ai-chatbot icon indicating copy to clipboard operation
ai-chatbot copied to clipboard

How to send tool-call by stream from fastapi to frontend web ui (next.js)?

Open angpao opened this issue 10 months ago • 4 comments

I have two frontend (AI-CHATBOT) and backend (fastapi+langraph) when send message from frontend to backend then the backend send stream text to call tool-call and also argument (json data) to give frontend show UI form then user entry data then send to backend again then backend send result to frontend on chat. How to config?

angpao avatar Feb 07 '25 01:02 angpao

Basic Examples:

https://github.com/vercel/ai/tree/main/examples/next-fastapi

https://github.com/vercel-labs/ai-sdk-preview-python-streaming

https://github.com/vercel-labs/ai-sdk-preview-python-streaming/blob/main/api/index.py

shloimy-wiesel avatar Feb 07 '25 08:02 shloimy-wiesel

I want to use the same ai-chatbot code and Backend how to config to send tool-call?

angpao avatar Feb 10 '25 03:02 angpao

Hey @angpao , were you able to get this working?

shloimy-wiesel avatar Mar 31 '25 09:03 shloimy-wiesel

Yes,I can. More question is how to connect frontend to langgraph?

angpao avatar Mar 31 '25 10:03 angpao