#๐Ÿ”’ Backend

18 messages ยท Page 1 of 1 (latest)

undone wigeon
#

Iโ€™m using FastAPI for the backend, but Iโ€™m not sure how to display or showcase the AI-to-AI conversation on the frontend.

wise vectorBOT
#

@undone wigeon

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

left scarab
#

Is it going to be a website?

#

What are you struggling with

clear flume
undone wigeon
#

In mongo

undone wigeon
wispy dirge
#

To "push" data to the frontend live, you'll want to look into websockets. When the frontend loads, the frontend initiates a websocket connection with the backend, which has a websocket server listening for connections. Then, when a message is generated, you emit that to the socket server, which relays the message to the connected clients.

undone wigeon
#

That's good for production too like in future I will deploying in it azure or other

wispy dirge
#

Websockets are a mature technology. A large portion of the websites you use on a daily basis have websockets connections in the background.

#

I wouldn't be surprised if that's how chat is done in this DIscord client.

undone wigeon
#

Ok thanks

#

Will be looking more into it

wispy dirge
#

If you want to see websockets in action, load up a site like Stackoverflow, open the dev tools, go to the Network tab, filter for "Socket"/"WS" traffic, then restart the page. You can see all the messages sent back and forth in the background.

undone wigeon
#

Ok

wise vectorBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.