• bitcoinBitcoin(BTC)$61,187.000.54%
  • ethereumEthereum(ETH)$1,713.870.69%
  • tetherTether(USDT)$1.000.00%
  • binancecoinBNB(BNB)$559.310.22%
  • usd-coinUSDC(USDC)$1.000.01%
  • rippleXRP(XRP)$0.96-0.04%
  • solanaSolana(SOL)$72.061.04%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.070.86%
  • tronTRON(TRX)$0.3040910.24%
  • HyperliquidHyperliquid(HYPE)$63.652.95%
  • zcashZcash(ZEC)$723.02-7.53%
  • dogecoinDogecoin(DOGE)$0.0572090.63%
  • moneroMonero(XMR)$466.61-10.07%
  • leo-tokenLEO Token(LEO)$9.081.37%
  • whitebitWhiteBIT Coin(WBT)$61.794.79%
  • chainlinkChainlink(LINK)$9.432.24%
  • USDSUSDS(USDS)$1.000.01%
  • cardanoCardano(ADA)$0.1505901.28%
  • Ethena USDeEthena USDe(USDE)$1.00-0.04%
  • stellarStellar(XLM)$0.128050-1.05%
  • daiDai(DAI)$1.000.00%
  • bitcoin-cashBitcoin Cash(BCH)$214.992.98%
  • nearNEAR Protocol(NEAR)$3.110.02%
  • litecoinLitecoin(LTC)$44.381.20%
  • CantonCanton(CC)$0.075125-4.52%
  • avalanche-2Avalanche(AVAX)$6.68-0.14%
  • tether-goldTether Gold(XAUT)$3,608.030.81%
  • uniswapUniswap(UNI)$4.78-0.27%
  • USD1USD1(USD1)$1.00-0.03%
  • Ripple USDRipple USD(RLUSD)$1.000.02%
  • suiSui(SUI)$0.68-0.33%
  • the-open-networkGram (prev. Toncoin)(GRAM)$0.96-0.46%
  • Global DollarGlobal Dollar(USDG)$1.000.00%
  • hedera-hashgraphHedera(HBAR)$0.0544361.81%
  • Ondo US Dollar YieldOndo US Dollar Yield(USDY)$1.150.03%
  • paypal-usdPayPal USD(PYUSD)$1.000.03%
  • quant-networkQuant(QNT)$149.952.39%
  • BittensorBittensor(TAO)$185.380.04%
  • shiba-inuShiba Inu(SHIB)$0.0000040.44%
  • Spiko Amundi Overnight Swap Fund (EUR)Spiko Amundi Overnight Swap Fund (EUR)(EURSAFO)$1.120.09%
  • Circle USYCCircle USYC(USYC)$1.150.00%
  • crypto-com-chainCronos(CRO)$0.0401130.30%
  • MemeCoreMemeCore(M)$0.84-0.33%
  • RainRain(RAIN)$0.002503-9.12%
  • okbOKB(OKB)$83.611.47%
  • Falcon USDFalcon USD(USDF)$1.000.04%
  • pax-goldPAX Gold(PAXG)$3,604.320.75%
  • United StablesUnited Stables(U)$1.000.06%
  • BlackRock USD Institutional Digital Liquidity FundBlackRock USD Institutional Digital Liquidity Fund(BUIDL)$1.000.00%
  • pepePepe(PEPE)$0.000004-0.46%
TradePoint.io
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop
No Result
View All Result
TradePoint.io
No Result
View All Result

Build a Modular Skill-Based Agent System for LLMs with Dynamic Tool Routing in Python

May 5, 2026
in AI & Technology
Reading Time: 2 mins read
A A
Build a Modular Skill-Based Agent System for LLMs with Dynamic Tool Routing in Python
ShareShareShareShareShare
class CalculatorSkill(Skill):
   def _define_metadata(self):
       return SkillMetadata(
           name="calculator",
           description="Evaluate mathematical expressions. Supports arithmetic, powers, and "
                       "math functions: sqrt, abs, round, log, sin, cos, tan.",
           category=SkillCategory.REASONING,
           tags=["math", "arithmetic", "compute"],
           output_type="text", cost_estimate=0.0,
       )


   def _define_schema(self):
       return {"type": "object",
               "properties": {"expression": {"type": "string",
                   "description": "A Python math expression e.g. '2**10 + sqrt(144)'"}},
               "required": ["expression"]}


   def execute(self, expression: str) -> str:
       import math
       safe = {"__builtins__": {}, "sqrt": math.sqrt, "abs": abs, "round": round,
               "pow": pow, "log": math.log, "pi": math.pi, "e": math.e,
               "sin": math.sin, "cos": math.cos, "tan": math.tan}
       try:
           return f"Result: {eval(expression, safe)}"
       except Exception as ex:
           return f"Error: {ex}"


class TextSummarizerSkill(Skill):
   def _define_metadata(self):
       return SkillMetadata(
           name="text_summarizer",
           description="Summarize text at three verbosity levels: brief (1-2 sentences), "
                       "standard (1 paragraph), or detailed (structured bullets).",
           category=SkillCategory.GENERATION,
           tags=["summarize", "nlp", "text", "writing"],
       )


   def _define_schema(self):
       return {"type": "object",
               "properties": {
                   "text": {"type": "string"},
                   "mode": {"type": "string", "enum": ["brief", "standard", "detailed"],
                            "default": "standard"}},
               "required": ["text"]}


   def execute(self, text: str, mode: str = "standard") -> str:
       instructions = {"brief": "in 1-2 sentences", "standard": "in one paragraph",
                       "detailed": "as structured bullet points covering main ideas, key details, and conclusions"}
       r = client.chat.completions.create(
           model=MODEL, max_tokens=300,
           messages=[
               {"role": "system",  "content": f"Summarize {instructions.get(mode, instructions['standard'])}. Be concise."},
               {"role": "user",    "content": text}])
       return r.choices[0].message.content


class DataAnalystSkill(Skill):
   def _define_metadata(self):
       return SkillMetadata(
           name="data_analyst",
           description="Analyse structured data (JSON or CSV) and extract statistical insights, "
                       "trends, or answer specific questions.",
           category=SkillCategory.DATA,
           tags=["data", "analysis", "statistics", "csv", "json"],
       )


   def _define_schema(self):
       return {"type": "object",
               "properties": {
                   "data":     {"type": "string", "description": "Data as JSON array or CSV"},
                   "question": {"type": "string", "description": "Analytical question to answer"}},
               "required": ["data", "question"]}


   def execute(self, data: str, question: str) -> str:
       r = client.chat.completions.create(
           model=MODEL, max_tokens=400,
           messages=[
               {"role": "user",   "content": f"Data:\n{data}\n\nQuestion: {question}"}])
       return r.choices[0].message.content


class CodeGeneratorSkill(Skill):
   def _define_metadata(self):
       return SkillMetadata(
           name="code_generator",
           description="Generate clean, commented Python code for a given task with a brief explanation.",
           category=SkillCategory.GENERATION,
           tags=["code", "python", "programming", "script"],
       )


   def _define_schema(self):
       return {"type": "object",
               "properties": {
                   "task":     {"type": "string"},
                   "language": {"type": "string", "default": "python"}},
               "required": ["task"]}


   def execute(self, task: str, language: str = "python") -> str:
       r = client.chat.completions.create(
           model=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.choices[0].message.content

Credit: Source link

YOU MAY ALSO LIKE

Backloggd Urges Users To Change Their Passwords After A Breach

1Password Says It Was Hacked But Users’ Vaults Are Safe

ShareTweetSendSharePin

Related Posts

Backloggd Urges Users To Change Their Passwords After A Breach
AI & Technology

Backloggd Urges Users To Change Their Passwords After A Breach

November 26, 2026
1Password Says It Was Hacked But Users’ Vaults Are Safe
AI & Technology

1Password Says It Was Hacked But Users’ Vaults Are Safe

November 26, 2026
Canada Invests 0 Million More to Expand AI Compute Access Fund – Unite.AI
AI & Technology

Canada Invests $700 Million More to Expand AI Compute Access Fund – Unite.AI

November 26, 2026
Amazon Workers Around The World Plan Strikes And Protests On Black Friday And Cyber Monday
AI & Technology

Amazon Workers Around The World Plan Strikes And Protests On Black Friday And Cyber Monday

November 26, 2026
Next Post
OpenAI’s Brockman details wild meeting with Elon Musk — ‘I thought he was going to physically attack me’

OpenAI's Brockman details wild meeting with Elon Musk — 'I thought he was going to physically attack me'

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

No Result
View All Result
Jennifer Granholm weighs in on 2028 Democratic primary

Jennifer Granholm weighs in on 2028 Democratic primary

November 26, 2026
How Do the Federal Reserve’s Decisions About Interest Rates Impact You?

How Do the Federal Reserve’s Decisions About Interest Rates Impact You?

November 20, 2026
Delta automation issues cause widespread flight delays

Delta automation issues cause widespread flight delays

November 25, 2026

About

Learn more

Our Services

Legal

Privacy Policy

Terms of Use

Bloggers

Learn more

Article Links

Contact

Advertise

Ask us anything

©2020- TradePoint.io - All rights reserved!

Tradepoint.io, being just a publishing and technology platform, is not a registered broker-dealer or investment adviser. So we do not provide investment advice. Rather, brokerage services are provided to clients of Tradepoint.io by independent SEC-registered broker-dealers and members of FINRA/SIPC. Every form of investing carries some risk and past performance is not a guarantee of future results. “Tradepoint.io“, “Instant Investing” and “My Trading Tools” are registered trademarks of Apperbuild, LLC.

This website is operated by Apperbuild, LLC. We have no link to any brokerage firm and we do not provide investment advice. Every information and resource we provide is solely for the education of our readers. © 2020 Apperbuild, LLC. All rights reserved.

No Result
View All Result
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop

© 2023 - TradePoint.io - All Rights Reserved!