Having a widget extension return a Velocity data structure

Is there a method somewhere to allow a widget extension return a Velocity data structure? So for example in mostly-pseudocode terms,

#set ($options = $core_whatever_returns_a_dict())

For example, as the result of a web service call originated on the server side.