Passing Speckle Viewer Through an API

Hi Speckle community,

Would it be possible to send (or does anyone have experience in sending) a Speckle viewer instance through an API that later manipulates it (such as calling functions that focus in on specific objects)? Thanks

Can you describe in general terms what you are trying to achieve? Just so I’m clear why you need to return a viewer instance from an api and in what context.

Apologies for the delay, I am working on integrating an LLM agent on the backend to control the Speckle viewer on the frontend based on commands received from a chat box.

Would it be feasible to pass the viewer instance to the backend through an API request, allowing the LLM agent to directly manipulate it via functions it can call? Or would it be better to have the agent on the backend simply parse the user’s command, then convert its output into API calls to control the viewer more effectively? Thanks