{"id":9167,"date":"2026-10-14T13:29:02","date_gmt":"2026-10-14T07:59:02","guid":{"rendered":"https:\/\/www.tisatech.in\/blog\/?p=9167"},"modified":"2026-10-14T13:29:03","modified_gmt":"2026-10-14T07:59:03","slug":"build-ai-agent-using-python","status":"publish","type":"post","link":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/","title":{"rendered":"How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)"},"content":{"rendered":"\n<p>Python is widely used to build applications, automate tasks, and work with AI models. It also gives developers the tools to build AI agents that can perform tasks by calling functions and using the results.<\/p>\n\n\n\n<p>To build a basic AI agent using Python, you can connect a language model to custom functions. For example, a calculator agent can call a Python function to solve a math problem and use the result to answer the user. <a href=\"https:\/\/developers.openai.com\/api\/docs\/guides\/function-calling\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">OpenAI&#8217;s Function Calling guide<\/a> explains how models can call functions defined in your application.<\/p>\n\n\n\n<p>In this tutorial, you&#8217;ll learn how to build an AI agent using Python and the OpenAI API. You&#8217;ll set up the project, create a calculator tool, write the agent loop, and test how it works. You&#8217;ll also learn to handle errors, limit repeated model calls, and protect your API key.<\/p>\n\n\n\n<style>\n\n\/* =========================================\n\n   WHATSAPP DEMO BANNER\n\n========================================= *\/\n \n.tisa-whatsapp-demo {\n\n    position: relative !important;\n\n    width: 100% !important;\n\n    height: 76px !important;\n\n    box-sizing: border-box !important;\n\n    background: linear-gradient(135deg, #ffffff 0%, #f5fff8 100%) !important;\n\n    border: 2px solid #25D366 !important;\n\n    border-radius: 16px !important;\n\n    margin: 28px 0 !important;\n\n    padding: 0 160px 0 94px !important;\n\n    font-family: Arial, sans-serif !important;\n\n    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.10) !important;\n\n}\n \n.tisa-whatsapp-icon {\n\n    position: absolute !important;\n\n    left: 24px !important;\n\n    top: 50% !important;\n\n    transform: translateY(-50%) !important;\n\n    width: 42px !important;\n\n    height: 42px !important;\n\n    border-radius: 50% !important;\n\n    background: #e9fff1 !important;\n\n    display: flex !important;\n\n    align-items: center !important;\n\n    justify-content: center !important;\n\n}\n \n.tisa-whatsapp-icon img {\n\n    display: block !important;\n\n    width: 24px !important;\n\n    height: 24px !important;\n\n    margin: 0 !important;\n\n    padding: 0 !important;\n\n}\n \n.tisa-whatsapp-text {\n\n    position: absolute !important;\n\n    left: 78px !important;\n\n    top: 50% !important;\n\n    transform: translateY(-50%) !important;\n\n    color: #202020 !important;\n\n    font-size: 16px !important;\n\n    line-height: 1 !important;\n\n    font-weight: 700 !important;\n\n    white-space: nowrap !important;\n\n}\n \n.tisa-whatsapp-button {\n\n    position: absolute !important;\n\n    right: 16px !important;\n\n    top: 50% !important;\n\n    transform: translateY(-50%) !important;\n\n    display: flex !important;\n\n    align-items: center !important;\n\n    justify-content: center !important;\n\n    height: 42px !important;\n\n    box-sizing: border-box !important;\n\n    padding: 0 20px !important;\n\n    margin: 0 !important;\n\n    background: #25D366 !important;\n\n    color: #ffffff !important;\n\n    border-radius: 10px !important;\n\n    text-decoration: none !important;\n\n    font-size: 13px !important;\n\n    line-height: 1 !important;\n\n    font-weight: 700 !important;\n\n    white-space: nowrap !important;\n\n    box-shadow: 0 5px 14px rgba(37, 211, 102, 0.20) !important;\n\n}\n \n \n\/* =========================================\n\n   MOBILE VIEW\n\n========================================= *\/\n \n@media (max-width: 767px) {\n \n    .tisa-whatsapp-demo {\n\n        height: 68px !important;\n\n        padding: 0 105px 0 64px !important;\n\n        border-radius: 14px !important;\n\n        margin: 22px 0 !important;\n\n    }\n \n    .tisa-whatsapp-icon {\n\n        left: 14px !important;\n\n        width: 38px !important;\n\n        height: 38px !important;\n\n    }\n \n    .tisa-whatsapp-icon img {\n\n        width: 22px !important;\n\n        height: 22px !important;\n\n    }\n \n    .tisa-whatsapp-text {\n\n        left: 62px !important;\n\n        font-size: 13px !important;\n\n        line-height: 1.2 !important;\n\n        white-space: nowrap !important;\n\n    }\n \n    .tisa-whatsapp-button {\n\n        right: 10px !important;\n\n        height: 38px !important;\n\n        padding: 0 13px !important;\n\n        border-radius: 9px !important;\n\n        font-size: 12px !important;\n\n    }\n\n}\n \n \n\/* =========================================\n\n   SMALL MOBILE\n\n========================================= *\/\n \n@media (max-width: 480px) {\n \n    .tisa-whatsapp-demo {\n\n        height: 64px !important;\n\n        padding: 0 88px 0 58px !important;\n\n        border-radius: 13px !important;\n\n    }\n \n    .tisa-whatsapp-icon {\n\n        left: 11px !important;\n\n        width: 36px !important;\n\n        height: 36px !important;\n\n    }\n \n    .tisa-whatsapp-icon img {\n\n        width: 21px !important;\n\n        height: 21px !important;\n\n    }\n \n    .tisa-whatsapp-text {\n\n        left: 55px !important;\n\n        font-size: 12px !important;\n\n    }\n \n    .tisa-whatsapp-button {\n\n        right: 8px !important;\n\n        height: 36px !important;\n\n        padding: 0 11px !important;\n\n        font-size: 11px !important;\n\n    }\n\n}\n<\/style>\n \n<div class=\"tisa-whatsapp-demo\">\n \n  <!-- WhatsApp Icon -->\n<div class=\"tisa-whatsapp-icon\">\n<img decoding=\"async\"\n\n      src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/6\/6b\/WhatsApp.svg\"\n\n      alt=\"WhatsApp\"\n\n      width=\"24\"\n\n      height=\"24\"\n>\n<\/div>\n \n  <!-- Text -->\n<div class=\"tisa-whatsapp-text\">\n\n    Book a Free Demo Class\n<\/div>\n \n  <!-- Button -->\n<a\n\n    href=\"https:\/\/wa.me\/919828080898\"\n\n    target=\"_blank\"\n\n    rel=\"noopener noreferrer nofollow\"\n\n    class=\"tisa-whatsapp-button\"\n>\n\n    Chat Now\n<\/a>\n \n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">How Does an AI Agent Work in Python?<\/h2>\n\n\n\n<p>An AI agent connects a language model to Python tools through a loop. The model decides when to use a tool, Python executes the function, and the model uses the result to answer the user or decide what to do next.<\/p>\n\n\n\n<p>For example, when a user asks for a calculation, the model can call a Python function, receive the result, and return an answer. Unlike a basic chatbot that only responds with text, an agent can also take actions through its available tools.<\/p>\n\n\n\n<p>Anthropic&#8217;s guide to building effective agents explains how models use tools and manage multi-step tasks. This tutorial applies the same basic idea using direct API calls and Python.<\/p>\n\n\n\n<p>The workflow has four main steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Receive the request: <\/strong>The agent sends the user&#8217;s question to the language model.<\/li>\n\n\n\n<li><strong>Select a tool:<\/strong> If a calculation is needed, the model requests the calculate function and provides an expression.<\/li>\n\n\n\n<li><strong>Execute the function: <\/strong>Python validates the expression, performs the calculation, and returns the result.<\/li>\n\n\n\n<li><strong>Generate the answer: <\/strong>The model uses the tool result to respond to the user or request another tool call.<\/li>\n<\/ol>\n\n\n\n<p>The model does not execute Python code directly. Your Python program decides which registered function to run and sends the result back to the model.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Libraries Are Needed to Build an AI Agent in Python?<\/h2>\n\n\n\n<p>You only need Python and the <em>openai<\/em> library to build this tutorial&#8217;s agent. Python&#8217;s built-in <em>json, ast, math<\/em>, and <em>operator<\/em> modules handle tool arguments and calculations, so you don&#8217;t need to install them separately.<\/p>\n\n\n\n<p>Install the OpenAI library with:<\/p>\n\n\n\n<style>\n  .tisatech-blog-code-card {\n    background: #FFEDD5 !important;\n    border: 1px solid #FDBA74;\n    border-radius: 12px;\n    padding: 20px 22px;\n    margin: 24px 0;\n    width: 100%;\n    box-sizing: border-box;\n  }\n\n  .tisatech-blog-code-card .tisatech-code-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n  }\n\n  .tisatech-blog-code-card .tisatech-code-label {\n    color: #9A3412 !important;\n    font-family: Arial, sans-serif;\n    font-size: 12px;\n    font-weight: 600;\n    letter-spacing: 0.8px;\n  }\n\n  .tisatech-blog-code-card .tisatech-code-copy {\n    background: #FED7AA !important;\n    color: #7C2D12 !important;\n    border: 1px solid #FDBA74 !important;\n    border-radius: 6px;\n    padding: 8px 13px;\n    font-family: Arial, sans-serif;\n    font-size: 12px;\n    font-weight: 500;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n\n  .tisatech-blog-code-card .tisatech-code-copy:hover {\n    background: #FDBA74 !important;\n  }\n\n  .tisatech-blog-code-card pre.tisatech-code-content {\n    display: block !important;\n    width: 100% !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    box-shadow: none !important;\n    color: #0F172A !important;\n    overflow-x: auto !important;\n    white-space: pre !important;\n    font-family: Consolas, Monaco, monospace !important;\n    font-size: 15px !important;\n    line-height: 1.8 !important;\n  }\n\n  .tisatech-blog-code-card .tisatech-code-content code {\n    display: inline !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    color: #0F172A !important;\n    font: inherit !important;\n  }\n\n  .tisatech-blog-code-card .tisatech-code-command {\n    color: #C2410C !important;\n    font-weight: 600;\n  }\n\n  @media (max-width: 480px) {\n    .tisatech-blog-code-card {\n      padding: 16px;\n    }\n\n    .tisatech-blog-code-card pre.tisatech-code-content {\n      font-size: 14px !important;\n    }\n  }\n<\/style>\n\n<div class=\"tisatech-blog-code-card\">\n  <div class=\"tisatech-code-header\">\n    <span class=\"tisatech-code-label\">BASH<\/span>\n\n    <button\n      type=\"button\"\n      class=\"tisatech-code-copy\"\n      onclick=\"var b=this;navigator.clipboard.writeText('pip install openai').then(function(){b.textContent='Copied!';setTimeout(function(){b.textContent='Copy Code'},1500)}).catch(function(){b.textContent='Copy failed';setTimeout(function(){b.textContent='Copy Code'},1500)})\">\n      Copy Code\n    <\/button>\n  <\/div>\n\n  <pre class=\"tisatech-code-content\"><code><span class=\"tisatech-code-command\">pip<\/span> install openai<\/code><\/pre>\n<\/div>\n\n\n\n<p>If you want to load API keys from a <em>.env<\/em> file, you can also install <em>python-dotenv<\/em>. You don&#8217;t need <em>requests<\/em> for this example because the calculator doesn&#8217;t call external web services.<\/p>\n\n\n\n<p>Set up a Python virtual environment to keep the project&#8217;s dependencies separate from other Python projects.<\/p>\n\n\n\n<a href=\"https:\/\/www.tisatech.in\/blog\/ai-agents-vs-agentic-ai\/\" class=\"tisa-ar\" target=\"_blank\"><div class=\"tisa-ar-i\"><div class=\"tisa-ar-c\"><div class=\"tisa-ar-b\"><svg class=\"tisa-ar-bi\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M19 4v16H7a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z\"\/><path d=\"M9 8h6M9 12h6\"\/><\/svg>Also Read<\/div><div class=\"tisa-ar-h\">AI Agents vs Agentic AI: What\u2019s the Difference?\n \n\n<\/div><\/div><div class=\"tisa-ar-a\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 12h14M13 6l6 6-6 6\"\/><\/svg><\/div><\/div><\/a><style>.tisa-ar{text-decoration:none;color:inherit;display:block;margin:32px 0}.tisa-ar-i{position:relative;display:flex;align-items:stretch;background:#fff;border:1px solid #ffd9c4;border-left:6px solid #E85D24;border-radius:14px;overflow:hidden;box-shadow:0 6px 20px rgba(232,93,36,.1),0 2px 6px rgba(0,0,0,.04);font-family:'Inter','Segoe UI',Arial,sans-serif;transition:all .25s ease}.tisa-ar-c{flex:1;padding:20px 22px;display:flex;flex-direction:column;justify-content:center;min-width:0}.tisa-ar-b{display:inline-flex;align-items:center;gap:6px;background:#FFF1E8;color:#C94B17;font-size:12px;font-weight:700;padding:4px 12px;border-radius:999px;width:fit-content;margin-bottom:10px;letter-spacing:.5px;text-transform:uppercase}.tisa-ar-bi{width:14px;height:14px;flex-shrink:0}.tisa-ar-h{color:#000;font-weight:600;font-size:17px;line-height:1.45;word-break:break-word}.tisa-ar-a{flex:0 0 auto;width:70px;background:#E85D24;display:flex;align-items:center;justify-content:center;color:#fff;transition:all .25s ease}.tisa-ar-a svg{width:26px;height:26px}.tisa-ar:hover .tisa-ar-i{transform:translateY(-3px);box-shadow:0 12px 28px rgba(232,93,36,.18),0 4px 10px rgba(0,0,0,.06);border-left-width:8px}.tisa-ar:hover .tisa-ar-a{background:#C94B17}.tisa-ar:hover .tisa-ar-a svg{transform:translateX(4px);transition:transform .25s ease}@media (max-width:768px){.tisa-ar{margin:24px 0}.tisa-ar-i{border-left-width:5px;border-radius:12px}.tisa-ar-c{padding:16px 18px}.tisa-ar-h{font-size:15.5px}.tisa-ar-a{width:58px}.tisa-ar-a svg{width:22px;height:22px}}@media (max-width:480px){.tisa-ar{margin:20px 0}.tisa-ar-i{border-left-width:4px;border-radius:10px;box-shadow:0 4px 14px rgba(232,93,36,.12),0 2px 4px rgba(0,0,0,.04)}.tisa-ar-c{padding:14px 14px}.tisa-ar-b{font-size:10px;padding:3px 10px;margin-bottom:8px;letter-spacing:.3px}.tisa-ar-bi{width:12px;height:12px}.tisa-ar-h{font-size:14.5px;line-height:1.4}.tisa-ar-a{width:48px}.tisa-ar-a svg{width:20px;height:20px}}@media (max-width:360px){.tisa-ar-c{padding:12px}.tisa-ar-h{font-size:14px}.tisa-ar-a{width:44px}.tisa-ar-a svg{width:18px;height:18px}}<\/style>\n\n\n\n<h2 class=\"wp-block-heading\">How Do You Build an AI Agent Step by Step?<\/h2>\n\n\n\n<p>This tutorial builds a small Python AI agent that solves math questions with a custom calculator tool. The same tool-calling pattern can support other tasks when you add suitable functions.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1: Set Up Your Project<\/h4>\n\n\n\n<p>Create a folder and a virtual environment. Then install the OpenAI library.<\/p>\n\n\n\n<style>\n  .tisatech-python-setup-card {\n    background: #FFEDD5 !important;\n    border: 1px solid #FDBA74;\n    border-radius: 12px;\n    padding: 20px 22px;\n    margin: 24px 0;\n    width: 100%;\n    box-sizing: border-box;\n  }\n\n  .tisatech-python-setup-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n  }\n\n  .tisatech-python-setup-label {\n    color: #9A3412 !important;\n    font: 600 12px Arial, sans-serif;\n    letter-spacing: 0.8px;\n  }\n\n  .tisatech-python-setup-copy {\n    background: #FED7AA !important;\n    color: #7C2D12 !important;\n    border: 1px solid #FDBA74 !important;\n    border-radius: 6px;\n    padding: 8px 13px;\n    font: 500 12px Arial, sans-serif;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n\n  .tisatech-python-setup-copy:hover {\n    background: #FDBA74 !important;\n  }\n\n  .tisatech-python-setup-code {\n    display: block !important;\n    width: 100% !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    box-shadow: none !important;\n    color: #0F172A !important;\n    overflow-x: auto !important;\n    white-space: pre !important;\n    font: 15px\/1.9 Consolas, Monaco, monospace !important;\n  }\n\n  .tisatech-python-setup-code code {\n    background: transparent !important;\n    color: #0F172A !important;\n    padding: 0 !important;\n    border: none !important;\n    font: inherit !important;\n  }\n\n  @media (max-width: 480px) {\n    .tisatech-python-setup-card {\n      padding: 16px;\n    }\n\n    .tisatech-python-setup-code {\n      font-size: 13px !important;\n    }\n  }\n<\/style>\n\n<div class=\"tisatech-python-setup-card\">\n  <div class=\"tisatech-python-setup-header\">\n    <span class=\"tisatech-python-setup-label\">TERMINAL<\/span>\n    <button\n      type=\"button\"\n      class=\"tisatech-python-setup-copy\"\n      onclick=\"var b=this;var c='mkdir python-ai-agent\\ncd python-ai-agent\\npython -m venv venv';navigator.clipboard.writeText(c).then(function(){b.textContent='Copied!';setTimeout(function(){b.textContent='Copy Code'},1500)}).catch(function(){b.textContent='Copy failed';setTimeout(function(){b.textContent='Copy Code'},1500)})\">\n      Copy Code\n    <\/button>\n  <\/div>\n\n  <pre class=\"tisatech-python-setup-code\"><code>mkdir python-ai-agent\ncd python-ai-agent\npython -m venv venv<\/code><\/pre>\n<\/div>\n\n\n\n<p>Activate the environment.<\/p>\n\n\n\n<style>\n  .tisatech-activate-env-card {\n    background: #FFEDD5 !important;\n    border: 1px solid #FDBA74;\n    border-radius: 12px;\n    padding: 20px 22px;\n    margin: 24px 0;\n    width: 100%;\n    box-sizing: border-box;\n  }\n\n  .tisatech-activate-env-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n  }\n\n  .tisatech-activate-env-label {\n    color: #9A3412 !important;\n    font: 600 12px Arial, sans-serif;\n    letter-spacing: 0.8px;\n  }\n\n  .tisatech-activate-env-copy {\n    background: #FED7AA !important;\n    color: #7C2D12 !important;\n    border: 1px solid #FDBA74 !important;\n    border-radius: 6px;\n    padding: 8px 13px;\n    font: 500 12px Arial, sans-serif;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n\n  .tisatech-activate-env-copy:hover {\n    background: #FDBA74 !important;\n  }\n\n  .tisatech-activate-env-code {\n    display: block !important;\n    width: 100% !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    box-shadow: none !important;\n    color: #0F172A !important;\n    overflow-x: auto !important;\n    white-space: pre !important;\n    font: 15px\/1.9 Consolas, Monaco, monospace !important;\n  }\n\n  .tisatech-activate-env-code code {\n    background: transparent !important;\n    color: #0F172A !important;\n    padding: 0 !important;\n    border: none !important;\n    font: inherit !important;\n  }\n\n  @media (max-width: 480px) {\n    .tisatech-activate-env-card {\n      padding: 16px;\n    }\n\n    .tisatech-activate-env-code {\n      font-size: 13px !important;\n    }\n  }\n<\/style>\n\n<div class=\"tisatech-activate-env-card\">\n  <div class=\"tisatech-activate-env-header\">\n    <span class=\"tisatech-activate-env-label\">MACOS \/ LINUX<\/span>\n    <button\n      type=\"button\"\n      class=\"tisatech-activate-env-copy\"\n      onclick=\"var b=this;navigator.clipboard.writeText('source venv\/bin\/activate').then(function(){b.textContent='Copied!';setTimeout(function(){b.textContent='Copy Code'},1500)}).catch(function(){b.textContent='Copy failed';setTimeout(function(){b.textContent='Copy Code'},1500)})\">\n      Copy Code\n    <\/button>\n  <\/div>\n\n  <pre class=\"tisatech-activate-env-code\"><code>source venv\/bin\/activate<\/code><\/pre>\n<\/div>\n\n\n\n<style>\n  .tisatech-powershell-activate-card {\n    background: #FFEDD5 !important;\n    border: 1px solid #FDBA74;\n    border-radius: 12px;\n    padding: 20px 22px;\n    margin: 24px 0;\n    width: 100%;\n    box-sizing: border-box;\n  }\n\n  .tisatech-powershell-activate-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n  }\n\n  .tisatech-powershell-activate-label {\n    color: #9A3412 !important;\n    font: 600 12px Arial, sans-serif;\n    letter-spacing: 0.8px;\n  }\n\n  .tisatech-powershell-activate-copy {\n    background: #FED7AA !important;\n    color: #7C2D12 !important;\n    border: 1px solid #FDBA74 !important;\n    border-radius: 6px;\n    padding: 8px 13px;\n    font: 500 12px Arial, sans-serif;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n\n  .tisatech-powershell-activate-copy:hover {\n    background: #FDBA74 !important;\n  }\n\n  .tisatech-powershell-activate-code {\n    display: block !important;\n    width: 100% !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    box-shadow: none !important;\n    color: #0F172A !important;\n    overflow-x: auto !important;\n    white-space: pre !important;\n    font: 15px\/1.9 Consolas, Monaco, monospace !important;\n  }\n\n  .tisatech-powershell-activate-code code {\n    background: transparent !important;\n    color: #0F172A !important;\n    padding: 0 !important;\n    border: none !important;\n    font: inherit !important;\n  }\n\n  @media (max-width: 480px) {\n    .tisatech-powershell-activate-card {\n      padding: 16px;\n    }\n\n    .tisatech-powershell-activate-code {\n      font-size: 13px !important;\n    }\n  }\n<\/style>\n\n<div class=\"tisatech-powershell-activate-card\">\n  <div class=\"tisatech-powershell-activate-header\">\n    <span class=\"tisatech-powershell-activate-label\">WINDOWS POWERSHELL<\/span>\n\n    <button\n      type=\"button\"\n      class=\"tisatech-powershell-activate-copy\"\n      onclick=\"var b=this;navigator.clipboard.writeText('.\\\\venv\\\\Scripts\\\\Activate.ps1').then(function(){b.textContent='Copied!';setTimeout(function(){b.textContent='Copy Code'},1500)}).catch(function(){b.textContent='Copy failed';setTimeout(function(){b.textContent='Copy Code'},1500)})\">\n      Copy Code\n    <\/button>\n  <\/div>\n\n  <pre class=\"tisatech-powershell-activate-code\"><code>.\\venv\\Scripts\\Activate.ps1<\/code><\/pre>\n<\/div>\n\n\n\n<p>Install the dependency: pip install openai<\/p>\n\n\n\n<p>Create two files in the project folder:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>tools.py &#8211; contains the calculator function.<\/li>\n\n\n\n<li>agent.py &#8211; connects the language model to the calculator.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Create Your Calculator Tool<\/h4>\n\n\n\n<p>A tool is a normal Python function that the model can request by name. Your program runs the function and returns its result to the model.<\/p>\n\n\n\n<p>Save the following code in <em>tools.py<\/em>.<\/p>\n\n\n\n<style>\n  .tisatech-calculator-code-card {\n    background: #FFEDD5 !important;\n    border: 1px solid #FDBA74;\n    border-radius: 12px;\n    padding: 20px 22px;\n    margin: 24px 0;\n    width: 100%;\n    box-sizing: border-box;\n  }\n\n  .tisatech-calculator-code-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    margin-bottom: 18px;\n  }\n\n  .tisatech-calculator-code-label {\n    color: #9A3412 !important;\n    font: 600 12px Arial, sans-serif;\n    letter-spacing: 0.8px;\n  }\n\n  .tisatech-calculator-code-copy {\n    background: #FED7AA !important;\n    color: #7C2D12 !important;\n    border: 1px solid #FDBA74 !important;\n    border-radius: 6px;\n    padding: 8px 13px;\n    font: 500 12px Arial, sans-serif;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n\n  .tisatech-calculator-code-copy:hover {\n    background: #FDBA74 !important;\n  }\n\n  .tisatech-calculator-code-content {\n    display: block !important;\n    width: 100% !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    box-shadow: none !important;\n    color: #0F172A !important;\n    overflow-x: auto !important;\n    white-space: pre !important;\n    tab-size: 4;\n    font: 14px\/1.8 Consolas, Monaco, monospace !important;\n  }\n\n  .tisatech-calculator-code-content code {\n    display: block !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    color: inherit !important;\n    font: inherit !important;\n    white-space: inherit !important;\n  }\n\n  @media (max-width: 480px) {\n    .tisatech-calculator-code-card {\n      padding: 16px;\n    }\n\n    .tisatech-calculator-code-content {\n      font-size: 12px !important;\n    }\n  }\n<\/style>\n\n<div class=\"tisatech-calculator-code-card\">\n  <div class=\"tisatech-calculator-code-header\">\n    <span class=\"tisatech-calculator-code-label\">PYTHON<\/span>\n    <button\n      type=\"button\"\n      class=\"tisatech-calculator-code-copy\"\n      onclick=\"var b=this;var c=b.closest('.tisatech-calculator-code-card').querySelector('pre code').innerText;navigator.clipboard.writeText(c).then(function(){b.textContent='Copied!';setTimeout(function(){b.textContent='Copy Code'},1500)}).catch(function(){b.textContent='Copy failed';setTimeout(function(){b.textContent='Copy Code'},1500)})\">\n      Copy Code\n    <\/button>\n  <\/div>\n\n  <pre class=\"tisatech-calculator-code-content\"><code>import ast\nimport math\nimport operator\n\nOPERATORS = {\n    ast.Add: operator.add,\n    ast.Sub: operator.sub,\n    ast.Mult: operator.mul,\n    ast.Div: operator.truediv,\n}\n\nMAX_EXPRESSION_LENGTH = 200\nMAX_AST_NODES = 50\nMAX_ABS_RESULT = 10**100\n\n\ndef check_number(value):\n    if type(value) not in (int, float):\n        raise ValueError(\"Only integer and decimal numbers are allowed.\")\n\n    if abs(value) > MAX_ABS_RESULT:\n        raise ValueError(\"Number exceeds the allowed limit.\")\n\n    if isinstance(value, float) and not math.isfinite(value):\n        raise ValueError(\"Non-finite numbers are not allowed.\")\n\n    return value\n\n\ndef evaluate(node):\n    if isinstance(node, ast.Constant):\n        return check_number(node.value)\n\n    if isinstance(node, ast.BinOp) and type(node.op) in OPERATORS:\n        left = evaluate(node.left)\n        right = evaluate(node.right)\n        result = OPERATORS[type(node.op)](left, right)\n        return check_number(result)\n\n    if isinstance(node, ast.UnaryOp) and isinstance(node.op, ast.USub):\n        return check_number(-evaluate(node.operand))\n\n    if (\n        isinstance(node, ast.Call)\n        and isinstance(node.func, ast.Name)\n        and node.func.id == \"sqrt\"\n        and len(node.args) == 1\n        and not node.keywords\n    ):\n        return check_number(math.sqrt(evaluate(node.args[0])))\n\n    raise ValueError(\"Unsupported expression.\")\n\n\ndef calculate(expression: str) -> str:\n    try:\n        if not isinstance(expression, str):\n            return \"Error: expression must be a string.\"\n\n        if len(expression) > MAX_EXPRESSION_LENGTH:\n            return \"Error: expression is too long.\"\n\n        tree = ast.parse(expression, mode=\"eval\")\n\n        if sum(1 for _ in ast.walk(tree)) > MAX_AST_NODES:\n            return \"Error: expression is too complex.\"\n\n        result = evaluate(tree.body)\n        return f\"Result: {result}\"\n\n    except (\n        SyntaxError,\n        ValueError,\n        TypeError,\n        ArithmeticError,\n    ) as error:\n        return f\"Error: {error}\"\n\n\nAVAILABLE_TOOLS = {\"calculate\": calculate}<\/code><\/pre>\n<\/div>\n\n\n\n<p>The calculator supports numbers, addition, subtraction, multiplication, division, unary minus, and <em>sqrt()<\/em>. It rejects unsupported operations such as exponentiation.<\/p>\n\n\n\n<p>Using Python&#8217;s <em>eval()<\/em> on model-generated expressions can execute arbitrary code. This implementation avoids <em>eval()<\/em> and parses expressions with Python&#8217;s <a href=\"https:\/\/docs.python.org\/3\/library\/ast.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Abstract Syntax Tree (AST)<\/a> module instead.<\/p>\n\n\n\n<p>The expression-length, AST-node, and numeric limits help restrict inputs. However, these checks alone don&#8217;t make an AI agent production-ready. Real applications also need suitable timeouts, resource limits, input validation, monitoring, and access controls.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: Write the Agent Loop<\/h4>\n\n\n\n<p>The agent loop connects the language model to the calculator. It sends the user&#8217;s prompt to the model, checks whether the model requests a tool, runs the function, and returns its result. The loop continues until the model provides a final answer or reaches the step limit.<\/p>\n\n\n\n<p>Save the following code in <em>agent.py<\/em>.<\/p>\n\n\n\n<style>\n  .tisatech-python-agent-card {\n    background: #FFEDD5 !important;\n    border: 1px solid #FDBA74;\n    border-radius: 12px;\n    padding: 20px 22px;\n    margin: 24px 0;\n    width: 100%;\n    box-sizing: border-box;\n  }\n\n  .tisatech-python-agent-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    margin-bottom: 18px;\n  }\n\n  .tisatech-python-agent-label {\n    color: #9A3412 !important;\n    font: 600 12px Arial, sans-serif;\n    letter-spacing: 0.8px;\n  }\n\n  .tisatech-python-agent-copy {\n    background: #FED7AA !important;\n    color: #7C2D12 !important;\n    border: 1px solid #FDBA74 !important;\n    border-radius: 6px;\n    padding: 8px 13px;\n    font: 500 12px Arial, sans-serif;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n\n  .tisatech-python-agent-copy:hover {\n    background: #FDBA74 !important;\n  }\n\n  .tisatech-python-agent-code {\n    display: block !important;\n    width: 100% !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    box-shadow: none !important;\n    color: #0F172A !important;\n    overflow-x: auto !important;\n    white-space: pre !important;\n    tab-size: 4;\n    font: 14px\/1.8 Consolas, Monaco, monospace !important;\n  }\n\n  .tisatech-python-agent-code code {\n    display: block !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    color: inherit !important;\n    font: inherit !important;\n    white-space: inherit !important;\n  }\n\n  @media (max-width: 480px) {\n    .tisatech-python-agent-card {\n      padding: 16px;\n    }\n\n    .tisatech-python-agent-code {\n      font-size: 12px !important;\n    }\n  }\n<\/style>\n\n<div class=\"tisatech-python-agent-card\">\n  <div class=\"tisatech-python-agent-header\">\n    <span class=\"tisatech-python-agent-label\">PYTHON<\/span>\n    <button\n      type=\"button\"\n      class=\"tisatech-python-agent-copy\"\n      onclick=\"var b=this;var c=b.closest('.tisatech-python-agent-card').querySelector('pre code').innerText;navigator.clipboard.writeText(c).then(function(){b.textContent='Copied!';setTimeout(function(){b.textContent='Copy Code'},1500)}).catch(function(){b.textContent='Copy failed';setTimeout(function(){b.textContent='Copy Code'},1500)})\">\n      Copy Code\n    <\/button>\n  <\/div>\n\n  <pre class=\"tisatech-python-agent-code\"><code>import json\nfrom openai import OpenAI\nfrom tools import AVAILABLE_TOOLS\n\nclient = OpenAI()\n\nMODEL = \"gpt-4o-mini\"\nMAX_STEPS = 5\n\ntools_schema = [\n    {\n        \"type\": \"function\",\n        \"function\": {\n            \"name\": \"calculate\",\n            \"description\": (\n                \"Evaluate basic arithmetic expressions using numbers, \"\n                \"+, -, *, \/, and sqrt(). \"\n                \"Do not use unsupported operators.\"\n            ),\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"expression\": {\n                        \"type\": \"string\",\n                        \"description\": (\n                            \"Expression to evaluate, \"\n                            \"such as sqrt(144) * 5\"\n                        ),\n                    }\n                },\n                \"required\": [\"expression\"],\n                \"additionalProperties\": False,\n            },\n            \"strict\": True,\n        },\n    }\n]\n\n\ndef run_agent(user_prompt):\n    messages = [\n        {\n            \"role\": \"system\",\n            \"content\": (\n                \"You are a helpful assistant. Use the calculate tool \"\n                \"for arithmetic that requires computation. Explain \"\n                \"tool errors honestly and never invent calculation results.\"\n            ),\n        },\n        {\"role\": \"user\", \"content\": user_prompt},\n    ]\n\n    for _ in range(MAX_STEPS):\n        response = client.chat.completions.create(\n            model=MODEL,\n            messages=messages,\n            tools=tools_schema,\n            tool_choice=\"auto\",\n            parallel_tool_calls=False,\n        )\n\n        message = response.choices[0].message\n\n        # Preserve the assistant message and its tool calls.\n        messages.append(message.model_dump(exclude_none=True))\n\n        if not message.tool_calls:\n            return message.content or \"The model returned no text response.\"\n\n        for call in message.tool_calls:\n            name = call.function.name\n\n            try:\n                args = json.loads(call.function.arguments)\n\n                if not isinstance(args, dict):\n                    raise ValueError(\n                        \"Tool arguments must be a JSON object.\"\n                    )\n\n                if name not in AVAILABLE_TOOLS:\n                    output = f\"Error: unknown tool '{name}'.\"\n\n                elif set(args) != {\"expression\"}:\n                    output = \"Error: invalid calculator arguments.\"\n\n                else:\n                    print(f\"Running tool {name} with {args}\")\n                    output = AVAILABLE_TOOLS[name](**args)\n\n            except (json.JSONDecodeError, TypeError, ValueError) as error:\n                output = f\"Error: invalid tool call: {error}\"\n\n            except Exception as error:\n                output = f\"Error: tool execution failed: {error}\"\n\n            # Add one result for each tool call.\n            messages.append(\n                {\n                    \"role\": \"tool\",\n                    \"tool_call_id\": call.id,\n                    \"content\": str(output),\n                }\n            )\n\n    return \"Stopped: the agent reached its step limit.\"\n\n\nif __name__ == \"__main__\":\n    try:\n        result = run_agent(\n            \"What is the square root of 144 multiplied by 5?\"\n        )\n        print(\"Agent:\", result)\n    except Exception as error:\n        print(f\"Agent failed: {error}\")<\/code><\/pre>\n<\/div>\n\n\n\n<p>The tool schema tells the model what the calculator does and which argument it requires. The <em>strict<\/em> setting requests structured arguments that follow the schema. The program also checks the tool name and arguments before executing the function.<\/p>\n\n\n\n<p>The loop preserves the assistant&#8217;s tool-call message and adds one result for each tool call. The model then receives that result and can produce an answer. <em>MAX_STEPS<\/em> limits the number of model requests made by this loop.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4: Run and Check the Output<\/h4>\n\n\n\n<p>Before running the agent, create an API key through your OpenAI account and set it as an environment variable. Keep the actual key private.<\/p>\n\n\n\n<style>\n  .tisatech-openai-key-card {\n    background: #FFEDD5 !important;\n    border: 1px solid #FDBA74;\n    border-radius: 12px;\n    padding: 20px 22px;\n    margin: 24px 0;\n    width: 100%;\n    box-sizing: border-box;\n  }\n\n  .tisatech-openai-key-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n  }\n\n  .tisatech-openai-key-label {\n    color: #9A3412 !important;\n    font: 600 12px Arial, sans-serif;\n    letter-spacing: 0.8px;\n  }\n\n  .tisatech-openai-key-copy {\n    background: #FED7AA !important;\n    color: #7C2D12 !important;\n    border: 1px solid #FDBA74 !important;\n    border-radius: 6px;\n    padding: 8px 13px;\n    font: 500 12px Arial, sans-serif;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n\n  .tisatech-openai-key-copy:hover {\n    background: #FDBA74 !important;\n  }\n\n  .tisatech-openai-key-code {\n    display: block !important;\n    width: 100% !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    box-shadow: none !important;\n    color: #0F172A !important;\n    overflow-x: auto !important;\n    white-space: pre !important;\n    font: 15px\/1.9 Consolas, Monaco, monospace !important;\n  }\n\n  .tisatech-openai-key-code code {\n    background: transparent !important;\n    color: #0F172A !important;\n    padding: 0 !important;\n    border: none !important;\n    font: inherit !important;\n  }\n\n  @media (max-width: 480px) {\n    .tisatech-openai-key-card {\n      padding: 16px;\n    }\n\n    .tisatech-openai-key-code {\n      font-size: 13px !important;\n    }\n  }\n<\/style>\n\n<div class=\"tisatech-openai-key-card\">\n  <div class=\"tisatech-openai-key-header\">\n    <span class=\"tisatech-openai-key-label\">MACOS \/ LINUX<\/span>\n    <button\n      type=\"button\"\n      class=\"tisatech-openai-key-copy\"\n      onclick=\"var b=this;var c=b.closest('.tisatech-openai-key-card').querySelector('code').textContent;navigator.clipboard.writeText(c).then(function(){b.textContent='Copied!';setTimeout(function(){b.textContent='Copy Code'},1500)}).catch(function(){b.textContent='Copy failed';setTimeout(function(){b.textContent='Copy Code'},1500)})\">\n      Copy Code\n    <\/button>\n  <\/div>\n\n  <pre class=\"tisatech-openai-key-code\"><code>export OPENAI_API_KEY=\"your-actual-api-key-here\"\npython agent.py<\/code><\/pre>\n<\/div>\n\n\n\n<style>\n  .tisatech-windows-key-card {\n    background: #FFEDD5 !important;\n    border: 1px solid #FDBA74;\n    border-radius: 12px;\n    padding: 20px 22px;\n    margin: 24px 0;\n    width: 100%;\n    box-sizing: border-box;\n  }\n\n  .tisatech-windows-key-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n  }\n\n  .tisatech-windows-key-label {\n    color: #9A3412 !important;\n    font: 600 12px Arial, sans-serif;\n    letter-spacing: 0.8px;\n  }\n\n  .tisatech-windows-key-copy {\n    background: #FED7AA !important;\n    color: #7C2D12 !important;\n    border: 1px solid #FDBA74 !important;\n    border-radius: 6px;\n    padding: 8px 13px;\n    font: 500 12px Arial, sans-serif;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n\n  .tisatech-windows-key-copy:hover {\n    background: #FDBA74 !important;\n  }\n\n  .tisatech-windows-key-code {\n    display: block !important;\n    width: 100% !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    box-shadow: none !important;\n    color: #0F172A !important;\n    overflow-x: auto !important;\n    white-space: pre !important;\n    font: 15px\/1.9 Consolas, Monaco, monospace !important;\n  }\n\n  .tisatech-windows-key-code code {\n    background: transparent !important;\n    color: #0F172A !important;\n    padding: 0 !important;\n    border: none !important;\n    font: inherit !important;\n  }\n\n  @media (max-width: 480px) {\n    .tisatech-windows-key-card {\n      padding: 16px;\n    }\n\n    .tisatech-windows-key-code {\n      font-size: 13px !important;\n    }\n  }\n<\/style>\n\n<div class=\"tisatech-windows-key-card\">\n  <div class=\"tisatech-windows-key-header\">\n    <span class=\"tisatech-windows-key-label\">WINDOWS POWERSHELL<\/span>\n    <button\n      type=\"button\"\n      class=\"tisatech-windows-key-copy\"\n      onclick=\"var b=this;var c=b.closest('.tisatech-windows-key-card').querySelector('code').textContent;navigator.clipboard.writeText(c).then(function(){b.textContent='Copied!';setTimeout(function(){b.textContent='Copy Code'},1500)}).catch(function(){b.textContent='Copy failed';setTimeout(function(){b.textContent='Copy Code'},1500)})\">\n      Copy Code\n    <\/button>\n  <\/div>\n\n  <pre class=\"tisatech-windows-key-code\"><code>$env:OPENAI_API_KEY = \"your-actual-api-key-here\"\npython agent.py<\/code><\/pre>\n<\/div>\n\n\n\n<p>The agent should request the calculator tool for the example question. Python evaluates the expression, and the model uses the result to answer.<\/p>\n\n\n\n<style>\n  .tisatech-agent-output-card {\n    background: #FFEDD5 !important;\n    border: 1px solid #FDBA74;\n    border-radius: 12px;\n    padding: 20px 22px;\n    margin: 24px 0;\n    width: 100%;\n    box-sizing: border-box;\n  }\n\n  .tisatech-agent-output-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    margin-bottom: 18px;\n  }\n\n  .tisatech-agent-output-label {\n    color: #9A3412 !important;\n    font: 600 12px Arial, sans-serif;\n    letter-spacing: 0.8px;\n  }\n\n  .tisatech-agent-output-copy {\n    background: #FED7AA !important;\n    color: #7C2D12 !important;\n    border: 1px solid #FDBA74 !important;\n    border-radius: 6px;\n    padding: 8px 13px;\n    font: 500 12px Arial, sans-serif;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n\n  .tisatech-agent-output-copy:hover {\n    background: #FDBA74 !important;\n  }\n\n  .tisatech-agent-output-code {\n    display: block !important;\n    width: 100% !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    background: transparent !important;\n    border: none !important;\n    box-shadow: none !important;\n    color: #0F172A !important;\n    overflow-x: auto !important;\n    white-space: pre !important;\n    font: 15px\/1.9 Consolas, Monaco, monospace !important;\n  }\n\n  .tisatech-agent-output-code code {\n    background: transparent !important;\n    color: #0F172A !important;\n    padding: 0 !important;\n    border: none !important;\n    font: inherit !important;\n  }\n\n  @media (max-width: 480px) {\n    .tisatech-agent-output-card {\n      padding: 16px;\n    }\n\n    .tisatech-agent-output-code {\n      font-size: 13px !important;\n    }\n  }\n<\/style>\n\n<div class=\"tisatech-agent-output-card\">\n  <div class=\"tisatech-agent-output-header\">\n    <span class=\"tisatech-agent-output-label\">EXAMPLE OUTPUT<\/span>\n    <button\n      type=\"button\"\n      class=\"tisatech-agent-output-copy\"\n      onclick=\"var b=this;var c=b.closest('.tisatech-agent-output-card').querySelector('code').textContent;navigator.clipboard.writeText(c).then(function(){b.textContent='Copied!';setTimeout(function(){b.textContent='Copy Code'},1500)}).catch(function(){b.textContent='Copy failed';setTimeout(function(){b.textContent='Copy Code'},1500)})\">\n      Copy Code\n    <\/button>\n  <\/div>\n\n  <pre class=\"tisatech-agent-output-code\"><code>Running tool calculate with {'expression': 'sqrt(144) * 5'}\nAgent: The square root of 144 multiplied by 5 is 60.<\/code><\/pre>\n<\/div>\n\n\n\n<p>The exact wording may vary, but the expected calculator result is <em>60<\/em>.<\/p>\n\n\n\n<p>If you receive an authentication error, verify that the API key is valid and available in the terminal where you&#8217;re running the program. Other API errors may require checking your model access, account limits, or network connection.<\/p>\n\n\n\n<p>The example output illustrates the expected behavior; run the project with a valid API key to verify it in your environment.<\/p>\n\n\n\n<a href=\"https:\/\/www.tisatech.in\/blog\/ai-agent-projects-for-students-and-beginners\/\" class=\"tisa-ar\" target=\"_blank\"><div class=\"tisa-ar-i\"><div class=\"tisa-ar-c\"><div class=\"tisa-ar-b\"><svg class=\"tisa-ar-bi\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M19 4v16H7a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z\"\/><path d=\"M9 8h6M9 12h6\"\/><\/svg>Also Read<\/div><div class=\"tisa-ar-h\">AI Agent Projects for Students and Beginners\n \n\n<\/div><\/div><div class=\"tisa-ar-a\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 12h14M13 6l6 6-6 6\"\/><\/svg><\/div><\/div><\/a><style>.tisa-ar{text-decoration:none;color:inherit;display:block;margin:32px 0}.tisa-ar-i{position:relative;display:flex;align-items:stretch;background:#fff;border:1px solid #ffd9c4;border-left:6px solid #E85D24;border-radius:14px;overflow:hidden;box-shadow:0 6px 20px rgba(232,93,36,.1),0 2px 6px rgba(0,0,0,.04);font-family:'Inter','Segoe UI',Arial,sans-serif;transition:all .25s ease}.tisa-ar-c{flex:1;padding:20px 22px;display:flex;flex-direction:column;justify-content:center;min-width:0}.tisa-ar-b{display:inline-flex;align-items:center;gap:6px;background:#FFF1E8;color:#C94B17;font-size:12px;font-weight:700;padding:4px 12px;border-radius:999px;width:fit-content;margin-bottom:10px;letter-spacing:.5px;text-transform:uppercase}.tisa-ar-bi{width:14px;height:14px;flex-shrink:0}.tisa-ar-h{color:#000;font-weight:600;font-size:17px;line-height:1.45;word-break:break-word}.tisa-ar-a{flex:0 0 auto;width:70px;background:#E85D24;display:flex;align-items:center;justify-content:center;color:#fff;transition:all .25s ease}.tisa-ar-a svg{width:26px;height:26px}.tisa-ar:hover .tisa-ar-i{transform:translateY(-3px);box-shadow:0 12px 28px rgba(232,93,36,.18),0 4px 10px rgba(0,0,0,.06);border-left-width:8px}.tisa-ar:hover .tisa-ar-a{background:#C94B17}.tisa-ar:hover .tisa-ar-a svg{transform:translateX(4px);transition:transform .25s ease}@media (max-width:768px){.tisa-ar{margin:24px 0}.tisa-ar-i{border-left-width:5px;border-radius:12px}.tisa-ar-c{padding:16px 18px}.tisa-ar-h{font-size:15.5px}.tisa-ar-a{width:58px}.tisa-ar-a svg{width:22px;height:22px}}@media (max-width:480px){.tisa-ar{margin:20px 0}.tisa-ar-i{border-left-width:4px;border-radius:10px;box-shadow:0 4px 14px rgba(232,93,36,.12),0 2px 4px rgba(0,0,0,.04)}.tisa-ar-c{padding:14px 14px}.tisa-ar-b{font-size:10px;padding:3px 10px;margin-bottom:8px;letter-spacing:.3px}.tisa-ar-bi{width:12px;height:12px}.tisa-ar-h{font-size:14.5px;line-height:1.4}.tisa-ar-a{width:48px}.tisa-ar-a svg{width:20px;height:20px}}@media (max-width:360px){.tisa-ar-c{padding:12px}.tisa-ar-h{font-size:14px}.tisa-ar-a{width:44px}.tisa-ar-a svg{width:18px;height:18px}}<\/style>\n\n\n\n<h2 class=\"wp-block-heading\">How Do You Test and Secure Your Python AI Agent?<\/h2>\n\n\n\n<p>Test your agent with valid calculations, unsupported expressions, and questions that don&#8217;t require a tool. Check the calculator&#8217;s output and the agent&#8217;s tool-calling behavior rather than comparing the model&#8217;s final wording exactly.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Test Your AI Agent<\/h4>\n\n\n\n<div style=\"width:100%; margin:30px 0; overflow-x:auto; box-sizing:border-box; font-family:Arial, Helvetica, sans-serif;\">\n\n  <table style=\"width:100%; min-width:680px; border-collapse:collapse; background:#FFFFFF; color:#111111; font-size:16px; line-height:1.45; border:1px solid #E5E5E5;\">\n\n    <thead>\n      <tr style=\"background:#FF4500; color:#FFFFFF;\">\n        <th style=\"padding:18px 14px; text-align:center; font-size:19px; font-weight:700; border:1px solid #E5A18B;\">Test case<\/th>\n        <th style=\"padding:18px 14px; text-align:center; font-size:19px; font-weight:700; border:1px solid #E5A18B;\">Example input<\/th>\n        <th style=\"padding:18px 14px; text-align:center; font-size:19px; font-weight:700; border:1px solid #E5A18B;\">Expected behavior<\/th>\n      <\/tr>\n    <\/thead>\n\n    <tbody>\n      <tr>\n        <td style=\"padding:16px 14px; text-align:center; font-weight:700; border:1px solid #E5E5E5;\">Basic calculation<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">What is 12 multiplied by 5?<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">Calculator returns 60.<\/td>\n      <\/tr>\n\n      <tr>\n        <td style=\"padding:16px 14px; text-align:center; font-weight:700; border:1px solid #E5E5E5;\">Square root<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">What is the square root of 144?<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">Calculator returns 12.<\/td>\n      <\/tr>\n\n      <tr>\n        <td style=\"padding:16px 14px; text-align:center; font-weight:700; border:1px solid #E5E5E5;\">No tool needed<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">What is an AI agent?<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">Model answers without calling the calculator.<\/td>\n      <\/tr>\n\n      <tr>\n        <td style=\"padding:16px 14px; text-align:center; font-weight:700; border:1px solid #E5E5E5;\">Division by zero<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">Calculate 10 \/ 0.<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">The calculator returns an error, which the model can explain.<\/td>\n      <\/tr>\n\n      <tr>\n        <td style=\"padding:16px 14px; text-align:center; font-weight:700; border:1px solid #E5E5E5;\">Unsupported expression<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">Calculate 2 ** 10.<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">Calculator rejects the unsupported operator.<\/td>\n      <\/tr>\n\n      <tr>\n        <td style=\"padding:16px 14px; text-align:center; font-weight:700; border:1px solid #E5E5E5;\">Invalid API key<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">Run the agent with an invalid key.<\/td>\n        <td style=\"padding:16px 14px; text-align:center; border:1px solid #E5E5E5;\">API request fails with an authentication error.<\/td>\n      <\/tr>\n    <\/tbody>\n\n  <\/table>\n<\/div>\n\n\n\n<p>If a test fails, inspect the tool arguments, return result, and API error before changing the code. The agent can pass calculator errors back to the model, but successful recovery is not guaranteed.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Protect Your Python AI Agent<\/h4>\n\n\n\n<p>Use these practices to improve reliability and protect your application:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Validate tool inputs:<\/strong> Accept only the arguments your function needs and reject unsupported operations.<\/li>\n\n\n\n<li><strong>Limit model calls:<\/strong> Keep <em>MAX_STEPS<\/em> to control repeated requests and unexpected API usage.<\/li>\n\n\n\n<li><strong>Protect your API key:<\/strong> Store it in an environment variable instead of hardcoding it in your source code.<\/li>\n\n\n\n<li><strong>Keep secrets out of Git:<\/strong> If you use a <em>.env<\/em> file, add it to <em>.gitignore<\/em> before committing your project.<\/li>\n\n\n\n<li><strong>Handle API failures:<\/strong> Distinguish authentication errors, rate limits, timeouts, and connection failures so you can troubleshoot them separately.<\/li>\n\n\n\n<li><strong>Restrict tool permissions:<\/strong> Give each tool access only to the data and actions it needs.<\/li>\n\n\n\n<li><strong>Set resource limits:<\/strong> Restrict input sizes and execution time, especially when tools process untrusted inputs.<\/li>\n<\/ul>\n\n\n\n<p>If you expose an API key, revoke it and create a replacement. Follow <a href=\"https:\/\/platform.openai.com\/docs\/guides\/production-best-practices\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">OpenAI&#8217;s production best practices<\/a> for API key safety and application security.<\/p>\n\n\n\n<p>Also, check the <a href=\"https:\/\/platform.openai.com\/docs\/models\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">OpenAI models documentation<\/a> to confirm that your chosen model is available to your account and supports the features your agent needs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Can You Build an AI Agent in Python Without LangChain?<\/h2>\n\n\n\n<p>Yes. You can build an AI agent using plain Python and the <em>openai<\/em> library, as this example demonstrates.<\/p>\n\n\n\n<p>Starting without a framework helps you understand how the agent calls tools, processes results, and decides what to do next. You can inspect API requests and tool responses directly, which makes debugging easier and builds the <a href=\"https:\/\/www.tisatech.in\/blog\/skills-required-ai-agent-developer-2026\/\" target=\"_blank\" rel=\"noreferrer noopener\">skills required to become an AI agent developer<\/a>.<\/p>\n\n\n\n<p>As your project grows, frameworks such as LangChain can help organize multiple tools, retrieval, and more complex workflows. However, a framework doesn&#8217;t automatically make an agent more accurate or secure. For a first project, plain Python is a practical starting point.<\/p>\n\n\n\n<style>\n\n\/* =========================================\n\n   SOCIAL FOLLOW BANNER\n\n========================================= *\/\n \n.tisa-social-follow {\n\n    width: 100% !important;\n\n    border: 0 !important;\n\n    border-collapse: separate !important;\n\n    border-spacing: 0 !important;\n\n    background: #ffffff !important;\n\n    border-radius: 12px !important;\n\n    margin: 24px 0 !important;\n\n    overflow: hidden !important;\n\n}\n \n.tisa-social-follow-row {\n\n    border: 0 !important;\n\n}\n \n.tisa-social-follow-title {\n\n    width: auto !important;\n\n    padding: 17px 24px !important;\n\n    border: 0 !important;\n\n    background: #ffffff !important;\n\n    text-align: left !important;\n\n    vertical-align: middle !important;\n\n    font-family: Arial, sans-serif !important;\n\n    font-size: 16px !important;\n\n    font-weight: 700 !important;\n\n    color: #111111 !important;\n\n    white-space: nowrap !important;\n\n}\n \n.tisa-social-follow-icons {\n\n    width: 220px !important;\n\n    padding: 12px 24px 12px 10px !important;\n\n    border: 0 !important;\n\n    background: #ffffff !important;\n\n    text-align: right !important;\n\n    vertical-align: middle !important;\n\n    white-space: nowrap !important;\n\n}\n \n.tisa-social-follow-link {\n\n    margin: 0 7px !important;\n\n    padding: 0 !important;\n\n    text-decoration: none !important;\n\n    vertical-align: middle !important;\n\n}\n \n.tisa-social-follow-link-last {\n\n    margin: 0 0 0 7px !important;\n\n}\n \n.tisa-social-follow-icon {\n\n    width: 30px !important;\n\n    height: 30px !important;\n\n    max-width: 30px !important;\n\n    margin: 0 !important;\n\n    padding: 0 !important;\n\n    vertical-align: middle !important;\n\n}\n \n.tisa-social-follow-youtube {\n\n    width: 40px !important;\n\n    height: 30px !important;\n\n    max-width: 40px !important;\n\n    margin: 0 !important;\n\n    padding: 0 !important;\n\n    vertical-align: middle !important;\n\n}\n \n \n\/* =========================================\n\n   MOBILE VIEW\n\n========================================= *\/\n \n@media (max-width: 767px) {\n \n    .tisa-social-follow {\n\n        width: 100% !important;\n\n        margin: 20px 0 !important;\n\n    }\n \n    .tisa-social-follow-title {\n\n        padding: 14px 12px !important;\n\n        font-size: 14px !important;\n\n        white-space: normal !important;\n\n    }\n \n    .tisa-social-follow-icons {\n\n        width: 190px !important;\n\n        padding: 10px 8px 10px 4px !important;\n\n        text-align: right !important;\n\n        white-space: nowrap !important;\n\n    }\n \n    .tisa-social-follow-link {\n\n        margin: 0 3px !important;\n\n    }\n \n    .tisa-social-follow-link-last {\n\n        margin: 0 0 0 3px !important;\n\n    }\n \n    .tisa-social-follow-icon {\n\n        width: 25px !important;\n\n        height: 25px !important;\n\n        max-width: 25px !important;\n\n    }\n \n    .tisa-social-follow-youtube {\n\n        width: 33px !important;\n\n        height: 25px !important;\n\n        max-width: 33px !important;\n\n    }\n\n}\n \n \n\/* =========================================\n\n   SMALL MOBILE\n\n========================================= *\/\n \n@media (max-width: 480px) {\n \n    .tisa-social-follow-title {\n\n        padding: 13px 10px !important;\n\n        font-size: 13px !important;\n\n    }\n \n    .tisa-social-follow-icons {\n\n        width: 170px !important;\n\n        padding: 9px 6px 9px 2px !important;\n\n    }\n \n    .tisa-social-follow-link {\n\n        margin: 0 2px !important;\n\n    }\n \n    .tisa-social-follow-link-last {\n\n        margin: 0 0 0 2px !important;\n\n    }\n \n    .tisa-social-follow-icon {\n\n        width: 23px !important;\n\n        height: 23px !important;\n\n        max-width: 23px !important;\n\n    }\n \n    .tisa-social-follow-youtube {\n\n        width: 30px !important;\n\n        height: 23px !important;\n\n        max-width: 30px !important;\n\n    }\n\n}\n<\/style>\n \n \n<table role=\"presentation\" class=\"tisa-social-follow\">\n \n<tr class=\"tisa-social-follow-row\">\n \n<td class=\"tisa-social-follow-title\">\n\nFollow Us for Daily Tech Tips\n<\/td>\n \n<td class=\"tisa-social-follow-icons\">\n \n<a href=\"https:\/\/www.instagram.com\/tisa_tech\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"tisa-social-follow-link\">\n<img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/a\/a5\/Instagram_icon.png\" alt=\"Instagram\" width=\"30\" height=\"30\" class=\"tisa-social-follow-icon\">\n<\/a>\n \n<a href=\"https:\/\/www.facebook.com\/tisatechjaipur\/\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"tisa-social-follow-link\">\n<img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/1b\/Facebook_icon.svg\" alt=\"Facebook\" width=\"30\" height=\"30\" class=\"tisa-social-follow-icon\">\n<\/a>\n \n<a href=\"https:\/\/www.linkedin.com\/company\/tisajaipur\/\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"tisa-social-follow-link\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/c\/ca\/LinkedIn_logo_initials.png\" alt=\"LinkedIn\" width=\"30\" height=\"30\" class=\"tisa-social-follow-icon\">\n<\/a>\n \n<a href=\"https:\/\/x.com\/tisa_tech\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"tisa-social-follow-link\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/5\/53\/X_logo_2023_original.svg\" alt=\"X\" width=\"30\" height=\"30\" class=\"tisa-social-follow-icon\">\n<\/a>\n \n<a href=\"https:\/\/www.youtube.com\/@tisa_tech\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"tisa-social-follow-link tisa-social-follow-link-last\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/e\/ef\/Youtube_logo.png\" alt=\"YouTube\" width=\"40\" height=\"30\" class=\"tisa-social-follow-youtube\">\n<\/a>\n \n<\/td>\n \n<\/tr>\n<\/table>\n\n\n\n<h2 class=\"wp-block-heading\">How Can TISA-TECH Help You Learn AI Agent Development?<\/h2>\n\n\n\n<p>Learning AI agent development takes more than reading code examples. You need to practice Python, connect AI models with tools, and learn how to handle errors. TISA-TECH&#8217;s <a href=\"https:\/\/www.tisatech.in\/our-courses\" target=\"_blank\" rel=\"noreferrer noopener\">AI\/ML<\/a> and <a href=\"https:\/\/www.tisatech.in\/artificial-intelligence\/generative-ai\" target=\"_blank\" rel=\"noreferrer noopener\">Generative AI courses<\/a> in Jaipur can help you learn these skills through hands-on practice and projects.<\/p>\n\n\n\n<p>As you work on projects, you&#8217;ll understand how AI agents process inputs, use tools, and return results. You can also learn to test your code, find errors, and improve how your applications work. This practical experience helps you understand the concepts better and gives you projects to discuss during job interviews.<\/p>\n\n\n\n<p>If you&#8217;re new to AI development, start by building a strong foundation in Python and gradually move to AI-based projects. <a href=\"https:\/\/www.tisatech.in\/our-courses\" target=\"_blank\" rel=\"noreferrer noopener\">Explore the available courses<\/a> to find a learning path that matches your current skills and career goals. You can also ask for course guidance to understand which option suits your learning needs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Building an AI agent with Python helps you understand how language models use tools to complete tasks. By connecting a model to Python functions, you can create agents that perform calculations, process results, and handle errors. Start with a simple use case and test each function before expanding the agent&#8217;s capabilities.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs Section<\/h2>\n\n\n\n<div data-wp-context=\"{ &quot;autoclose&quot;: false, &quot;accordionItems&quot;: [] }\" data-wp-interactive=\"core\/accordion\" role=\"group\" class=\"wp-block-accordion is-layout-flow wp-block-accordion-is-layout-flow\">\n<div data-wp-class--is-open=\"state.isOpen\" data-wp-context=\"{ &quot;id&quot;: &quot;accordion-item-1&quot;, &quot;openByDefault&quot;: false }\" data-wp-init=\"callbacks.initAccordionItems\" data-wp-on-window--hashchange=\"callbacks.hashChange\" class=\"wp-block-accordion-item is-layout-flow wp-block-accordion-item-is-layout-flow\">\n<h3 class=\"wp-block-accordion-heading\"><button aria-expanded=\"false\" aria-controls=\"accordion-item-1-panel\" data-wp-bind--aria-expanded=\"state.isOpen\" data-wp-on--click=\"actions.toggle\" data-wp-on--keydown=\"actions.handleKeyDown\" id=\"accordion-item-1\" type=\"button\" class=\"wp-block-accordion-heading__toggle\"><span class=\"wp-block-accordion-heading__toggle-title\">Q1. Do I need to know Python before building an AI agent?<\/span><span class=\"wp-block-accordion-heading__toggle-icon\" aria-hidden=\"true\">+<\/span><\/button><\/h3>\n\n\n\n<div inert aria-labelledby=\"accordion-item-1\" data-wp-bind--inert=\"!state.isOpen\" id=\"accordion-item-1-panel\" role=\"region\" class=\"wp-block-accordion-panel is-layout-flow wp-block-accordion-panel-is-layout-flow\">\n<p>Ans. Yes, basic Python knowledge helps. You should understand functions, variables, loops, dictionaries, and how to install libraries before connecting an AI model to Python tools.<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div data-wp-context=\"{ &quot;autoclose&quot;: false, &quot;accordionItems&quot;: [] }\" data-wp-interactive=\"core\/accordion\" role=\"group\" class=\"wp-block-accordion is-layout-flow wp-block-accordion-is-layout-flow\">\n<div data-wp-class--is-open=\"state.isOpen\" data-wp-context=\"{ &quot;id&quot;: &quot;accordion-item-2&quot;, &quot;openByDefault&quot;: false }\" data-wp-init=\"callbacks.initAccordionItems\" data-wp-on-window--hashchange=\"callbacks.hashChange\" class=\"wp-block-accordion-item is-layout-flow wp-block-accordion-item-is-layout-flow\">\n<h3 class=\"wp-block-accordion-heading\"><button aria-expanded=\"false\" aria-controls=\"accordion-item-2-panel\" data-wp-bind--aria-expanded=\"state.isOpen\" data-wp-on--click=\"actions.toggle\" data-wp-on--keydown=\"actions.handleKeyDown\" id=\"accordion-item-2\" type=\"button\" class=\"wp-block-accordion-heading__toggle\"><span class=\"wp-block-accordion-heading__toggle-title\">Q2. Can I build an AI agent for free?<\/span><span class=\"wp-block-accordion-heading__toggle-icon\" aria-hidden=\"true\">+<\/span><\/button><\/h3>\n\n\n\n<div inert aria-labelledby=\"accordion-item-2\" data-wp-bind--inert=\"!state.isOpen\" id=\"accordion-item-2-panel\" role=\"region\" class=\"wp-block-accordion-panel is-layout-flow wp-block-accordion-panel-is-layout-flow\">\n<p>Ans. You can write and test the Python code for free, but calling a hosted AI model may cost money. Check the provider&#8217;s pricing and account limits before running your agent.<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div data-wp-context=\"{ &quot;autoclose&quot;: false, &quot;accordionItems&quot;: [] }\" data-wp-interactive=\"core\/accordion\" role=\"group\" class=\"wp-block-accordion is-layout-flow wp-block-accordion-is-layout-flow\">\n<div data-wp-class--is-open=\"state.isOpen\" data-wp-context=\"{ &quot;id&quot;: &quot;accordion-item-3&quot;, &quot;openByDefault&quot;: false }\" data-wp-init=\"callbacks.initAccordionItems\" data-wp-on-window--hashchange=\"callbacks.hashChange\" class=\"wp-block-accordion-item is-layout-flow wp-block-accordion-item-is-layout-flow\">\n<h3 class=\"wp-block-accordion-heading\"><button aria-expanded=\"false\" aria-controls=\"accordion-item-3-panel\" data-wp-bind--aria-expanded=\"state.isOpen\" data-wp-on--click=\"actions.toggle\" data-wp-on--keydown=\"actions.handleKeyDown\" id=\"accordion-item-3\" type=\"button\" class=\"wp-block-accordion-heading__toggle\"><span class=\"wp-block-accordion-heading__toggle-title\">Q3. How do I fix common errors in a Python AI agent?<\/span><span class=\"wp-block-accordion-heading__toggle-icon\" aria-hidden=\"true\">+<\/span><\/button><\/h3>\n\n\n\n<div inert aria-labelledby=\"accordion-item-3\" data-wp-bind--inert=\"!state.isOpen\" id=\"accordion-item-3-panel\" role=\"region\" class=\"wp-block-accordion-panel is-layout-flow wp-block-accordion-panel-is-layout-flow\">\n<p>Ans. First, check whether your API key is valid and the selected model supports tool calling. Then inspect the tool name, JSON arguments, and return the result. Handle input errors separately from API errors so you can identify the cause.<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div data-wp-context=\"{ &quot;autoclose&quot;: false, &quot;accordionItems&quot;: [] }\" data-wp-interactive=\"core\/accordion\" role=\"group\" class=\"wp-block-accordion is-layout-flow wp-block-accordion-is-layout-flow\">\n<div data-wp-class--is-open=\"state.isOpen\" data-wp-context=\"{ &quot;id&quot;: &quot;accordion-item-4&quot;, &quot;openByDefault&quot;: false }\" data-wp-init=\"callbacks.initAccordionItems\" data-wp-on-window--hashchange=\"callbacks.hashChange\" class=\"wp-block-accordion-item is-layout-flow wp-block-accordion-item-is-layout-flow\">\n<h3 class=\"wp-block-accordion-heading\"><button aria-expanded=\"false\" aria-controls=\"accordion-item-4-panel\" data-wp-bind--aria-expanded=\"state.isOpen\" data-wp-on--click=\"actions.toggle\" data-wp-on--keydown=\"actions.handleKeyDown\" id=\"accordion-item-4\" type=\"button\" class=\"wp-block-accordion-heading__toggle\"><span class=\"wp-block-accordion-heading__toggle-title\">Q4. What projects can I build after creating a basic Python AI agent?<\/span><span class=\"wp-block-accordion-heading__toggle-icon\" aria-hidden=\"true\">+<\/span><\/button><\/h3>\n\n\n\n<div inert aria-labelledby=\"accordion-item-4\" data-wp-bind--inert=\"!state.isOpen\" id=\"accordion-item-4-panel\" role=\"region\" class=\"wp-block-accordion-panel is-layout-flow wp-block-accordion-panel-is-layout-flow\">\n<p>Ans. You can build a study assistant that searches your notes, a file-reading agent, or a research assistant that retrieves information from approved sources. Start with one task, define what each tool can access, and test the agent before adding more features.<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div data-wp-context=\"{ &quot;autoclose&quot;: false, &quot;accordionItems&quot;: [] }\" data-wp-interactive=\"core\/accordion\" role=\"group\" class=\"wp-block-accordion is-layout-flow wp-block-accordion-is-layout-flow\">\n<div data-wp-class--is-open=\"state.isOpen\" data-wp-context=\"{ &quot;id&quot;: &quot;accordion-item-5&quot;, &quot;openByDefault&quot;: false }\" data-wp-init=\"callbacks.initAccordionItems\" data-wp-on-window--hashchange=\"callbacks.hashChange\" class=\"wp-block-accordion-item is-layout-flow wp-block-accordion-item-is-layout-flow\">\n<h3 class=\"wp-block-accordion-heading\"><button aria-expanded=\"false\" aria-controls=\"accordion-item-5-panel\" data-wp-bind--aria-expanded=\"state.isOpen\" data-wp-on--click=\"actions.toggle\" data-wp-on--keydown=\"actions.handleKeyDown\" id=\"accordion-item-5\" type=\"button\" class=\"wp-block-accordion-heading__toggle\"><span class=\"wp-block-accordion-heading__toggle-title\">Q5. What is the difference between an AI agent and a normal Python program?<\/span><span class=\"wp-block-accordion-heading__toggle-icon\" aria-hidden=\"true\">+<\/span><\/button><\/h3>\n\n\n\n<div inert aria-labelledby=\"accordion-item-5\" data-wp-bind--inert=\"!state.isOpen\" id=\"accordion-item-5-panel\" role=\"region\" class=\"wp-block-accordion-panel is-layout-flow wp-block-accordion-panel-is-layout-flow\">\n<p>Ans. A normal Python program generally follows predefined instructions. An AI agent uses a model to select an available tool or action based on the task, while Python executes the tool and returns its result.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Python is widely used to build applications, automate tasks, and work with AI models. It also gives developers the tools [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":9210,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[12],"tags":[],"class_list":["post-9167","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)<\/title>\n<meta name=\"description\" content=\"Learn how to build an AI agent using Python from scratch. Set up your project, connect an AI model, add tool calling, and test your agent.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)\" \/>\n<meta property=\"og:description\" content=\"Learn how to build an AI agent using Python from scratch. Set up your project, connect an AI model, add tool calling, and test your agent.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/\" \/>\n<meta property=\"og:site_name\" content=\"TISA-TECH\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/people\/TISA-Training-Institute-For-Software-Applications\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-14T07:59:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-14T07:59:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/10\/How-to-Build-an-AI-Agent-Using-Python-blog-image.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Divyanshi Sain\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tisa_Tech\" \/>\n<meta name=\"twitter:site\" content=\"@tisa_Tech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Divyanshi Sain\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/\"},\"author\":{\"name\":\"Divyanshi Sain\",\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/#\\\/schema\\\/person\\\/fde954ac3808f55a26dc44f6784777b4\"},\"headline\":\"How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)\",\"datePublished\":\"2026-10-14T07:59:02+00:00\",\"dateModified\":\"2026-10-14T07:59:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/\"},\"wordCount\":1909,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/How-to-Build-an-AI-Agent-Using-Python-blog-image.jpg\",\"articleSection\":[\"AI &amp; Machine Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/#respond\"]}]},{\"@type\":[\"WebPage\",\"CollectionPage\"],\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/\",\"url\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/\",\"name\":\"How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/How-to-Build-an-AI-Agent-Using-Python-blog-image.jpg\",\"datePublished\":\"2026-10-14T07:59:02+00:00\",\"dateModified\":\"2026-10-14T07:59:03+00:00\",\"description\":\"Learn how to build an AI agent using Python from scratch. Set up your project, connect an AI model, add tool calling, and test your agent.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/How-to-Build-an-AI-Agent-Using-Python-blog-image.jpg\",\"contentUrl\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/How-to-Build-an-AI-Agent-Using-Python-blog-image.jpg\",\"width\":1200,\"height\":630,\"caption\":\"Learn how to build an AI agent using Python, connect LLMs and tools, and test and deploy a working AI agent step by step.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/build-ai-agent-using-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/\",\"name\":\"TISA\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/#organization\",\"name\":\"TISA (Training Institute For Software & Applications)\",\"url\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/TISA-Training-Institute-for-Software-Applications-2-2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/TISA-Training-Institute-for-Software-Applications-2-2.jpg\",\"width\":1200,\"height\":1200,\"caption\":\"TISA (Training Institute For Software & Applications)\"},\"image\":{\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/people\\\/TISA-Training-Institute-For-Software-Applications\",\"https:\\\/\\\/x.com\\\/tisa_Tech\",\"https:\\\/\\\/www.instagram.com\\\/tisa_tech\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/tisajaipur\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/tisatraining\\\/\",\"https:\\\/\\\/www.youtube.com\\\/@tisa_tech\",\"https:\\\/\\\/github.com\\\/tisatechgroup\",\"https:\\\/\\\/www.trustpilot.com\\\/review\\\/tisatech.in\",\"https:\\\/\\\/maps.app.goo.gl\\\/hBXSLDHL1m6kSKxaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/#\\\/schema\\\/person\\\/fde954ac3808f55a26dc44f6784777b4\",\"name\":\"Divyanshi Sain\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/divyanshi-image.jpg\",\"url\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/divyanshi-image.jpg\",\"contentUrl\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/divyanshi-image.jpg\",\"caption\":\"Divyanshi Sain\"},\"description\":\"Divyanshi Sain is a tech writer at TISA-TECH with a strong eye for SEO. With 4+ years of experience, she creates clear, engaging content that breaks down complex tech topics and helps readers find exactly what they're looking for.\",\"sameAs\":[\"https:\\\/\\\/www.tisatech.in\\\/blog\",\"linkedin.com\\\/in\\\/divyanshi-sain-1a1106400\"],\"url\":\"https:\\\/\\\/www.tisatech.in\\\/blog\\\/author\\\/divyanshi\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)","description":"Learn how to build an AI agent using Python from scratch. Set up your project, connect an AI model, add tool calling, and test your agent.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/","og_locale":"en_US","og_type":"article","og_title":"How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)","og_description":"Learn how to build an AI agent using Python from scratch. Set up your project, connect an AI model, add tool calling, and test your agent.","og_url":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/","og_site_name":"TISA-TECH","article_publisher":"https:\/\/www.facebook.com\/people\/TISA-Training-Institute-For-Software-Applications","article_published_time":"2026-10-14T07:59:02+00:00","article_modified_time":"2026-10-14T07:59:03+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/10\/How-to-Build-an-AI-Agent-Using-Python-blog-image.jpg","type":"image\/jpeg"}],"author":"Divyanshi Sain","twitter_card":"summary_large_image","twitter_creator":"@tisa_Tech","twitter_site":"@tisa_Tech","twitter_misc":{"Written by":"Divyanshi Sain","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/#article","isPartOf":{"@id":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/"},"author":{"name":"Divyanshi Sain","@id":"https:\/\/www.tisatech.in\/blog\/#\/schema\/person\/fde954ac3808f55a26dc44f6784777b4"},"headline":"How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)","datePublished":"2026-10-14T07:59:02+00:00","dateModified":"2026-10-14T07:59:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/"},"wordCount":1909,"commentCount":0,"publisher":{"@id":"https:\/\/www.tisatech.in\/blog\/#organization"},"image":{"@id":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/10\/How-to-Build-an-AI-Agent-Using-Python-blog-image.jpg","articleSection":["AI &amp; Machine Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/#respond"]}]},{"@type":["WebPage","CollectionPage"],"@id":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/","url":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/","name":"How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)","isPartOf":{"@id":"https:\/\/www.tisatech.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/#primaryimage"},"image":{"@id":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/10\/How-to-Build-an-AI-Agent-Using-Python-blog-image.jpg","datePublished":"2026-10-14T07:59:02+00:00","dateModified":"2026-10-14T07:59:03+00:00","description":"Learn how to build an AI agent using Python from scratch. Set up your project, connect an AI model, add tool calling, and test your agent.","breadcrumb":{"@id":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/#breadcrumb"},"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/#primaryimage","url":"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/10\/How-to-Build-an-AI-Agent-Using-Python-blog-image.jpg","contentUrl":"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/10\/How-to-Build-an-AI-Agent-Using-Python-blog-image.jpg","width":1200,"height":630,"caption":"Learn how to build an AI agent using Python, connect LLMs and tools, and test and deploy a working AI agent step by step."},{"@type":"BreadcrumbList","@id":"https:\/\/www.tisatech.in\/blog\/build-ai-agent-using-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.tisatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Build an AI Agent Using Python (Step-by-Step Guide for Beginners)"}]},{"@type":"WebSite","@id":"https:\/\/www.tisatech.in\/blog\/#website","url":"https:\/\/www.tisatech.in\/blog\/","name":"TISA","description":"","publisher":{"@id":"https:\/\/www.tisatech.in\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tisatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.tisatech.in\/blog\/#organization","name":"TISA (Training Institute For Software & Applications)","url":"https:\/\/www.tisatech.in\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tisatech.in\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/04\/TISA-Training-Institute-for-Software-Applications-2-2.jpg","contentUrl":"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/04\/TISA-Training-Institute-for-Software-Applications-2-2.jpg","width":1200,"height":1200,"caption":"TISA (Training Institute For Software & Applications)"},"image":{"@id":"https:\/\/www.tisatech.in\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/people\/TISA-Training-Institute-For-Software-Applications","https:\/\/x.com\/tisa_Tech","https:\/\/www.instagram.com\/tisa_tech","https:\/\/www.linkedin.com\/company\/tisajaipur\/","https:\/\/in.pinterest.com\/tisatraining\/","https:\/\/www.youtube.com\/@tisa_tech","https:\/\/github.com\/tisatechgroup","https:\/\/www.trustpilot.com\/review\/tisatech.in","https:\/\/maps.app.goo.gl\/hBXSLDHL1m6kSKxaA"]},{"@type":"Person","@id":"https:\/\/www.tisatech.in\/blog\/#\/schema\/person\/fde954ac3808f55a26dc44f6784777b4","name":"Divyanshi Sain","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/05\/divyanshi-image.jpg","url":"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/05\/divyanshi-image.jpg","contentUrl":"https:\/\/www.tisatech.in\/blog\/wp-content\/uploads\/2026\/05\/divyanshi-image.jpg","caption":"Divyanshi Sain"},"description":"Divyanshi Sain is a tech writer at TISA-TECH with a strong eye for SEO. With 4+ years of experience, she creates clear, engaging content that breaks down complex tech topics and helps readers find exactly what they're looking for.","sameAs":["https:\/\/www.tisatech.in\/blog","linkedin.com\/in\/divyanshi-sain-1a1106400"],"url":"https:\/\/www.tisatech.in\/blog\/author\/divyanshi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/posts\/9167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/comments?post=9167"}],"version-history":[{"count":42,"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/posts\/9167\/revisions"}],"predecessor-version":[{"id":9209,"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/posts\/9167\/revisions\/9209"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/media\/9210"}],"wp:attachment":[{"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/media?parent=9167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/categories?post=9167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tisatech.in\/blog\/wp-json\/wp\/v2\/tags?post=9167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}