Close Menu
    Facebook X (Twitter) Instagram
    Articles Stock
    • Home
    • Technology
    • AI
    • Pages
      • About ArticlesStock — AI & Technology Journalist
      • Contact us
      • Disclaimer For Articles Stock
      • Privacy Policy
      • Terms and Conditions
    Facebook X (Twitter) Instagram
    Articles Stock
    AI

    Construct a Modular Talent-Based mostly Agent System for LLMs with Dynamic Software Routing in Python

    Naveed AhmadBy Naveed Ahmad06/05/2026Updated:06/05/2026No Comments2 Mins Read
    blog 2 1


    class CalculatorSkill(Talent):
       def _define_metadata(self):
           return SkillMetadata(
               title="calculator",
               description="Consider mathematical expressions. Helps arithmetic, powers, and "
                           "math features: sqrt, abs, spherical, log, sin, cos, tan.",
               class=SkillCategory.REASONING,
               tags=["math", "arithmetic", "compute"],
               output_type="textual content", cost_estimate=0.0,
           )
    
    
       def _define_schema(self):
           return {"kind": "object",
                   "properties": {"expression": {"kind": "string",
                       "description": "A Python math expression e.g. '2**10 + sqrt(144)'"}},
                   "required": ["expression"]}
    
    
       def execute(self, expression: str) -> str:
           import math
           secure = {"__builtins__": {}, "sqrt": math.sqrt, "abs": abs, "spherical": spherical,
                   "pow": pow, "log": math.log, "pi": math.pi, "e": math.e,
                   "sin": math.sin, "cos": math.cos, "tan": math.tan}
           attempt:
               return f"Consequence: {eval(expression, secure)}"
           besides Exception as ex:
               return f"Error: {ex}"
    
    
    class TextSummarizerSkill(Talent):
       def _define_metadata(self):
           return SkillMetadata(
               title="text_summarizer",
               description="Summarize textual content at three verbosity ranges: temporary (1-2 sentences), "
                           "normal (1 paragraph), or detailed (structured bullets).",
               class=SkillCategory.GENERATION,
               tags=["summarize", "nlp", "text", "writing"],
           )
    
    
       def _define_schema(self):
           return {"kind": "object",
                   "properties": {
                       "textual content": {"kind": "string"},
                       "mode": {"kind": "string", "enum": ["brief", "standard", "detailed"],
                                "default": "normal"}},
                   "required": ["text"]}
    
    
       def execute(self, textual content: str, mode: str = "normal") -> str:
           directions = {"temporary": "in 1-2 sentences", "normal": "in a single paragraph",
                           "detailed": "as structured bullet factors masking most important concepts, key particulars, and conclusions"}
           r = consumer.chat.completions.create(
               mannequin=MODEL, max_tokens=300,
               messages=[
                   {"role": "system",  "content": f"Summarize {instructions.get(mode, instructions['standard'])}. Be concise."},
                   {"function": "person",    "content material": textual content}])
           return r.decisions[0].message.content material
    
    
    class DataAnalystSkill(Talent):
       def _define_metadata(self):
           return SkillMetadata(
               title="data_analyst",
               description="Analyse structured information (JSON or CSV) and extract statistical insights, "
                           "tendencies, or reply particular questions.",
               class=SkillCategory.DATA,
               tags=["data", "analysis", "statistics", "csv", "json"],
           )
    
    
       def _define_schema(self):
           return {"kind": "object",
                   "properties": {
                       "information":     {"kind": "string", "description": "Information as JSON array or CSV"},
                       "query": {"kind": "string", "description": "Analytical query to reply"}},
                   "required": ["data", "question"]}
    
    
       def execute(self, information: str, query: str) -> str:
           r = consumer.chat.completions.create(
               mannequin=MODEL, max_tokens=400,
               messages=[
                   {"role": "user",   "content": f"Data:n{data}nnQuestion: {question}"}])
           return r.decisions[0].message.content material
    
    
    class CodeGeneratorSkill(Talent):
       def _define_metadata(self):
           return SkillMetadata(
               title="code_generator",
               description="Generate clear, commented Python code for a given process with a quick rationalization.",
               class=SkillCategory.GENERATION,
               tags=["code", "python", "programming", "script"],
           )
    
    
       def _define_schema(self):
           return {"kind": "object",
                   "properties": {
                       "process":     {"kind": "string"},
                       "language": {"kind": "string", "default": "python"}},
                   "required": ["task"]}
    
    
       def execute(self, process: str, language: str = "python") -> str:
           r = consumer.chat.completions.create(
               mannequin=MODEL, max_tokens=500,
               messages=[
                   {"role": "system", "content": f"Expert {language} developer. Write clean, commented code with a one-line explanation."},
                   {"role": "user",   "content": task}])
           return r.decisions[0].message.content material



    Source link

    Naveed Ahmad

    Naveed Ahmad is a technology journalist and AI writer at ArticlesStock, covering artificial intelligence, machine learning, and emerging tech policy. Read his latest articles.

    Related Posts

    Closing the ‘Expressivity Hole’: How Mistral’s Voxtral TTS is Redefining Multilingual Voice Cloning with a Hybrid Autoregressive and Circulate-Matching Structure

    06/05/2026

    AI Is Serving to Safety Groups Transfer from Detection to Motion

    06/05/2026

    As crypto cools, a16z crypto raises a $2.2B fund

    06/05/2026
    Leave A Reply Cancel Reply

    Categories
    • AI
    Recent Comments
      Facebook X (Twitter) Instagram Pinterest
      © 2026 ThemeSphere. Designed by ThemeSphere.

      Type above and press Enter to search. Press Esc to cancel.