Make message objects have a JSON to/from
jerinphilip opened this issue · 0 comments
jerinphilip commented
There are few message objects active in bergamot-translator. To name a few that currently exist:
TranslationModel::Config
(Ptr<Options>
parsed fromstd::string
)Service::Config
(cpp struct only)ResponseOptions
(cpp struct; was offered as a WASM binding (#140) and YAML parsing (#141), both of which abandoned). Currently extension has no way of controlling this, despite being available for so long.Response
: There is no reason whyResponse
can't have a JSON representation as well. After-all it is for consumption of a platform like WebAssembly/JS Extension. Coupled with a tool likejq
, it'll be easy to develop ahead for use-cases mentioned in XapaJIaMnu/translateLocally#51 (comment). I would be a potential consumer.
In addition, having the from/to
JSON functionalities can potentially make dropping WebAssembly worker at some point in an already available extension code and instead communicating with Native-Messaging easier, should someone with interest in faster translations and more native experimentation switch to such a setting.