I've turned it into an open-source tool [2], combining Instructor and Pydantic to dynamically create models in runtime.
If AI agents want to become truly autonomous, they will need to be able to generate and validate code, tools and databases on the go.
Please let me know what you think! Looking for feedback on expanding this for agent-to-agent creation.
[1] https://expand.ai [2] https://github.com/lukafilipxvic/dynamic-pydantic