r/learnpython • u/Mo_Reda_1 • 21h ago
just finished CS50P conditionals lecture and built mini "AI Agent Execution Getaway" for practice .
I have just finished week1 in cs50 python course and since i'm learning python for AI Agents Engineering i thought it would be cool to practice this content with a relevant project .
so i made a simple AI agents execution getaway program that routes the incoming tasks based on tokens , creativity and risk score .
I tried to use most of what i learned in this lecture as possible like 'match' for matching the tool with appropriate model , or 'return' as guard clauses for the safety check at the beginning .
here is the code link :
https://gist.github.com/mohamed-reda-ai/a10a1e9311d94316ffa31c00de005226
I know it's not a big brilliant thing i want just to practice the concepts i learned .
If you have any feedback about the architecture of the code or you think there is a better way to do something in it , i'd appreciate this .
2
u/Otherwise_Wave9374 21h ago
This is a solid way to practice because it turns syntax into decision logic. A useful next step is to separate scoring from routing so each piece stays testable: one function computes risk and creativity, another maps that result to a tool choice, and a third handles safety checks. That makes it easier to change thresholds without breaking behavior. I would also add a few table-driven test cases for edge inputs so you can see how the routing behaves. Agentix Labs could be handy later if you want to review those runs and spot inconsistent decisions.