Watson Workspace will no longer be available after February 28, 2019. Learn more.

Developers

Sequence of Alchemy responses

Comments

7 comments

  • Avatar
    JARED WALLACE

    I'm not sure about the order, but I can tell you how I handle annotations in my app. I only have the callback enabled for new messages. When I get a message-created event, I pause for 1 second, then make a graphQL query for that message id, pulling everything (including all annotations). I can then handle the message as needed, based on a complete picture of the message.

    If that makes sense. In practice, the second delay is not noticeable to me.

  • Avatar
    René Winkelmeyer

    Thanks, Jared. I rather prefer to rely - if _that_ makes sense ;-) - on the incoming webhook calls.

     

    On the other side I see the benefit of your approach as you'll have "stateful" information.

  • Avatar
    Miguel Estrada

    "I just want to confirm that this is a fixed order when an outbound webhook is called."

    Don't assume all annotations are done serially.

    Annotations on the message are fired as they happen.  There can be independent threads of code doing different analysis on the message and firing annotation events as they finish.  

  • Avatar
    René Winkelmeyer

    Thanks, Miguel.

    In that case the "message-annotation-created" webhook doesn't really make sense to me - and Jared's approach is the way to go.

  • Avatar
    Miguel Estrada

    Hi René,

    I think I understand the 'conundrum'.  If I am not mistaken it has to do with having annotations that in reality are part of a 'package' vs being discrete and there is no notification that says the package is 'complete'.  Is this really the root aspect here?  That is, you want to know when all cognitive analysis is done?

  • Avatar
    JARED WALLACE

    I think that would be fantastic myself. I've noticed that a 1 second delay is not always sufficient. Having a notice that all processing is complete would be ideal.

     

    Please consider this.

  • Avatar
    René Winkelmeyer

    Yes, Miguel, that's what I am looking for.

     

    I ran dozens of tests, testing the same sentence in different variations - and got different results. Sometimes entities are differently recognized, sometimes three, then four annotations are sent etc.

     

    The only reliable analysis that I could run was using some regular expressions on the text. Everything else was mix of testing and gambling. As Jared pointed out - we need to know when everything was processed. Or give us a "compound" response that contains everything.

Please sign in to leave a comment.