#stately sky react

1 messages · Page 1 of 1 (latest)

winged anvil
#

We are right now in the process to evaluate if stately sky is helpful for us.
Right now we use our machines mostly with useMachine and we often rely on passing in options like the initial input.

If I understand this correctly we should use @statelyai/sky-react and the exported useStatelyActor. The problem is there is no way to pass in options.

crude sundial
#

cc. @oblique crown

#

If there is no way, we can add that in quickly

oblique crown
#

@winged anvil you're right. When using Stately Sky in React, you should use useStatelyActor. And right now, that doesn't support passing in options from the call site. We are just about to release a code editor inside the Studio, making it much easier to define your options directly in the Studio. So hopefully, that will solve some of your needs. We're also planning out the next versions of Sky. And one of those options will allow you to run the machines on your own hardware and use Sky to coordinate events, which is probably what you're after.

winged anvil
#

So to understand this correctly. With the new Studio version, i can now adapt the machine with something like this:

context: ({
      input,
    }: {
      input: {
        conversationId: number;
      };
    }) => {
      return {
        ...input,
        feedbackText: "",
        answer: undefined,
      };
    },

And you are planning to update the sky-react package so we can pass in options when using a "sky machine"?

oblique crown
#

The new editor will allow you to define actions and invoke them directly in the editor (see sneak peek in the screenshot). We are planning to update the sky-react package to allow passing in options, but only if you run the machine on your own hardware. For machines running on Sky, we need to ensure that everyone connected will run on a machine with the same deterministic behavior. And if we allowed each consumer to provide different options, we can't guarantee the outcome will be the same for everyone. At least, I haven't been able to solve that problem in my head yet 😅

But I think/hope that you'll be able to use it for your needs. I'd be happy to learn more about your use case and try to figure out how Sky could fit into that picture.