Skip to content

Building AI agents, atomically

Refactor SchemaTransformer to set model schema title directly in model creation

KennyVaneetvelde83e6240b3f0c
diff --git a/atomic-agents/atomic_agents/lib/factories/schema_transformer.py b/atomic-agents/atomic_agents/lib/factories/schema_transformer.py
index 8b5ac3a..079342c 100644
--- a/atomic-agents/atomic_agents/lib/factories/schema_transformer.py
+++ b/atomic-agents/atomic_agents/lib/factories/schema_transformer.py
@@ -109,10 +109,8 @@ class SchemaTransformer:
model_name,
__base__=BaseIOSchema,
__doc__=docstring or f"Dynamically generated Pydantic model for {model_name}",
+ model_config={"title": tool_name_literal},
**fields,
)
- # Set model schema title to match the tool name so that openai_schema["name"] will be the tool name
- model.model_config = {"title": tool_name_literal}
-
return model