Embedding of Prodigy into React

Hi,
Sorry I am new to Prodigy.
Is it possible for prodigy to be embedded into my existing personal home dashboard? I like the visualizations and the usability and I would like it to be embedded into my react app for home use. But I'm not sure on how to go about doing it.
Thanks!

Hi! Prodigy is a fully standalone compiled React app already – so the easiest way to integrate it into your existing app would be to load it within an iframe, using the local URL you'll use to serve Prodigy.

You could also add some functionality to your app that lets you enter the Prodigy command and starts the Prodigy server. For instance, add a text field, post the result to your endpoint, call prodigy.serve on the server and then load the host/port in your iframe.

Thank you for replying!

May I ask as to how to create a constantly open stream, where someone might send a new text, and the program detects the stream now contains a new entry and then returns it to Prodigy UI?
I saw that the prodigy.get_stream has a ("-") option but i am not sure as how to use such that it takes in a input and sends for labelling.
Thanks!

Setting the source argument to - will read from standard input – so you can pipe the output of one process forward to Prodigy. See here for examples: https://prodi.gy/docs/api-loaders#loaders-stdin

The streams are processed as generators and if it's exhausted, you'd typically have to restart the server. However, I think you could work around that by sending a stream of None while nothing new is available, e.g. something like:

while not new_tasks:
    yield None
yield from new_tasks

That said, we typically comment starting and stopping instances as you need them instead of having one long-running session like this.