google-deepmind / concordia

A library for generative social simulation
Apache License 2.0
497 stars 96 forks source link

feature request: more powerful ActionSpec through `Outlines` #27

Closed robinsonkwame closed 1 month ago

robinsonkwame commented 6 months ago

I'm not sure where this would go, but currently ActionSpec outputs are limited to str type, constrained by options and call_to_action. The programmer influences or constrains agent output through call_to_action strings. However, constraining outputs through structured generation, e.g. mixed types, regex-structured generation, json following Pydantic, or even context-free grammars, can offer additional methods that would be unwieldy with call_to_action strings. For that reason, it might worth considering incorporating Outlines (here) for structured text generation ActionSpecs.

duenez commented 1 month ago

Sorry for the late reply. This should be fully supported as an extension by people creating their own game masters. Because we don't really use it ourselves, it would not be able to be tested & maintained. However here's what you would need to use it seamlessly yourself:

Create a derived class from ActionSpec that is OutlinesActionSpec. Make a GameMaster that would create requests for actions passing OutlinesActionSpec to players. Then, create an ActingComponent for the player that would handle these requests. Most of our components ignore the action spec, so having only an ActingComponent handling this would be fine.