SSO and Dynamic stream issues

Hi @kwaddle,

Apologies for a slightly delayed response!

Re session ID

OIDC vendors including Microsoft Entra provide /userinfo endpoint that maps the session ID hash value with (minimally) user's email. Currently, Prodigy does not provide a function to securely call this endpoint from the recipe level but you could work around it by generating this mapping elsewhere and incorporate it in the task routing logic. Alternatively, if you need it to be dynamic (the annotators often change or you often onboard new ones) you could implement the call to Entra's /userinfo directly from the recipe.
Then, once the mapping is available, inside the custom task router you could consult the current session IDs (it's the attribute of the Controller object), lookup the email to which it corresponds and match the question based on the email value. Do reach out if you need assistance implementing this kind task router (assuming the mapping can be made available).

Re dynamic stream

It's true that once the example has been sent to the server it is impossible to edit it without going back to the DB. The example must be present in browser's cache to enable "undo" logic. In Prodigy the examples are sent to the server immediately if instant_submit is set to True or once the batch of answers has been collected. In the case of batch size=1 this is equivalent to having instant_submit set to True .

In any case, you shouldn't need instant_submit or batch_size 1 to meet the requirement you describe. The pulling logic does not wait until the batch of input examples has become available. On each call to the /get_questions endpoint, the session tries to queue as many examples as possible given the task routing constraints with the batch_size being the upper (not the lower!) limit. In other words, if questions become available in the input stream, the annotators should be able to pull them upon refreshing the tab. This refresh action is important as it's an active call to the /get_questions endpoint.
If that is not what you're observing, we should probably look at how your loader is implemented.

1 Like