team_designer.py in scripts#17
Conversation
|
This is really cool 🙌🎉 nice work @gkreder - will try it out on some other domains |
|
Awesome! Thank you both @jmetz and @gkreder ! Now I see you actually provide a code generation template code for the agent to create agent files! Which should already working right? The only downside of this is that we will need to "trust" the code generated and call I am thinking that maybe we can refine the part about the final implementation, instead of let it do full code generation, we only ask it to create name, profile, etc. plus their input/output in json schema, then we can store in a json file, as the team. Then we can load it back, dynamically create the team which can run. To implement this, you would need to implement dynamic pydantic model creation code, maybe take something like this: pydantic/pydantic#1638 (comment) What do you think? |
|
Dynamic pydantic model creation should be no different than standard dynamic class creation (eg using |
|
But yeah I was watching @gkreder's massively improved version of what I was messing about with yesterday, and this code templating helps massively. Did you figure out a way of getting the input -output matching working @gkreder ? If not will try and come up with some ideas for that over the next few days. |
Good question, maybe that's similar! The key idea is that to let LLM to generate json schema, then create the pydantic class, either via create_model or type. Without thinking too much, create_model should be easier to use than type. And there is a reference code there exists. Make sense? |
You shouldn't have any matching issue if you design the "HR" agent schema in a way that all the schemas are generated in a pool (i.e. a list of json schemas), then produce the agent profile, plus action which will associated with the schema in the schema pool. BTW, to create the mermaid image automatically, refer to this function. |
A team to design teams for a given purpose