• bitcoinBitcoin(BTC)$76,822.00-1.51%
  • ethereumEthereum(ETH)$2,455.06-0.52%
  • tetherTether(USDT)$1.00-0.01%
  • binancecoinBNB(BNB)$711.13-0.98%
  • rippleXRP(XRP)$1.32-4.22%
  • usd-coinUSDC(USDC)$1.00-0.01%
  • solanaSolana(SOL)$98.89-2.51%
  • tronTRON(TRX)$0.336416-1.12%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.040.80%
  • zcashZcash(ZEC)$1,090.79-11.29%
  • HyperliquidHyperliquid(HYPE)$78.90-5.15%
  • dogecoinDogecoin(DOGE)$0.083250-2.57%
  • RainRain(RAIN)$0.015607-3.47%
  • USDSUSDS(USDS)$1.000.00%
  • moneroMonero(XMR)$507.740.05%
  • whitebitWhiteBIT Coin(WBT)$79.54-1.23%
  • chainlinkChainlink(LINK)$11.36-4.15%
  • leo-tokenLEO Token(LEO)$9.09-1.55%
  • cardanoCardano(ADA)$0.201264-5.85%
  • stellarStellar(XLM)$0.173874-3.30%
  • Ethena USDeEthena USDe(USDE)$1.000.00%
  • daiDai(DAI)$1.00-0.01%
  • bitcoin-cashBitcoin Cash(BCH)$224.38-8.66%
  • USD1USD1(USD1)$1.000.02%
  • litecoinLitecoin(LTC)$52.06-0.47%
  • CantonCanton(CC)$0.095855-6.37%
  • the-open-networkGram (prev. Toncoin)(GRAM)$1.34-2.09%
  • uniswapUniswap(UNI)$5.95-1.48%
  • Global DollarGlobal Dollar(USDG)$1.00-0.01%
  • avalanche-2Avalanche(AVAX)$7.33-5.55%
  • hedera-hashgraphHedera(HBAR)$0.073511-3.70%
  • nearNEAR Protocol(NEAR)$2.440.27%
  • shiba-inuShiba Inu(SHIB)$0.000005-2.46%
  • suiSui(SUI)$0.72-6.40%
  • paypal-usdPayPal USD(PYUSD)$1.000.00%
  • BlackRock USD Institutional Digital Liquidity FundBlackRock USD Institutional Digital Liquidity Fund(BUIDL)$1.000.00%
  • crypto-com-chainCronos(CRO)$0.056006-1.64%
  • MemeCoreMemeCore(M)$1.17-2.48%
  • tether-goldTether Gold(XAUT)$4,334.86-1.13%
  • Circle USYCCircle USYC(USYC)$1.140.01%
  • Ripple USDRipple USD(RLUSD)$1.00-0.01%
  • okbOKB(OKB)$112.210.12%
  • BittensorBittensor(TAO)$231.61-8.63%
  • Ondo US Dollar YieldOndo US Dollar Yield(USDY)$1.150.06%
  • mantleMantle(MNT)$0.58-3.05%
  • pax-goldPAX Gold(PAXG)$4,339.39-1.08%
  • aaveAave(AAVE)$121.66-1.34%
  • AsterAster(ASTER)$0.68-5.26%
  • polkadotPolkadot(DOT)$1.08-2.34%
  • OndoOndo(ONDO)$0.345061-2.75%
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

YOU MAY ALSO LIKE

Cohere Releases North Small Translate: A 218B MoE Translation Model That Scores 83.6 on WMT26 Across 50 Languages

How These XL Phones Compete

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

ShareTweetSendSharePin

Related Posts

Cohere Releases North Small Translate: A 218B MoE Translation Model That Scores 83.6 on WMT26 Across 50 Languages
AI & Technology

Cohere Releases North Small Translate: A 218B MoE Translation Model That Scores 83.6 on WMT26 Across 50 Languages

September 11, 2026
How These XL Phones Compete
AI & Technology

How These XL Phones Compete

September 10, 2026
CA Governor Signs ‘Landmark’ Laws On Youth Use Of Social Media And AI Chatbots
AI & Technology

CA Governor Signs ‘Landmark’ Laws On Youth Use Of Social Media And AI Chatbots

September 10, 2026
Meet Redis LangCache: A Managed Semantic Cache That Cuts LLM API Costs by Up to 90% and Returns Cache Hits Up to 15x Faster
AI & Technology

Meet Redis LangCache: A Managed Semantic Cache That Cuts LLM API Costs by Up to 90% and Returns Cache Hits Up to 15x Faster

September 10, 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
Playdate Season 3 Kicks Off On October 8

Playdate Season 3 Kicks Off On October 8

September 9, 2026
A Business Credit Card Separates Expenses and Earns Rewards Automatically

A Business Credit Card Separates Expenses and Earns Rewards Automatically

September 4, 2026
10 Smart Gadgets That Could Instantly Upgrade Your Backyard

10 Smart Gadgets That Could Instantly Upgrade Your Backyard

September 6, 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!