<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-401871196748512106</id><updated>2026-08-23T09:52:09.583-07:00</updated><category term="NodeJs"/><title type='text'>Hanzala Subhani</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>80</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-3818581529112500488</id><published>2025-12-25T04:55:00.000-08:00</published><updated>2025-12-25T04:55:23.175-08:00</updated><title type='text'>The Magic of Pi: More Than Just 3.14 (And Why It&#39;s Everywhere!)</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; font-weight: 600;&quot;&gt;π (Pi)&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;is one of the most fascinating and universal constants in mathematics, representing the ratio of a circle&#39;s circumference to its diameter. But its reach extends far beyond geometry, touching almost every field of science and nature.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;The Basics: What Is π?&lt;/span&gt;&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;At its simplest:&lt;br /&gt;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;π = circumference ÷ diameter ≈ 3.141592653589793...&lt;/code&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;This value is constant for&amp;nbsp;&lt;em&gt;all&lt;/em&gt;&amp;nbsp;circles, regardless of size. More intriguingly, π is&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;irrational&lt;/span&gt;&amp;nbsp;(its decimal representation never ends or repeats) and&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;transcendental&lt;/span&gt;&amp;nbsp;(not the root of any non-zero polynomial equation with rational coefficients).&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;π in Unexpected Places&lt;/span&gt;&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Geometry &amp;amp; Circles (The Obvious)&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Circle area:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;A = πr²&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Sphere volume:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;V = (4/3)πr³&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Cylinder surface area:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;2πrh + 2πr²&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Trigonometry &amp;amp; Waves&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Sine and cosine functions have periods of&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;2π&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Euler&#39;s identity:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;e^(iπ) + 1 = 0&lt;/code&gt;&amp;nbsp;(connects π, e, i, 1, and 0)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Appears in Fourier transforms, essential for signal processing&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Probability &amp;amp; Statistics&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Buffon&#39;s Needle Problem&lt;/span&gt;: A probability experiment to estimate π by dropping needles on lined paper&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Normal distribution (bell curve):&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;(1/√(2π)) e^(-x²/2)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;The Gaussian integral:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;∫e^(-x²)dx = √π&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Physics &amp;amp; Engineering&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Heisenberg&#39;s Uncertainty Principle&lt;/span&gt;: Δx Δp ≥ ħ/2 (ħ = h/2π)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Einstein&#39;s field equations&lt;/span&gt;: Rμν - ½Rgμν + Λgμν = (8πG/c⁴)Tμν&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Coulomb&#39;s law&lt;/span&gt;&amp;nbsp;(electromagnetism): F = (1/4πε₀)(q₁q₂/r²)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Simple harmonic motion&lt;/span&gt;: Period of a pendulum: T ≈ 2π√(L/g)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Nature &amp;amp; Biology&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Rivers&lt;/span&gt;: The ratio of a river&#39;s actual length to its straight-line distance from source to mouth often approximates π&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;DNA&lt;/span&gt;: The helical structure has dimensions related to π&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Eyes&lt;/span&gt;: The pupil&#39;s shape and light diffraction patterns involve π&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Art &amp;amp; Architecture&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;The Parthenon and pyramids incorporate circular and spherical mathematics&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Musical theory: Harmonics and wave frequencies relate to π&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;The Quest to Calculate π&lt;/span&gt;&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Ancient Approximations:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Babylonians (1900–1680 BC): 3.125&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Egyptians (1650 BC): ≈ 3.1605&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Archimedes (250 BC): Used polygons to prove 3.1408 &amp;lt; π &amp;lt; 3.1429&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Modern Computations:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;2021: 62.8 trillion digits calculated using supercomputers&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Chudnovsky algorithm&lt;/span&gt;: Used for many record calculations&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Monte Carlo methods&lt;/span&gt;: Statistical approaches to estimate π&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Cultural Significance&lt;/span&gt;&lt;/h2&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Pi Day&lt;/span&gt;: Celebrated on March 14 (3/14) at 1:59 PM&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Pi Memorization Records&lt;/span&gt;: Over 70,000 digits recited from memory&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Appears in literature, films, and even legal disputes&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Why π Is Truly &quot;Everywhere&quot;&lt;/span&gt;&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;The deep reason π appears across disciplines is its connection to&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;periodicity, symmetry, and curvature&lt;/span&gt;&amp;nbsp;in our universe. Any system involving:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Cycles&lt;/span&gt;&amp;nbsp;(orbits, oscillations, waves)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Spherical or circular symmetry&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Harmonic motion or distributions&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Rotation or angular measurement&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;will inevitably involve π.&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Philosophical Perspective&lt;/span&gt;&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Some mathematicians and physicists argue π’s ubiquity reveals something fundamental about our universe&#39;s structure—that circular and harmonic relationships are woven into the fabric of reality, from quantum scales to cosmic ones.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px; margin-top: 16px;&quot;&gt;From the circular orbits of planets to the quantum spin of electrons, from the spiral of a nautilus shell to the digital signals in your phone, π is more than just a number—it’s a mathematical signature of our curved, cyclical, and beautifully patterned universe.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/3818581529112500488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/12/the-magic-of-pi-more-than-just-314-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3818581529112500488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3818581529112500488'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/12/the-magic-of-pi-more-than-just-314-and.html' title='The Magic of Pi: More Than Just 3.14 (And Why It&#39;s Everywhere!)'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-2576013795595283762</id><published>2025-12-25T04:49:00.000-08:00</published><updated>2025-12-25T04:49:14.744-08:00</updated><title type='text'>Roller Coaster Science: The Ups and Downs of Energy and Motion</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;Roller coasters are thrilling demonstrations of physics in action. Every loop, drop, and turn is governed by fundamental principles of energy and motion that transform potential energy into kinetic energy and back again.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;The Core Principle: Conservation of Energy&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;The entire ride operates on&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;energy transformation&lt;/span&gt;:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Potential Energy (PE)&lt;/span&gt;&amp;nbsp;= mass × gravity × height (PE = mgh)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Kinetic Energy (KE)&lt;/span&gt;&amp;nbsp;= ½ × mass × velocity² (KE = ½mv²)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;At the start, a chain lift or launch system pulls the coaster to its&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;highest point&lt;/span&gt;, maximizing its potential energy. As it descends, this potential energy converts to kinetic energy, reaching maximum speed at the lowest point.&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Forces at Play: More Than Just Speed&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;G-Forces&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Positive G-forces&lt;/span&gt;: Felt during rapid ascents or at the bottom of hills, pushing riders into their seats&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Negative G-forces&lt;/span&gt;: Experienced at crests of hills, creating a &quot;weightless&quot; sensation&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Lateral G-forces&lt;/span&gt;: Created during sharp turns, pushing riders sideways&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Centripetal Force&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;In loops and turns, the track provides&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;centripetal force&lt;/span&gt;&amp;nbsp;that keeps the coaster on its path:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;F = mv²/r&lt;/span&gt;&amp;nbsp;(force equals mass times velocity squared divided by radius)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Banked turns help direct this force more comfortably for riders&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Design Elements and Their Physics&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;First Drop&lt;/span&gt;: Tallest drop provides maximum energy conversion&lt;br /&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Camel Humps&lt;/span&gt;: Smaller hills that gradually dissipate energy through the ride&lt;br /&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Loops&lt;/span&gt;: Teardrop-shaped (clothoid loops) to reduce extreme G-forces&lt;br /&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Helixes&lt;/span&gt;: Tight spirals that maintain speed while changing direction&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Modern Innovations&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Launch Systems&lt;/span&gt;: Replace traditional chain lifts using:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Linear induction motors (magnetic propulsion)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Hydraulic launch systems&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Flywheel catapults&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Inverted &amp;amp; Wing Designs&lt;/span&gt;: Change how forces are distributed and experienced&lt;br /&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Computer Modeling&lt;/span&gt;: Allows precise calculation of forces before construction&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Safety Engineering&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Roller coasters are designed with&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;safety factors&lt;/span&gt;&amp;nbsp;of 3-10 times expected forces. Multiple redundant braking systems and precisely calculated curves ensure that even as coasters push physical limits, they remain within engineered safety parameters.&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;The Human Experience&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;The thrill comes from&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;controlled fear&lt;/span&gt;&amp;nbsp;– our bodies experience unusual forces while our rational minds know we&#39;re secure. This disconnect between sensation and safety creates the unique excitement of roller coasters.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px; margin-top: 16px;&quot;&gt;From the slow climb to the exhilarating drops, every element of a roller coaster is a lesson in physics, perfectly balancing energy conversion, force management, and human sensation to create the ultimate thrill ride.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/2576013795595283762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/12/roller-coaster-science-ups-and-downs-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/2576013795595283762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/2576013795595283762'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/12/roller-coaster-science-ups-and-downs-of.html' title='Roller Coaster Science: The Ups and Downs of Energy and Motion'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-6490572538595444090</id><published>2025-12-14T00:15:17.252-08:00</published><updated>2025-12-14T00:15:45.490-08:00</updated><title type='text'>The Secret Language of Numbers: Exploring Primes, Patterns, and Puzzles</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; font-weight: 600;&quot;&gt;Numbers Don’t Just Count Things—They Tell Stories&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Beneath the surface of ordinary arithmetic lies a hidden world—a landscape of primes that behave like atomic elements, sequences that appear in sunflowers and galaxies, and puzzles that have captivated minds for millennia. This is the secret language of mathematics, a code written not in words, but in patterns, relationships, and profound simplicity.&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;The Indivisible Atoms: Prime Numbers&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Prime numbers—integers greater than 1 that are only divisible by 1 and themselves—are the building blocks of all numbers. Every number is either a prime or a unique product of primes (its&amp;nbsp;&lt;em&gt;prime factorization&lt;/em&gt;). This is the&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;Fundamental Theorem of Arithmetic&lt;/span&gt;—the core grammar of our number system.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;The Mysteries Within:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Twin Primes:&lt;/span&gt;&amp;nbsp;Pairs like (3,5), (11,13), (17,19) that are only two apart. Do they go on forever? We suspect so, but it remains unproven—the&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;Twin Prime Conjecture&lt;/span&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Prime Gaps:&lt;/span&gt;&amp;nbsp;As numbers grow, the gaps between primes can become arbitrarily large. Yet primes still appear, unpredictably but persistently.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;The &quot;Ulam Spiral&quot;:&lt;/span&gt;&amp;nbsp;When you write numbers in a spiral and highlight primes, startling diagonal patterns emerge—suggesting hidden order in their apparent randomness.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;text&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18  5  4  3 12 29
40 19  6  1  2 11 28
41 20  7  8  9 10 27
42 21 22 23 24 25 26&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;em&gt;(Highlight the primes in this spiral and see the diagonals form.)&lt;/em&gt;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Nature’s Favorite Numbers: The Fibonacci Sequence&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Start with 0 and 1. Then add the last two numbers to get the next: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34... This simple rule generates the&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;Fibonacci sequence&lt;/span&gt;, which appears with uncanny frequency in the natural world:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Phyllotaxis:&lt;/span&gt;&amp;nbsp;The spiral arrangement of leaves, seeds (sunflower), and petals often follows Fibonacci numbers, optimizing light exposure and packing efficiency.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;The Golden Ratio (φ ≈ 1.618):&lt;/span&gt;&amp;nbsp;Divide a Fibonacci number by its predecessor. As numbers grow, the ratio approaches φ—a proportion considered aesthetically pleasing, found in art, architecture, and even the proportions of the human body.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Pinecones, pineapples, and hurricanes:&lt;/span&gt;&amp;nbsp;Their spiral counts are often consecutive Fibonacci numbers.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Perfect, Amicable, and Sociable Numbers&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Mathematicians have long been fascinated by number &quot;personalities&quot;:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Perfect Numbers:&lt;/span&gt;&amp;nbsp;A number equals the sum of its proper divisors (e.g., 6 = 1+2+3; 28 = 1+2+4+7+14).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Amicable Numbers:&lt;/span&gt;&amp;nbsp;Two numbers where each is the sum of the other&#39;s proper divisors (e.g., 220 and 284).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Sociable Numbers:&lt;/span&gt;&amp;nbsp;Chains of three or more numbers that form a &quot;friendship&quot; cycle through their divisor sums.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;These feel like numerical poetry—self-referential and strangely harmonious.&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;The Magic of 9&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;In base-10, the number 9 has peculiar properties:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Casting Out Nines:&lt;/span&gt;&amp;nbsp;The sum of a number&#39;s digits, repeated until a single digit remains, gives its&amp;nbsp;&lt;em&gt;digital root&lt;/em&gt;. A number is divisible by 9 if its digital root is 9.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Multiplication Mirror:&lt;/span&gt;&amp;nbsp;9 × 2 = 18 (1+8=9); 9 × 3 = 27 (2+7=9). The digits of multiples of 9 always sum to 9 or a multiple of 9.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;The 1089 Trick:&lt;/span&gt;&amp;nbsp;Take any three-digit number with descending then ascending digits (e.g., 532), reverse it (235), subtract the smaller from larger (532-235=297), reverse the result (792), and add (297+792=1089). You&#39;ll always get 1089.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;The Puzzles That Shaped Mathematics&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Some patterns conceal deep mysteries that have driven mathematical progress:&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;The Collatz Conjecture (3n+1 Problem):&lt;/span&gt;&lt;br /&gt;Start with any positive integer. If it’s even, divide by 2; if odd, multiply by 3 and add 1. Repeat. The conjecture: you’ll always eventually reach 1.&lt;br /&gt;Example: 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1&lt;br /&gt;&lt;em&gt;Simple rules, unpredictable path—yet every number tested (up to astronomical values) eventually falls to 1. Why? No one knows.&lt;/em&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;The Riemann Hypothesis:&lt;/span&gt;&lt;br /&gt;Consider the &quot;zeta function&quot;: ζ(s) = 1/1ˢ + 1/2ˢ + 1/3ˢ + ...&lt;br /&gt;All its non-trivial zeros (solutions where ζ(s)=0) are predicted to lie on a single vertical line in the complex plane: Re(s) = 1/2. Proving this would unlock profound secrets about the distribution of prime numbers. It&#39;s arguably the most famous unsolved problem in mathematics.&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Palindromic Numbers &amp;amp; Lychrel Numbers&lt;/h2&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Palindromic Numbers:&lt;/span&gt;&amp;nbsp;Read the same forwards and backward (e.g., 121, 12321).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;The 196-Algorithm:&lt;/span&gt;&amp;nbsp;Reverse a number&#39;s digits and add to the original. Repeat. Most numbers eventually become palindromes.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Lychrel Numbers:&lt;/span&gt;&amp;nbsp;Suspected numbers that&amp;nbsp;&lt;em&gt;never&lt;/em&gt;&amp;nbsp;form a palindrome through this process. 196 is the smallest candidate—it’s been iterated millions of times without reaching a palindrome.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Modular Arithmetic: Clock Mathematics&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Sometimes called &quot;clock math,&quot; this system resets after reaching a certain number (the modulus). On a 12-hour clock, 15:00 is 3:00 PM because 15 mod 12 = 3.&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;ISBN codes, credit card numbers (Luhn algorithm), and cryptography&lt;/span&gt;&amp;nbsp;all rely on modular arithmetic for error detection and security.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;It creates repeating cycles and congruence classes—a different way to slice the number line.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;The Unreasonable Effectiveness of Mathematics&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Physicist Eugene Wigner marveled at how mathematical patterns, explored for their own beauty, later provide the perfect language for physical laws. Prime numbers now secure our digital communications. Matrix algebra powers AI. Non-Euclidean geometry described spacetime before we could observe it.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Why does math—a product of human thought—so perfectly describe the universe?&lt;/span&gt;&amp;nbsp;This remains one of the deepest philosophical mysteries.&lt;/p&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border: none; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Try This Number Detective Game:&lt;/h3&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Pick any 3-digit number where digits are decreasing then increasing (like 853).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Reverse it (358).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Subtract smaller from larger (853-358=495).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Reverse the result (594).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Add (495+594=1089).&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;em&gt;You’ll likely get 1089. But find the exception—the numbers where this &quot;magic trick&quot; breaks. Why do those specific numbers behave differently?&lt;/em&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/6490572538595444090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/12/the-secret-language-of-numbers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/6490572538595444090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/6490572538595444090'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/12/the-secret-language-of-numbers.html' title='The Secret Language of Numbers: Exploring Primes, Patterns, and Puzzles'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-1545567386356364552</id><published>2025-12-13T11:03:00.000-08:00</published><updated>2025-12-13T11:03:14.286-08:00</updated><title type='text'>Unlocking Algebra&#39;s Secrets: How X &amp; Y Solve Everyday Mysteries</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; font-weight: 600;&quot;&gt;Algebra: The Secret Code for Everyday Problem-Solving&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;When many people hear &quot;algebra,&quot; they picture complex equations, mysterious X&#39;s and Y&#39;s, and confusing rules. But what if I told you that you&#39;re probably already using algebraic thinking in your daily life? You just don&#39;t call it that yet.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Algebra isn&#39;t an abstract mathematical torture device—it&#39;s a powerful problem-solving toolkit that helps us uncover hidden information and make better decisions. Let&#39;s demystify how those X&#39;s and Y&#39;s actually help us solve real-world puzzles.&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;The Candy Sharing Dilemma: Your First Algebraic Mystery&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Imagine this: You and two friends have a bag of candy to share. You know there are 24 pieces total, and you agree that you&#39;ll get twice as much as Friend A, while Friend B gets 4 pieces less than you. How many pieces does each person get?&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;This seems tricky, but algebra makes it straightforward:&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Let&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x&lt;/code&gt;&amp;nbsp;= pieces Friend A gets&lt;br /&gt;Then you get&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;2x&lt;/code&gt;&amp;nbsp;pieces&lt;br /&gt;Friend B gets&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;2x - 4&lt;/code&gt;&amp;nbsp;pieces&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;The equation:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x + 2x + (2x - 4) = 24&lt;/code&gt;&lt;br /&gt;Simplified:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;5x - 4 = 24&lt;/code&gt;&lt;br /&gt;Add 4 to both sides:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;5x = 28&lt;/code&gt;&lt;br /&gt;Divide by 5:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x = 5.6&lt;/code&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Wait—5.6 pieces of candy? That&#39;s not practical. Maybe we need to reconsider our numbers. This simple example shows how algebra helps us spot when a problem might have unrealistic assumptions!&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Age Mysteries: How Old Are They Really?&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;You&#39;ve probably heard puzzles like: &quot;In 10 years, Sarah will be twice as old as she was 5 years ago. How old is Sarah now?&quot;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Let&#39;s solve it together:&lt;br /&gt;Let&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x&lt;/code&gt;&amp;nbsp;= Sarah&#39;s current age&lt;br /&gt;In 10 years:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x + 10&lt;/code&gt;&lt;br /&gt;5 years ago:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x - 5&lt;/code&gt;&lt;br /&gt;Equation:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x + 10 = 2(x - 5)&lt;/code&gt;&lt;br /&gt;Expand:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x + 10 = 2x - 10&lt;/code&gt;&lt;br /&gt;Subtract x from both sides:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;10 = x - 10&lt;/code&gt;&lt;br /&gt;Add 10 to both sides:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;20 = x&lt;/code&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Sarah is 20 years old! See how we uncovered the mystery?&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;The Road Trip Calculation&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Planning a trip? Algebra can help. Suppose you need to drive 300 miles and want to arrive in 5 hours, but you know you&#39;ll need a 30-minute break. How fast do you need to drive?&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Let&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x&lt;/code&gt;&amp;nbsp;= your driving speed in miles per hour&lt;br /&gt;Actual driving time: 5 hours - 0.5 hours = 4.5 hours&lt;br /&gt;Equation:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;4.5x = 300&lt;/code&gt;&lt;br /&gt;Divide both sides by 4.5:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x = 300 ÷ 4.5 ≈ 66.67&lt;/code&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;You need to average about 67 mph. Algebra just helped you plan a safer trip!&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Why The &quot;Balance&quot; Metaphor Actually Makes Sense&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Teachers often talk about &quot;keeping equations balanced,&quot; which can seem abstract. But think of it like a seesaw: whatever you do to one side, you must do to the other to keep it level.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;If&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;2x + 5 = 17&lt;/code&gt;, imagine 2 mystery bags (each containing x) plus 5 pounds on the left side of a seesaw, balanced with 17 pounds on the right. To find what&#39;s in each bag, we remove 5 pounds from BOTH sides, leaving&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;2x = 12&lt;/code&gt;. Then we split both sides into two equal piles, giving us&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;x = 6&lt;/code&gt;.&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Everyday Algebra You&#39;re Already Doing&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;You use algebraic thinking when you:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Adjust a recipe for more or fewer people&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Calculate sale prices (30% off means paying 70% of the original)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Figure out how many hours you need to work at a certain wage to buy something&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Split a restaurant bill unevenly based on what everyone ordered&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Building Your Algebraic Mindset&lt;/h2&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Spot the unknown&lt;/span&gt;&amp;nbsp;- What are you trying to find?&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Give it a name&lt;/span&gt;&amp;nbsp;- Call it x, or something descriptive like &quot;cost_per_ticket&quot;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Translate words into math&lt;/span&gt;&amp;nbsp;- &quot;Twice as many&quot; becomes&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;2×&lt;/code&gt;, &quot;five less&quot; becomes&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;-5&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Set up the relationship&lt;/span&gt;&amp;nbsp;- Create an equation showing how everything connects&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Solve step-by-step&lt;/span&gt;&amp;nbsp;- Do the same thing to both sides until the unknown stands alone&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Check if it makes sense&lt;/span&gt;&amp;nbsp;- Does your answer work in the original situation?&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;The Real Superpower of Algebra&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Algebra&#39;s true value isn&#39;t in solving textbook problems—it&#39;s in developing structured thinking. It teaches us to:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Break complex problems into manageable pieces&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Work with unknown information systematically&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Recognize patterns and relationships&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Verify our solutions actually make sense&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;The next time you face a situation with missing information—whether budgeting, planning, or even negotiating—remember that you have algebraic thinking in your mental toolkit. Those X&#39;s and Y&#39;s aren&#39;t just letters on a page; they&#39;re placeholders for life&#39;s mysteries waiting to be solved.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/1545567386356364552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/12/unlocking-algebras-secrets-how-x-y.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/1545567386356364552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/1545567386356364552'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/12/unlocking-algebras-secrets-how-x-y.html' title='Unlocking Algebra&#39;s Secrets: How X &amp; Y Solve Everyday Mysteries'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-953745312483623762</id><published>2025-12-06T10:17:00.000-08:00</published><updated>2025-12-06T10:17:22.416-08:00</updated><title type='text'>The Economics of AI: Cost Optimization and GPU Droughts</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;The AI revolution is fundamentally reshaping economic landscapes, but behind the remarkable capabilities of models like GPT-4 and Stable Diffusion lies a complex economic reality characterized by skyrocketing costs and critical hardware shortages. This analysis explores the dual challenges of AI cost optimization and GPU scarcity that are shaping the industry&#39;s trajectory.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;The GPU Drought: Causes and Consequences&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Root Causes of GPU Scarcity&lt;/h3&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Explosive Demand&lt;/span&gt;: Training modern AI models requires unprecedented computational power (GPT-3 reportedly used ~10,000 GPUs)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Supply Chain Constraints&lt;/span&gt;: Complex semiconductor manufacturing with limited fabrication capacity&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Geopolitical Factors&lt;/span&gt;: Export restrictions and trade tensions affecting chip availability&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Cryptocurrency Mining&lt;/span&gt;: Continued competition for high-performance GPUs&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Economic Impacts&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Skyrocketing GPU Prices&lt;/span&gt;: Nvidia&#39;s AI-focused H100 GPUs selling at premiums exceeding 300% over MSRP&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Extended Lead Times&lt;/span&gt;: Major cloud providers reporting 6+ month waits for dedicated GPU instances&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Market Concentration&lt;/span&gt;: Advantage for well-funded tech giants over startups and researchers&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Innovation Bottlenecks&lt;/span&gt;: Limited access slowing research progress and experimentation&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;AI Cost Optimization Strategies&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;1.&amp;nbsp;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Computational Efficiency&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Model Pruning and Quantization&lt;/span&gt;: Reducing model size while preserving performance&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Architecture Innovation&lt;/span&gt;: More parameter-efficient designs (Mixture of Experts, attention alternatives)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Training Optimization&lt;/span&gt;: Better initialization, curriculum learning, and early stopping&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;2.&amp;nbsp;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Infrastructure Optimization&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Hybrid Cloud Strategies&lt;/span&gt;: Balancing on-premise, cloud, and edge computing&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;GPU Sharing and Virtualization&lt;/span&gt;: Maximizing utilization through multi-tenancy&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Specialized Hardware&lt;/span&gt;: Exploring alternatives like TPUs, FPGAs, and custom AI accelerators&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;3.&amp;nbsp;&lt;span style=&quot;font-weight: inherit;&quot;&gt;Operational Efficiency&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Model Lifecycle Management&lt;/span&gt;: Careful monitoring of inference costs and retraining schedules&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Task-Specific Models&lt;/span&gt;: Deploying smaller, specialized models instead of massive general models&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Progressive Deployment&lt;/span&gt;: Starting with simpler models and scaling complexity as needed&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Economic Implications and Market Responses&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Shifting Business Models&lt;/h3&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;AI-as-a-Service Proliferation&lt;/span&gt;: Companies outsourcing AI workloads to specialized providers&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Rise of Edge Computing&lt;/span&gt;: Moving computation closer to data sources to reduce bandwidth costs&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Model Marketplaces&lt;/span&gt;: Growth of platforms for buying, selling, and sharing pre-trained models&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Open Source Alternatives&lt;/span&gt;: Community-driven development of more efficient models&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Investment Trends&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Vertical Integration&lt;/span&gt;: Major players investing in custom silicon development (Google TPUs, Amazon Trainium)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Distributed Computing&lt;/span&gt;: Leveraging idle resources through decentralized networks&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Energy-Conscious AI&lt;/span&gt;: Focus on algorithms with lower carbon footprints and energy costs&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Policy and Industry Responses&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Short-term Measures&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Improved allocation mechanisms for scarce GPU resources&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Increased transparency in hardware availability and pricing&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Support for academic and non-profit research access&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Long-term Solutions&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Diversified Supply Chains&lt;/span&gt;: Reducing geographic concentration in semiconductor manufacturing&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Standards Development&lt;/span&gt;: Creating benchmarks for AI efficiency and environmental impact&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Regulatory Frameworks&lt;/span&gt;: Balancing innovation with responsible resource use&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Future Outlook&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;The economics of AI are evolving toward a more sustainable equilibrium through:&lt;/p&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Algorithmic Breakthroughs&lt;/span&gt;: Continued progress in model efficiency&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Hardware Specialization&lt;/span&gt;: Next-generation chips optimized for specific AI workloads&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Economic Incentives&lt;/span&gt;: Market mechanisms encouraging efficient resource use&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Global Collaboration&lt;/span&gt;: International efforts to address supply chain vulnerabilities&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-language-override: normal; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Conclusion&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;The &quot;GPU drought&quot; represents a significant but likely transitional phase in AI development. While creating substantial challenges, it is also driving crucial innovations in efficiency and alternative approaches. The organizations that successfully navigate these economic constraints—through technical innovation, strategic partnerships, and operational excellence—will emerge as leaders in the next phase of AI adoption.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/953745312483623762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/12/the-economics-of-ai-cost-optimization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/953745312483623762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/953745312483623762'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/12/the-economics-of-ai-cost-optimization.html' title='The Economics of AI: Cost Optimization and GPU Droughts'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-6128970990519181521</id><published>2025-12-01T23:26:00.000-08:00</published><updated>2025-12-01T23:26:17.527-08:00</updated><title type='text'>Retrieval-Augmented Generation (RAG) Gets Robust: The 2025 Evolution</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p data-end=&quot;664&quot; data-start=&quot;303&quot;&gt;Retrieval-Augmented Generation (RAG) has evolved from a clever hack for enhancing LLM accuracy into a full-fledged architecture powering mission-critical AI systems. In 2025, RAG isn’t just about “retrieving documents before generating answers.” It’s about &lt;strong data-end=&quot;602&quot; data-start=&quot;560&quot;&gt;robustness, reliability, and reasoning&lt;/strong&gt;—three pillars that define the new era of enterprise-grade AI.&lt;/p&gt;
&lt;h2 data-end=&quot;721&quot; data-start=&quot;666&quot;&gt;&lt;strong data-end=&quot;721&quot; data-start=&quot;669&quot;&gt;1. From Basic Retrieval to Intelligent Retrieval&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;816&quot; data-start=&quot;722&quot;&gt;Early RAG systems relied on vector search and keyword matching. Today’s robust RAG stacks use:&lt;/p&gt;
&lt;ul data-end=&quot;1060&quot; data-start=&quot;817&quot;&gt;
&lt;li data-end=&quot;874&quot; data-start=&quot;817&quot;&gt;
&lt;p data-end=&quot;874&quot; data-start=&quot;819&quot;&gt;&lt;strong data-end=&quot;836&quot; data-start=&quot;819&quot;&gt;Hybrid search&lt;/strong&gt; (dense + sparse + metadata filters)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;976&quot; data-start=&quot;875&quot;&gt;
&lt;p data-end=&quot;976&quot; data-start=&quot;877&quot;&gt;&lt;strong data-end=&quot;899&quot; data-start=&quot;877&quot;&gt;Adaptive retrieval&lt;/strong&gt; that adjusts the number and type of documents based on question complexity&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1060&quot; data-start=&quot;977&quot;&gt;
&lt;p data-end=&quot;1060&quot; data-start=&quot;979&quot;&gt;&lt;strong data-end=&quot;1014&quot; data-start=&quot;979&quot;&gt;Query rewriting + decomposition&lt;/strong&gt; to understand intent before pulling context&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1160&quot; data-start=&quot;1062&quot;&gt;This results in &lt;strong data-end=&quot;1095&quot; data-start=&quot;1078&quot;&gt;higher recall&lt;/strong&gt;, fewer hallucinations, and dramatically better answer grounding.&lt;/p&gt;
&lt;h2 data-end=&quot;1207&quot; data-start=&quot;1162&quot;&gt;&lt;strong data-end=&quot;1207&quot; data-start=&quot;1165&quot;&gt;2. Context Becomes Dynamic, Not Static&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;1313&quot; data-start=&quot;1208&quot;&gt;Traditional RAG dumped the same chunked text into the LLM regardless of context.&lt;br data-end=&quot;1291&quot; data-start=&quot;1288&quot; /&gt;
Modern RAG focuses on:&lt;/p&gt;
&lt;ul data-end=&quot;1510&quot; data-start=&quot;1314&quot;&gt;
&lt;li data-end=&quot;1378&quot; data-start=&quot;1314&quot;&gt;
&lt;p data-end=&quot;1378&quot; data-start=&quot;1316&quot;&gt;&lt;strong data-end=&quot;1338&quot; data-start=&quot;1316&quot;&gt;Context re-ranking&lt;/strong&gt; to surface the most reliable evidence&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1446&quot; data-start=&quot;1379&quot;&gt;
&lt;p data-end=&quot;1446&quot; data-start=&quot;1381&quot;&gt;&lt;strong data-end=&quot;1401&quot; data-start=&quot;1381&quot;&gt;Dynamic chunking&lt;/strong&gt; that adjusts chunk size based on semantics&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1510&quot; data-start=&quot;1447&quot;&gt;
&lt;p data-end=&quot;1510&quot; data-start=&quot;1449&quot;&gt;&lt;strong data-end=&quot;1468&quot; data-start=&quot;1449&quot;&gt;Evidence fusion&lt;/strong&gt;, merging insights from multiple sources&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1601&quot; data-start=&quot;1512&quot;&gt;The result: &lt;strong data-end=&quot;1572&quot; data-start=&quot;1524&quot;&gt;tight, relevant, and minimal context windows&lt;/strong&gt;, maximizing LLM performance.&lt;/p&gt;
&lt;h2 data-end=&quot;1654&quot; data-start=&quot;1603&quot;&gt;&lt;strong data-end=&quot;1654&quot; data-start=&quot;1606&quot;&gt;3. Multi-Step Reasoning with Retrieval Loops&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;1858&quot; data-start=&quot;1655&quot;&gt;Robust RAG includes retrieval inside the reasoning loop. Instead of:&lt;br data-end=&quot;1726&quot; data-start=&quot;1723&quot; /&gt;
&lt;strong data-end=&quot;1758&quot; data-start=&quot;1726&quot;&gt;Question → Retrieve → Answer&lt;/strong&gt;,&lt;br data-end=&quot;1762&quot; data-start=&quot;1759&quot; /&gt;
new architectures follow:&lt;br data-end=&quot;1790&quot; data-start=&quot;1787&quot; /&gt;
&lt;strong data-end=&quot;1856&quot; data-start=&quot;1790&quot;&gt;Question → Retrieve → Think → Retrieve Again → Verify → Answer&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;1873&quot; data-start=&quot;1860&quot;&gt;This enables:&lt;/p&gt;
&lt;ul data-end=&quot;1995&quot; data-start=&quot;1874&quot;&gt;
&lt;li data-end=&quot;1897&quot; data-start=&quot;1874&quot;&gt;
&lt;p data-end=&quot;1897&quot; data-start=&quot;1876&quot;&gt;Multi-hop reasoning&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1937&quot; data-start=&quot;1898&quot;&gt;
&lt;p data-end=&quot;1937&quot; data-start=&quot;1900&quot;&gt;Fact-checking and self-verification&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1995&quot; data-start=&quot;1938&quot;&gt;
&lt;p data-end=&quot;1995&quot; data-start=&quot;1940&quot;&gt;Deep technical answers grounded in multiple documents&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-end=&quot;2051&quot; data-start=&quot;1997&quot;&gt;&lt;strong data-end=&quot;2051&quot; data-start=&quot;2000&quot;&gt;4. Robustness Through Memory + Knowledge Graphs&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;2085&quot; data-start=&quot;2052&quot;&gt;Enterprises now combine RAG with:&lt;/p&gt;
&lt;ul data-end=&quot;2184&quot; data-start=&quot;2086&quot;&gt;
&lt;li data-end=&quot;2121&quot; data-start=&quot;2086&quot;&gt;
&lt;p data-end=&quot;2121&quot; data-start=&quot;2088&quot;&gt;&lt;strong data-end=&quot;2119&quot; data-start=&quot;2088&quot;&gt;Structured knowledge graphs&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2153&quot; data-start=&quot;2122&quot;&gt;
&lt;p data-end=&quot;2153&quot; data-start=&quot;2124&quot;&gt;&lt;strong data-end=&quot;2151&quot; data-start=&quot;2124&quot;&gt;Long-term memory layers&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2184&quot; data-start=&quot;2154&quot;&gt;
&lt;p data-end=&quot;2184&quot; data-start=&quot;2156&quot;&gt;&lt;strong data-end=&quot;2182&quot; data-start=&quot;2156&quot;&gt;Entity-aware retrieval&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2298&quot; data-start=&quot;2186&quot;&gt;The LLM understands relationships between concepts, reducing errors and delivering more &lt;strong data-end=&quot;2289&quot; data-start=&quot;2274&quot;&gt;explainable&lt;/strong&gt; answers.&lt;/p&gt;
&lt;h2 data-end=&quot;2347&quot; data-start=&quot;2300&quot;&gt;&lt;strong data-end=&quot;2347&quot; data-start=&quot;2303&quot;&gt;5. RAG Pipelines Become Production-Ready&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;2438&quot; data-start=&quot;2348&quot;&gt;In 2025, companies aren’t stitching together RAG with Python scripts.&lt;br data-end=&quot;2420&quot; data-start=&quot;2417&quot; /&gt;
Instead, they use:&lt;/p&gt;
&lt;ul data-end=&quot;2617&quot; data-start=&quot;2439&quot;&gt;
&lt;li data-end=&quot;2494&quot; data-start=&quot;2439&quot;&gt;
&lt;p data-end=&quot;2494&quot; data-start=&quot;2441&quot;&gt;&lt;strong data-end=&quot;2479&quot; data-start=&quot;2441&quot;&gt;Retrieval orchestration frameworks&lt;/strong&gt; (LLMOps 2.0)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2556&quot; data-start=&quot;2495&quot;&gt;
&lt;p data-end=&quot;2556&quot; data-start=&quot;2497&quot;&gt;&lt;strong data-end=&quot;2525&quot; data-start=&quot;2497&quot;&gt;Observability dashboards&lt;/strong&gt; for detecting hallucinations&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2617&quot; data-start=&quot;2557&quot;&gt;
&lt;p data-end=&quot;2617&quot; data-start=&quot;2559&quot;&gt;&lt;strong data-end=&quot;2580&quot; data-start=&quot;2559&quot;&gt;Guardrail systems&lt;/strong&gt; to enforce compliance and security&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2693&quot; data-start=&quot;2619&quot;&gt;RAG is no longer research—it&#39;s a &lt;strong data-end=&quot;2692&quot; data-start=&quot;2652&quot;&gt;scale-ready infrastructure component&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 data-end=&quot;2728&quot; data-start=&quot;2695&quot;&gt;&lt;strong data-end=&quot;2728&quot; data-start=&quot;2698&quot;&gt;6. Evaluation Gets Serious&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;2757&quot; data-start=&quot;2729&quot;&gt;Robust RAG is measured with:&lt;/p&gt;
&lt;ul data-end=&quot;2906&quot; data-start=&quot;2758&quot;&gt;
&lt;li data-end=&quot;2793&quot; data-start=&quot;2758&quot;&gt;
&lt;p data-end=&quot;2793&quot; data-start=&quot;2760&quot;&gt;&lt;strong data-end=&quot;2791&quot; data-start=&quot;2760&quot;&gt;Factual accuracy benchmarks&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2833&quot; data-start=&quot;2794&quot;&gt;
&lt;p data-end=&quot;2833&quot; data-start=&quot;2796&quot;&gt;&lt;strong data-end=&quot;2831&quot; data-start=&quot;2796&quot;&gt;Hallucination detection metrics&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2868&quot; data-start=&quot;2834&quot;&gt;
&lt;p data-end=&quot;2868&quot; data-start=&quot;2836&quot;&gt;&lt;strong data-end=&quot;2866&quot; data-start=&quot;2836&quot;&gt;Retrieval precision/recall&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2906&quot; data-start=&quot;2869&quot;&gt;
&lt;p data-end=&quot;2906&quot; data-start=&quot;2871&quot;&gt;&lt;strong data-end=&quot;2904&quot; data-start=&quot;2871&quot;&gt;End-to-end task success rates&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3002&quot; data-start=&quot;2908&quot;&gt;Teams invest heavily in &lt;strong data-end=&quot;3001&quot; data-start=&quot;2932&quot;&gt;dataset curation, synthetic data, and automated evaluation agents&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 data-end=&quot;3038&quot; data-start=&quot;3004&quot;&gt;&lt;strong data-end=&quot;3038&quot; data-start=&quot;3007&quot;&gt;7. The Future: RAG + Agents&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;3121&quot; data-start=&quot;3039&quot;&gt;The next step is agentic systems that use RAG not just to answer questions but to:&lt;/p&gt;
&lt;ul data-end=&quot;3229&quot; data-start=&quot;3122&quot;&gt;
&lt;li data-end=&quot;3138&quot; data-start=&quot;3122&quot;&gt;
&lt;p data-end=&quot;3138&quot; data-start=&quot;3124&quot;&gt;Take actions&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3153&quot; data-start=&quot;3139&quot;&gt;
&lt;p data-end=&quot;3153&quot; data-start=&quot;3141&quot;&gt;Plan steps&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3182&quot; data-start=&quot;3154&quot;&gt;
&lt;p data-end=&quot;3182&quot; data-start=&quot;3156&quot;&gt;Pull context iteratively&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3229&quot; data-start=&quot;3183&quot;&gt;
&lt;p data-end=&quot;3229&quot; data-start=&quot;3185&quot;&gt;Perform verification and correction cycles&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3312&quot; data-start=&quot;3231&quot;&gt;This turns RAG into a &lt;strong data-end=&quot;3273&quot; data-start=&quot;3253&quot;&gt;reasoning engine&lt;/strong&gt;, not just a search-plus-generate tool.&lt;/p&gt;
&lt;hr data-end=&quot;3317&quot; data-start=&quot;3314&quot; /&gt;
&lt;h1 data-end=&quot;3335&quot; data-start=&quot;3319&quot;&gt;&lt;strong data-end=&quot;3335&quot; data-start=&quot;3321&quot;&gt;Conclusion&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;3583&quot; data-start=&quot;3336&quot;&gt;RAG is becoming the backbone of reliable AI—&lt;strong data-end=&quot;3427&quot; data-start=&quot;3380&quot;&gt;grounded, explainable, and enterprise-ready&lt;/strong&gt;.&lt;br data-end=&quot;3431&quot; data-start=&quot;3428&quot; /&gt;
In 2025 and beyond, the companies winning with AI aren’t the ones with the largest models—they’re the ones with the most &lt;strong data-end=&quot;3582&quot; data-start=&quot;3552&quot;&gt;robust retrieval pipelines&lt;/strong&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/6128970990519181521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/12/retrieval-augmented-generation-rag-gets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/6128970990519181521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/6128970990519181521'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/12/retrieval-augmented-generation-rag-gets.html' title='Retrieval-Augmented Generation (RAG) Gets Robust: The 2025 Evolution'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-8617910620281530248</id><published>2025-11-28T08:37:09.790-08:00</published><updated>2025-11-28T08:37:34.686-08:00</updated><title type='text'>MLOps 2.0: Taming the LLM Lifecycle</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2 data-end=&quot;192&quot; data-start=&quot;157&quot;&gt;&lt;strong data-end=&quot;192&quot; data-start=&quot;160&quot;&gt;1. Introduction to MLOps 2.0&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;401&quot; data-start=&quot;193&quot;&gt;Traditional MLOps practices were designed around classical ML models: structured data, small artifacts, predictable behavior, and well-defined training pipelines.&lt;br data-end=&quot;358&quot; data-start=&quot;355&quot; /&gt;
LLMs changed everything. Now you deal with:&lt;/p&gt;
&lt;ul data-end=&quot;632&quot; data-start=&quot;403&quot;&gt;
&lt;li data-end=&quot;438&quot; data-start=&quot;403&quot;&gt;
&lt;p data-end=&quot;438&quot; data-start=&quot;405&quot;&gt;Massive model weights (GBs–TBs)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;471&quot; data-start=&quot;439&quot;&gt;
&lt;p data-end=&quot;471&quot; data-start=&quot;441&quot;&gt;Complex distributed training&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;514&quot; data-start=&quot;472&quot;&gt;
&lt;p data-end=&quot;514&quot; data-start=&quot;474&quot;&gt;Data + prompt + parameter interactions&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;571&quot; data-start=&quot;515&quot;&gt;
&lt;p data-end=&quot;571&quot; data-start=&quot;517&quot;&gt;New failure modes (hallucination, drift, jailbreaks)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;632&quot; data-start=&quot;572&quot;&gt;
&lt;p data-end=&quot;632&quot; data-start=&quot;574&quot;&gt;Continuous evaluation instead of simple accuracy metrics&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;774&quot; data-start=&quot;634&quot;&gt;&lt;strong data-end=&quot;647&quot; data-start=&quot;634&quot;&gt;MLOps 2.0&lt;/strong&gt; is the evolution of traditional MLOps to support &lt;strong data-end=&quot;722&quot; data-start=&quot;697&quot;&gt;Large Language Models&lt;/strong&gt;, &lt;strong data-end=&quot;746&quot; data-start=&quot;724&quot;&gt;multimodal systems&lt;/strong&gt;, and &lt;strong data-end=&quot;773&quot; data-start=&quot;752&quot;&gt;agentic workflows&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;779&quot; data-start=&quot;776&quot; /&gt;
&lt;h2 data-end=&quot;821&quot; data-start=&quot;781&quot;&gt;&lt;strong data-end=&quot;821&quot; data-start=&quot;784&quot;&gt;2. The LLM Lifecycle (End-to-End)&lt;/strong&gt;&lt;/h2&gt;
&lt;h3 data-end=&quot;866&quot; data-start=&quot;823&quot;&gt;&lt;strong data-end=&quot;866&quot; data-start=&quot;827&quot;&gt;Stage 1 — Data Engineering for LLMs&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;909&quot; data-start=&quot;867&quot;&gt;LLM data ≠ classical ML data. It includes:&lt;/p&gt;
&lt;ul data-end=&quot;1075&quot; data-start=&quot;911&quot;&gt;
&lt;li data-end=&quot;935&quot; data-start=&quot;911&quot;&gt;
&lt;p data-end=&quot;935&quot; data-start=&quot;913&quot;&gt;Instruction datasets&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;957&quot; data-start=&quot;936&quot;&gt;
&lt;p data-end=&quot;957&quot; data-start=&quot;938&quot;&gt;Conversation logs&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;989&quot; data-start=&quot;958&quot;&gt;
&lt;p data-end=&quot;989&quot; data-start=&quot;960&quot;&gt;Human feedback (RLAIF/RLHF)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1039&quot; data-start=&quot;990&quot;&gt;
&lt;p data-end=&quot;1039&quot; data-start=&quot;992&quot;&gt;Negative examples (unsafe/jailbreak attempts)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1075&quot; data-start=&quot;1040&quot;&gt;
&lt;p data-end=&quot;1075&quot; data-start=&quot;1042&quot;&gt;Synthetic data generation loops&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1092&quot; data-start=&quot;1077&quot;&gt;Key components:&lt;/p&gt;
&lt;ul data-end=&quot;1205&quot; data-start=&quot;1093&quot;&gt;
&lt;li data-end=&quot;1128&quot; data-start=&quot;1093&quot;&gt;
&lt;p data-end=&quot;1128&quot; data-start=&quot;1095&quot;&gt;Data deduplication &amp;amp; clustering&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1160&quot; data-start=&quot;1129&quot;&gt;
&lt;p data-end=&quot;1160&quot; data-start=&quot;1131&quot;&gt;Toxicity &amp;amp; safety filtering&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1180&quot; data-start=&quot;1161&quot;&gt;
&lt;p data-end=&quot;1180&quot; data-start=&quot;1163&quot;&gt;Quality scoring&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1205&quot; data-start=&quot;1181&quot;&gt;
&lt;p data-end=&quot;1205&quot; data-start=&quot;1183&quot;&gt;Long-tail enrichment&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1282&quot; data-start=&quot;1207&quot;&gt;&lt;strong data-end=&quot;1217&quot; data-start=&quot;1207&quot;&gt;Tools:&lt;/strong&gt; HuggingFace Datasets, Databricks, Snowflake, Truelens, Cleanlab.&lt;/p&gt;
&lt;hr data-end=&quot;1287&quot; data-start=&quot;1284&quot; /&gt;
&lt;h3 data-end=&quot;1337&quot; data-start=&quot;1289&quot;&gt;&lt;strong data-end=&quot;1337&quot; data-start=&quot;1293&quot;&gt;Stage 2 — Model Selection &amp;amp; Architecture&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;1356&quot; data-start=&quot;1338&quot;&gt;Decisions include:&lt;/p&gt;
&lt;ul data-end=&quot;1556&quot; data-start=&quot;1358&quot;&gt;
&lt;li data-end=&quot;1412&quot; data-start=&quot;1358&quot;&gt;
&lt;p data-end=&quot;1412&quot; data-start=&quot;1360&quot;&gt;Base model (OpenAI, Claude, Llama, Gemma, Mistral)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1442&quot; data-start=&quot;1413&quot;&gt;
&lt;p data-end=&quot;1442&quot; data-start=&quot;1415&quot;&gt;On-prem, cloud, or hybrid&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1469&quot; data-start=&quot;1443&quot;&gt;
&lt;p data-end=&quot;1469&quot; data-start=&quot;1445&quot;&gt;Embedding model choice&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1517&quot; data-start=&quot;1470&quot;&gt;
&lt;p data-end=&quot;1517&quot; data-start=&quot;1472&quot;&gt;Quantization level (BF16, FP8, Q4_K_M, AWQ)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1556&quot; data-start=&quot;1518&quot;&gt;
&lt;p data-end=&quot;1556&quot; data-start=&quot;1520&quot;&gt;LoRA / QLoRA / AdapterFusion setup&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1577&quot; data-start=&quot;1558&quot;&gt;This stage defines:&lt;/p&gt;
&lt;ul data-end=&quot;1655&quot; data-start=&quot;1578&quot;&gt;
&lt;li data-end=&quot;1605&quot; data-start=&quot;1578&quot;&gt;
&lt;p data-end=&quot;1605&quot; data-start=&quot;1580&quot;&gt;Performance vs. latency&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1627&quot; data-start=&quot;1606&quot;&gt;
&lt;p data-end=&quot;1627&quot; data-start=&quot;1608&quot;&gt;Cost vs. accuracy&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1655&quot; data-start=&quot;1628&quot;&gt;
&lt;p data-end=&quot;1655&quot; data-start=&quot;1630&quot;&gt;Openness vs. compliance&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1660&quot; data-start=&quot;1657&quot; /&gt;
&lt;h3 data-end=&quot;1703&quot; data-start=&quot;1662&quot;&gt;&lt;strong data-end=&quot;1703&quot; data-start=&quot;1666&quot;&gt;Stage 3 — Fine-Tuning &amp;amp; Alignment&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;1721&quot; data-start=&quot;1704&quot;&gt;Modern pipelines:&lt;/p&gt;
&lt;h4 data-end=&quot;1763&quot; data-start=&quot;1723&quot;&gt;&lt;strong data-end=&quot;1763&quot; data-start=&quot;1728&quot;&gt;1. Supervised Fine-Tuning (SFT)&lt;/strong&gt;&lt;/h4&gt;
&lt;ul data-end=&quot;1849&quot; data-start=&quot;1764&quot;&gt;
&lt;li data-end=&quot;1790&quot; data-start=&quot;1764&quot;&gt;
&lt;p data-end=&quot;1790&quot; data-start=&quot;1766&quot;&gt;Task-specific datasets&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1827&quot; data-start=&quot;1791&quot;&gt;
&lt;p data-end=&quot;1827&quot; data-start=&quot;1793&quot;&gt;Role-specific instruction tuning&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1849&quot; data-start=&quot;1828&quot;&gt;
&lt;p data-end=&quot;1849&quot; data-start=&quot;1830&quot;&gt;Domain adaptation&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 data-end=&quot;1875&quot; data-start=&quot;1851&quot;&gt;&lt;strong data-end=&quot;1875&quot; data-start=&quot;1856&quot;&gt;2. RLHF / RLAIF&lt;/strong&gt;&lt;/h4&gt;
&lt;ul data-end=&quot;1992&quot; data-start=&quot;1876&quot;&gt;
&lt;li data-end=&quot;1920&quot; data-start=&quot;1876&quot;&gt;
&lt;p data-end=&quot;1920&quot; data-start=&quot;1878&quot;&gt;Human or model-generated preference data&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1946&quot; data-start=&quot;1921&quot;&gt;
&lt;p data-end=&quot;1946&quot; data-start=&quot;1923&quot;&gt;Reward model training&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1992&quot; data-start=&quot;1947&quot;&gt;
&lt;p data-end=&quot;1992&quot; data-start=&quot;1949&quot;&gt;Proximal Policy Optimization (PPO) or DPO&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 data-end=&quot;2019&quot; data-start=&quot;1994&quot;&gt;&lt;strong data-end=&quot;2019&quot; data-start=&quot;1999&quot;&gt;3. Memory Tuning&lt;/strong&gt;&lt;/h4&gt;
&lt;ul data-end=&quot;2113&quot; data-start=&quot;2020&quot;&gt;
&lt;li data-end=&quot;2055&quot; data-start=&quot;2020&quot;&gt;
&lt;p data-end=&quot;2055&quot; data-start=&quot;2022&quot;&gt;Retrieval-augmented fine-tuning&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2113&quot; data-start=&quot;2056&quot;&gt;
&lt;p data-end=&quot;2113&quot; data-start=&quot;2058&quot;&gt;Model + embeddings + vector store = hybrid intelligence&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 data-end=&quot;2143&quot; data-start=&quot;2115&quot;&gt;&lt;strong data-end=&quot;2143&quot; data-start=&quot;2120&quot;&gt;4. Guardrail Tuning&lt;/strong&gt;&lt;/h4&gt;
&lt;ul data-end=&quot;2205&quot; data-start=&quot;2144&quot;&gt;
&lt;li data-end=&quot;2161&quot; data-start=&quot;2144&quot;&gt;
&lt;p data-end=&quot;2161&quot; data-start=&quot;2146&quot;&gt;Safety layers&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2181&quot; data-start=&quot;2162&quot;&gt;
&lt;p data-end=&quot;2181&quot; data-start=&quot;2164&quot;&gt;Content filters&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2205&quot; data-start=&quot;2182&quot;&gt;
&lt;p data-end=&quot;2205&quot; data-start=&quot;2184&quot;&gt;Jailbreak hardening&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2210&quot; data-start=&quot;2207&quot; /&gt;
&lt;h3 data-end=&quot;2273&quot; data-start=&quot;2212&quot;&gt;&lt;strong data-end=&quot;2273&quot; data-start=&quot;2216&quot;&gt;Stage 4 — Retrieval &amp;amp; Knowledge Integration (RAG 2.0)&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;2301&quot; data-start=&quot;2274&quot;&gt;Modern LLM systems require:&lt;/p&gt;
&lt;ul data-end=&quot;2499&quot; data-start=&quot;2303&quot;&gt;
&lt;li data-end=&quot;2361&quot; data-start=&quot;2303&quot;&gt;
&lt;p data-end=&quot;2361&quot; data-start=&quot;2305&quot;&gt;Chunking strategies (semantic, hierarchical, windowed)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2401&quot; data-start=&quot;2362&quot;&gt;
&lt;p data-end=&quot;2401&quot; data-start=&quot;2364&quot;&gt;Indexing (dense + sparse OR hybrid)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2443&quot; data-start=&quot;2402&quot;&gt;
&lt;p data-end=&quot;2443&quot; data-start=&quot;2404&quot;&gt;Re-ranking (Cross-encoder re-rankers)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2463&quot; data-start=&quot;2444&quot;&gt;
&lt;p data-end=&quot;2463&quot; data-start=&quot;2446&quot;&gt;Context caching&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2499&quot; data-start=&quot;2464&quot;&gt;
&lt;p data-end=&quot;2499&quot; data-start=&quot;2466&quot;&gt;Query rewriting / decomposition&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2543&quot; data-start=&quot;2501&quot;&gt;&lt;strong data-end=&quot;2543&quot; data-start=&quot;2501&quot;&gt;RAG 2.0 = RAG + Agent + Memory + Tools&lt;/strong&gt;&lt;/p&gt;
&lt;hr data-end=&quot;2548&quot; data-start=&quot;2545&quot; /&gt;
&lt;h3 data-end=&quot;2593&quot; data-start=&quot;2550&quot;&gt;&lt;strong data-end=&quot;2593&quot; data-start=&quot;2554&quot;&gt;Stage 5 — Inference &amp;amp; Orchestration&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;2622&quot; data-start=&quot;2594&quot;&gt;Handling inference at scale:&lt;/p&gt;
&lt;ul data-end=&quot;2836&quot; data-start=&quot;2624&quot;&gt;
&lt;li data-end=&quot;2657&quot; data-start=&quot;2624&quot;&gt;
&lt;p data-end=&quot;2657&quot; data-start=&quot;2626&quot;&gt;Sharded inference across GPUs&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2698&quot; data-start=&quot;2658&quot;&gt;
&lt;p data-end=&quot;2698&quot; data-start=&quot;2660&quot;&gt;Token streaming for user-facing apps&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2723&quot; data-start=&quot;2699&quot;&gt;
&lt;p data-end=&quot;2723&quot; data-start=&quot;2701&quot;&gt;Speculative decoding&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2769&quot; data-start=&quot;2724&quot;&gt;
&lt;p data-end=&quot;2769&quot; data-start=&quot;2726&quot;&gt;Caching layers (Prompt caches, KV caches)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2798&quot; data-start=&quot;2770&quot;&gt;
&lt;p data-end=&quot;2798&quot; data-start=&quot;2772&quot;&gt;Autoscaling GPU clusters&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2836&quot; data-start=&quot;2799&quot;&gt;
&lt;p data-end=&quot;2836&quot; data-start=&quot;2801&quot;&gt;Cost-aware routing between models&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2890&quot; data-start=&quot;2838&quot;&gt;Frameworks: vLLM, TGI, Ray Serve, Sagemaker, KServe.&lt;/p&gt;
&lt;hr data-end=&quot;2895&quot; data-start=&quot;2892&quot; /&gt;
&lt;h3 data-end=&quot;2941&quot; data-start=&quot;2897&quot;&gt;&lt;strong data-end=&quot;2941&quot; data-start=&quot;2901&quot;&gt;Stage 6 — Evaluation &amp;amp; Observability&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;2983&quot; data-start=&quot;2942&quot;&gt;Evaluation for LLMs requires new metrics:&lt;/p&gt;
&lt;ul data-end=&quot;3242&quot; data-start=&quot;2985&quot;&gt;
&lt;li data-end=&quot;3033&quot; data-start=&quot;2985&quot;&gt;
&lt;p data-end=&quot;3033&quot; data-start=&quot;2987&quot;&gt;&lt;strong data-end=&quot;3004&quot; data-start=&quot;2987&quot;&gt;Task accuracy&lt;/strong&gt; (exact match, BLEU, ROUGE)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3085&quot; data-start=&quot;3034&quot;&gt;
&lt;p data-end=&quot;3085&quot; data-start=&quot;3036&quot;&gt;&lt;strong data-end=&quot;3046&quot; data-start=&quot;3036&quot;&gt;Safety&lt;/strong&gt; (toxicity, hallucination likelihood)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3136&quot; data-start=&quot;3086&quot;&gt;
&lt;p data-end=&quot;3136&quot; data-start=&quot;3088&quot;&gt;&lt;strong data-end=&quot;3107&quot; data-start=&quot;3088&quot;&gt;Reasoning depth&lt;/strong&gt; (chain-of-thought quality)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3178&quot; data-start=&quot;3137&quot;&gt;
&lt;p data-end=&quot;3178&quot; data-start=&quot;3139&quot;&gt;&lt;strong data-end=&quot;3154&quot; data-start=&quot;3139&quot;&gt;Consistency&lt;/strong&gt; (multi-run stability)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3219&quot; data-start=&quot;3179&quot;&gt;
&lt;p data-end=&quot;3219&quot; data-start=&quot;3181&quot;&gt;&lt;strong data-end=&quot;3192&quot; data-start=&quot;3181&quot;&gt;Latency&lt;/strong&gt; (TTFT, TPOT, throughput)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3242&quot; data-start=&quot;3220&quot;&gt;
&lt;p data-end=&quot;3242&quot; data-start=&quot;3222&quot;&gt;&lt;strong data-end=&quot;3240&quot; data-start=&quot;3222&quot;&gt;Cost per token&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3269&quot; data-start=&quot;3244&quot;&gt;Observability components:&lt;/p&gt;
&lt;ul data-end=&quot;3375&quot; data-start=&quot;3271&quot;&gt;
&lt;li data-end=&quot;3286&quot; data-start=&quot;3271&quot;&gt;
&lt;p data-end=&quot;3286&quot; data-start=&quot;3273&quot;&gt;Prompt logs&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3302&quot; data-start=&quot;3287&quot;&gt;
&lt;p data-end=&quot;3302&quot; data-start=&quot;3289&quot;&gt;Token usage&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3322&quot; data-start=&quot;3303&quot;&gt;
&lt;p data-end=&quot;3322&quot; data-start=&quot;3305&quot;&gt;Drift detection&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3353&quot; data-start=&quot;3323&quot;&gt;
&lt;p data-end=&quot;3353&quot; data-start=&quot;3325&quot;&gt;Safety violation detection&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3375&quot; data-start=&quot;3354&quot;&gt;
&lt;p data-end=&quot;3375&quot; data-start=&quot;3356&quot;&gt;RAG hit/miss rate&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3437&quot; data-start=&quot;3377&quot;&gt;Tools: Weights &amp;amp; Biases, Arize, Humanloop, TruLens, WhyLabs.&lt;/p&gt;
&lt;hr data-end=&quot;3442&quot; data-start=&quot;3439&quot; /&gt;
&lt;h3 data-end=&quot;3489&quot; data-start=&quot;3444&quot;&gt;&lt;strong data-end=&quot;3489&quot; data-start=&quot;3448&quot;&gt;Stage 7 — Deployment &amp;amp; CI/CD for LLMs&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;3511&quot; data-start=&quot;3490&quot;&gt;MLOps 2.0 introduces:&lt;/p&gt;
&lt;h4 data-end=&quot;3537&quot; data-start=&quot;3513&quot;&gt;&lt;strong data-end=&quot;3537&quot; data-start=&quot;3518&quot;&gt;1. Prompt CI/CD&lt;/strong&gt;&lt;/h4&gt;
&lt;ul data-end=&quot;3633&quot; data-start=&quot;3538&quot;&gt;
&lt;li data-end=&quot;3559&quot; data-start=&quot;3538&quot;&gt;
&lt;p data-end=&quot;3559&quot; data-start=&quot;3540&quot;&gt;Versioned prompts&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3575&quot; data-start=&quot;3560&quot;&gt;
&lt;p data-end=&quot;3575&quot; data-start=&quot;3562&quot;&gt;A/B testing&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3594&quot; data-start=&quot;3576&quot;&gt;
&lt;p data-end=&quot;3594&quot; data-start=&quot;3578&quot;&gt;Canary rollout&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3633&quot; data-start=&quot;3595&quot;&gt;
&lt;p data-end=&quot;3633&quot; data-start=&quot;3597&quot;&gt;Prompt linting and static analysis&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 data-end=&quot;3655&quot; data-start=&quot;3635&quot;&gt;&lt;strong data-end=&quot;3655&quot; data-start=&quot;3640&quot;&gt;2. Model CI&lt;/strong&gt;&lt;/h4&gt;
&lt;ul data-end=&quot;3737&quot; data-start=&quot;3656&quot;&gt;
&lt;li data-end=&quot;3671&quot; data-start=&quot;3656&quot;&gt;
&lt;p data-end=&quot;3671&quot; data-start=&quot;3658&quot;&gt;Model cards&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3697&quot; data-start=&quot;3672&quot;&gt;
&lt;p data-end=&quot;3697&quot; data-start=&quot;3674&quot;&gt;Linting safety checks&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3737&quot; data-start=&quot;3698&quot;&gt;
&lt;p data-end=&quot;3737&quot; data-start=&quot;3700&quot;&gt;Regression testing on eval datasets&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 data-end=&quot;3768&quot; data-start=&quot;3739&quot;&gt;&lt;strong data-end=&quot;3768&quot; data-start=&quot;3744&quot;&gt;3. Infrastructure CI&lt;/strong&gt;&lt;/h4&gt;
&lt;ul data-end=&quot;3852&quot; data-start=&quot;3769&quot;&gt;
&lt;li data-end=&quot;3797&quot; data-start=&quot;3769&quot;&gt;
&lt;p data-end=&quot;3797&quot; data-start=&quot;3771&quot;&gt;Autoscaling GPU clusters&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3825&quot; data-start=&quot;3798&quot;&gt;
&lt;p data-end=&quot;3825&quot; data-start=&quot;3800&quot;&gt;Dependency graph checks&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3852&quot; data-start=&quot;3826&quot;&gt;
&lt;p data-end=&quot;3852&quot; data-start=&quot;3828&quot;&gt;Vector DB schema tests&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;3857&quot; data-start=&quot;3854&quot; /&gt;
&lt;h3 data-end=&quot;3900&quot; data-start=&quot;3859&quot;&gt;&lt;strong data-end=&quot;3900&quot; data-start=&quot;3863&quot;&gt;Stage 8 — Governance &amp;amp; Compliance&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;3920&quot; data-start=&quot;3901&quot;&gt;Organizations need:&lt;/p&gt;
&lt;ul data-end=&quot;4085&quot; data-start=&quot;3922&quot;&gt;
&lt;li data-end=&quot;3936&quot; data-start=&quot;3922&quot;&gt;
&lt;p data-end=&quot;3936&quot; data-start=&quot;3924&quot;&gt;Audit logs&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3953&quot; data-start=&quot;3937&quot;&gt;
&lt;p data-end=&quot;3953&quot; data-start=&quot;3939&quot;&gt;Data lineage&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3984&quot; data-start=&quot;3954&quot;&gt;
&lt;p data-end=&quot;3984&quot; data-start=&quot;3956&quot;&gt;Access controls for models&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4026&quot; data-start=&quot;3985&quot;&gt;
&lt;p data-end=&quot;4026&quot; data-start=&quot;3987&quot;&gt;PII scrubbing in training &amp;amp; inference&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4085&quot; data-start=&quot;4027&quot;&gt;
&lt;p data-end=&quot;4085&quot; data-start=&quot;4029&quot;&gt;License compliance (open-source vs. commercial models)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;4114&quot; data-start=&quot;4087&quot;&gt;Regulations impacting LLMs:&lt;/p&gt;
&lt;ul data-end=&quot;4181&quot; data-start=&quot;4115&quot;&gt;
&lt;li data-end=&quot;4128&quot; data-start=&quot;4115&quot;&gt;
&lt;p data-end=&quot;4128&quot; data-start=&quot;4117&quot;&gt;EU AI Act&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4153&quot; data-start=&quot;4129&quot;&gt;
&lt;p data-end=&quot;4153&quot; data-start=&quot;4131&quot;&gt;Digital Services Act&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4163&quot; data-start=&quot;4154&quot;&gt;
&lt;p data-end=&quot;4163&quot; data-start=&quot;4156&quot;&gt;HIPAA&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4172&quot; data-start=&quot;4164&quot;&gt;
&lt;p data-end=&quot;4172&quot; data-start=&quot;4166&quot;&gt;SOC2&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4181&quot; data-start=&quot;4173&quot;&gt;
&lt;p data-end=&quot;4181&quot; data-start=&quot;4175&quot;&gt;GDPR&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;4186&quot; data-start=&quot;4183&quot; /&gt;
&lt;h2 data-end=&quot;4232&quot; data-start=&quot;4188&quot;&gt;&lt;strong data-end=&quot;4232&quot; data-start=&quot;4191&quot;&gt;3. MLOps 2.0 Architecture (Blueprint)&lt;/strong&gt;&lt;/h2&gt;
&lt;h3 data-end=&quot;4253&quot; data-start=&quot;4234&quot;&gt;&lt;strong data-end=&quot;4253&quot; data-start=&quot;4238&quot;&gt;Core Layers&lt;/strong&gt;&lt;/h3&gt;
&lt;ol data-end=&quot;4468&quot; data-start=&quot;4254&quot;&gt;
&lt;li data-end=&quot;4276&quot; data-start=&quot;4254&quot;&gt;
&lt;p data-end=&quot;4276&quot; data-start=&quot;4257&quot;&gt;&lt;strong data-end=&quot;4274&quot; data-start=&quot;4257&quot;&gt;Data Platform&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4300&quot; data-start=&quot;4277&quot;&gt;
&lt;p data-end=&quot;4300&quot; data-start=&quot;4280&quot;&gt;&lt;strong data-end=&quot;4298&quot; data-start=&quot;4280&quot;&gt;Model Platform&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4331&quot; data-start=&quot;4301&quot;&gt;
&lt;p data-end=&quot;4331&quot; data-start=&quot;4304&quot;&gt;&lt;strong data-end=&quot;4329&quot; data-start=&quot;4304&quot;&gt;Prompt &amp;amp; RAG Platform&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4359&quot; data-start=&quot;4332&quot;&gt;
&lt;p data-end=&quot;4359&quot; data-start=&quot;4335&quot;&gt;&lt;strong data-end=&quot;4357&quot; data-start=&quot;4335&quot;&gt;Inference Platform&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4401&quot; data-start=&quot;4360&quot;&gt;
&lt;p data-end=&quot;4401&quot; data-start=&quot;4363&quot;&gt;&lt;strong data-end=&quot;4399&quot; data-start=&quot;4363&quot;&gt;Evaluation &amp;amp; Monitoring Platform&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4427&quot; data-start=&quot;4402&quot;&gt;
&lt;p data-end=&quot;4427&quot; data-start=&quot;4405&quot;&gt;&lt;strong data-end=&quot;4425&quot; data-start=&quot;4405&quot;&gt;Governance Layer&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4468&quot; data-start=&quot;4428&quot;&gt;
&lt;p data-end=&quot;4468&quot; data-start=&quot;4431&quot;&gt;&lt;strong data-end=&quot;4466&quot; data-start=&quot;4431&quot;&gt;Developer Experience Layer (DX)&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 data-end=&quot;4499&quot; data-start=&quot;4470&quot;&gt;&lt;strong data-end=&quot;4499&quot; data-start=&quot;4474&quot;&gt;Integrated Components&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;4625&quot; data-start=&quot;4500&quot;&gt;
&lt;li data-end=&quot;4540&quot; data-start=&quot;4500&quot;&gt;
&lt;p data-end=&quot;4540&quot; data-start=&quot;4502&quot;&gt;Unified Feature Store for embeddings&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4560&quot; data-start=&quot;4541&quot;&gt;
&lt;p data-end=&quot;4560&quot; data-start=&quot;4543&quot;&gt;Prompt registry&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4579&quot; data-start=&quot;4561&quot;&gt;
&lt;p data-end=&quot;4579&quot; data-start=&quot;4563&quot;&gt;Model registry&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4604&quot; data-start=&quot;4580&quot;&gt;
&lt;p data-end=&quot;4604&quot; data-start=&quot;4582&quot;&gt;Evaluation dashboard&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4625&quot; data-start=&quot;4605&quot;&gt;
&lt;p data-end=&quot;4625&quot; data-start=&quot;4607&quot;&gt;Guardrail engine&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;4630&quot; data-start=&quot;4627&quot; /&gt;
&lt;h2 data-end=&quot;4672&quot; data-start=&quot;4632&quot;&gt;&lt;strong data-end=&quot;4672&quot; data-start=&quot;4635&quot;&gt;4. MLOps 2.0 vs Traditional MLOps&lt;/strong&gt;&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;5171&quot; data-start=&quot;4674&quot;&gt;&lt;thead data-end=&quot;4713&quot; data-start=&quot;4674&quot;&gt;&lt;tr data-end=&quot;4713&quot; data-start=&quot;4674&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;4681&quot; data-start=&quot;4674&quot;&gt;Area&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;4693&quot; data-start=&quot;4681&quot;&gt;MLOps 1.0&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;4713&quot; data-start=&quot;4693&quot;&gt;MLOps 2.0 (LLMs)&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;5171&quot; data-start=&quot;4754&quot;&gt;&lt;tr data-end=&quot;4804&quot; data-start=&quot;4754&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4761&quot; data-start=&quot;4754&quot;&gt;Data&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4778&quot; data-start=&quot;4761&quot;&gt;Tabular, small&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4804&quot; data-start=&quot;4778&quot;&gt;Text, multimodal, huge&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4863&quot; data-start=&quot;4805&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4816&quot; data-start=&quot;4805&quot;&gt;Training&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4838&quot; data-start=&quot;4816&quot;&gt;Offline, infrequent&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4863&quot; data-start=&quot;4838&quot;&gt;Continuous adaptation&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4924&quot; data-start=&quot;4864&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4877&quot; data-start=&quot;4864&quot;&gt;Evaluation&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4888&quot; data-start=&quot;4877&quot;&gt;Accuracy&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4924&quot; data-start=&quot;4888&quot;&gt;Hallucination, safety, reasoning&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4976&quot; data-start=&quot;4925&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4938&quot; data-start=&quot;4925&quot;&gt;Deployment&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4953&quot; data-start=&quot;4938&quot;&gt;Single model&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4976&quot; data-start=&quot;4953&quot;&gt;Model + RAG + Tools&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5046&quot; data-start=&quot;4977&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4990&quot; data-start=&quot;4977&quot;&gt;Monitoring&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5010&quot; data-start=&quot;4990&quot;&gt;Latency &amp;amp; metrics&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5046&quot; data-start=&quot;5010&quot;&gt;Prompt drift, jailbreaks, misuse&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5108&quot; data-start=&quot;5047&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5060&quot; data-start=&quot;5047&quot;&gt;Versioning&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5075&quot; data-start=&quot;5060&quot;&gt;Code + model&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5108&quot; data-start=&quot;5075&quot;&gt;Code + model + data + prompts&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5171&quot; data-start=&quot;5109&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5122&quot; data-start=&quot;5109&quot;&gt;Governance&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5140&quot; data-start=&quot;5122&quot;&gt;Basic ML policy&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5171&quot; data-start=&quot;5140&quot;&gt;Full AI compliance &amp;amp; audits&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;5176&quot; data-start=&quot;5173&quot; /&gt;
&lt;h2 data-end=&quot;5216&quot; data-start=&quot;5178&quot;&gt;&lt;strong data-end=&quot;5216&quot; data-start=&quot;5181&quot;&gt;5. Future: MLOps 3.0 (AgentOps)&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;5253&quot; data-start=&quot;5217&quot;&gt;A preview of where things are going:&lt;/p&gt;
&lt;ul data-end=&quot;5419&quot; data-start=&quot;5255&quot;&gt;
&lt;li data-end=&quot;5290&quot; data-start=&quot;5255&quot;&gt;
&lt;p data-end=&quot;5290&quot; data-start=&quot;5257&quot;&gt;Autonomous agents with tool use&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5325&quot; data-start=&quot;5291&quot;&gt;
&lt;p data-end=&quot;5325&quot; data-start=&quot;5293&quot;&gt;Live memory + dynamic planning&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5355&quot; data-start=&quot;5326&quot;&gt;
&lt;p data-end=&quot;5355&quot; data-start=&quot;5328&quot;&gt;Multi-model orchestration&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5382&quot; data-start=&quot;5356&quot;&gt;
&lt;p data-end=&quot;5382&quot; data-start=&quot;5358&quot;&gt;Self-healing pipelines&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5419&quot; data-start=&quot;5383&quot;&gt;
&lt;p data-end=&quot;5419&quot; data-start=&quot;5385&quot;&gt;Continual learning in production&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/8617910620281530248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/11/mlops-20-taming-llm-lifecycle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/8617910620281530248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/8617910620281530248'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/11/mlops-20-taming-llm-lifecycle.html' title='MLOps 2.0: Taming the LLM Lifecycle'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-6864609319377318171</id><published>2025-11-22T00:17:00.000-08:00</published><updated>2025-11-22T00:17:26.081-08:00</updated><title type='text'>The Rise of Small Language Models: A Practical Guide to Choosing SLMs Over Giants</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;If we’ve been following the AI space, it feels like the narrative has been dominated by one thing:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; font-weight: 600; text-shadow: none;&quot;&gt;bigger is better&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;. We&#39;ve watched parameter counts soar into the hundreds of billions, with each new model claiming to be more powerful than the last.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;But a quiet, revolutionary counter-trend is gaining massive momentum:&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Small Language Models (SLMs)&lt;/span&gt;.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;Models like Microsoft&#39;s Phi-3, Meta&#39;s Llama 3, and Mistral 7B are demonstrating that you don&#39;t always need a nuclear reactor to power a lightbulb. These smaller, more refined models are proving to be highly effective for a vast range of specific tasks, offering a compelling alternative to their gargantuan counterparts.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;The question is no longer&amp;nbsp;&lt;em style=&quot;box-sizing: border-box;&quot;&gt;&quot;What&#39;s the most powerful model?&quot;&lt;/em&gt;&amp;nbsp;but rather&amp;nbsp;&lt;em style=&quot;box-sizing: border-box;&quot;&gt;&quot;What&#39;s the most appropriate model for my specific need?&quot;&lt;/em&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;This guide will walk you through the key trade-offs—cost, latency, and data privacy—to help you decide when an SLM is the right tool for the job.&lt;/p&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px; text-shadow: none;&quot;&gt;What Exactly is a Small Language Model (SLM)?&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;An SLM is a language model that is significantly smaller in parameter count (typically ranging from a few hundred million to around 10 billion parameters) and computational footprint than massive foundation models like GPT-4 or Claude 3 Opus. Their power doesn&#39;t come from brute-force scaling but from:&lt;/p&gt;&lt;ul style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Better, Curated Training Data:&lt;/span&gt;&amp;nbsp;Models like Phi-3 are trained on meticulously filtered, high-quality &quot;textbook-quality&quot; data, which leads to more efficient learning.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Innovative Architectures:&lt;/span&gt;&amp;nbsp;Techniques like sliding window attention (from Mistral) and other optimizations make these models smarter with fewer resources.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Strategic Fine-Tuning:&lt;/span&gt;&amp;nbsp;They are often designed and fine-tuned for specific domains or tasks from the outset.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px; text-shadow: none;&quot;&gt;When to Choose an SLM: The Three-Way Trade-Off&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;Choosing between an SLM and a large foundation model is a balancing act. Here’s your decision-making framework.&lt;/p&gt;&lt;h4 style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 16px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 28px; margin: 16px 0px 8px; text-shadow: none;&quot;&gt;1. Cost: The Bottom Line&lt;/h4&gt;&lt;ul style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 8px 0px 16px; padding-left: 18px;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;The Problem with Giants:&lt;/span&gt;&amp;nbsp;Running inference on a model with hundreds of billions of parameters is incredibly expensive. Every API call adds up, and the costs for fine-tuning or training are astronomical. This can quickly become prohibitive for startups, SMEs, or projects with a tight budget.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px 0px 8px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;The SLM Advantage:&lt;/span&gt;&amp;nbsp;SLMs are dramatically cheaper to run. You can host a powerful 7B-parameter model on a single, affordable GPU instance (or even on CPU). This makes them perfect for:&lt;/p&gt;&lt;ul style=&quot;box-sizing: border-box; font-size: 0.812rem; margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;High-Volume Tasks:&lt;/span&gt;&amp;nbsp;Applications that require thousands or millions of API calls per day.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Prototyping and MVPs:&lt;/span&gt;&amp;nbsp;Testing an AI feature without burning through your seed funding.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Cost-Sensitive Production Workloads:&lt;/span&gt;&amp;nbsp;Any application where the cost per query is a primary concern.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote style=&quot;background-color: white; border-left: 2px solid rgb(173, 178, 184); box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 0px; padding-left: 14px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Choose an SLM when:&lt;/span&gt;&amp;nbsp;Your project is budget-conscious or requires a positive unit economics where the cost of the AI call is a small fraction of the value it provides.&lt;/p&gt;&lt;/blockquote&gt;&lt;h4 style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 16px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 28px; margin: 16px 0px 8px; text-shadow: none;&quot;&gt;2. Latency &amp;amp; Speed: The Need for Speed&lt;/h4&gt;&lt;ul style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 8px 0px 16px; padding-left: 18px;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;The Problem with Giants:&lt;/span&gt;&amp;nbsp;Large models are slow. Processing a single request can take several seconds, as it requires moving massive amounts of data through the model. This leads to high latency, which can ruin user experience in real-time applications.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px 0px 8px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;The SLM Advantage:&lt;/span&gt;&amp;nbsp;With their smaller size, SLMs offer lightning-fast inference. Response times can be in the low milliseconds. This is critical for:&lt;/p&gt;&lt;ul style=&quot;box-sizing: border-box; font-size: 0.812rem; margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Real-Time Applications:&lt;/span&gt;&amp;nbsp;Live chatbots, customer service interfaces, or interactive assistants where a delay of even one second feels sluggish.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Edge Computing:&lt;/span&gt;&amp;nbsp;Deploying AI directly on devices like phones, laptops, or IoT hardware where resources are limited and instant response is key.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;User-Facing Features:&lt;/span&gt;&amp;nbsp;Any application where a snappy, responsive feel is crucial for adoption.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote style=&quot;background-color: white; border-left: 2px solid rgb(173, 178, 184); box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 0px; padding-left: 14px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Choose an SLM when:&lt;/span&gt;&amp;nbsp;Your application demands low latency and a fast, seamless user experience.&lt;/p&gt;&lt;/blockquote&gt;&lt;h4 style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 16px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 28px; margin: 16px 0px 8px; text-shadow: none;&quot;&gt;3. Data Privacy &amp;amp; Control: Keeping It In-House&lt;/h4&gt;&lt;ul style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 8px 0px 16px; padding-left: 18px;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;The Problem with Giants:&lt;/span&gt;&amp;nbsp;When you use an API from a major provider, your data (including potentially sensitive prompts and outputs) is sent to a third-party server. For industries like healthcare, legal, and finance, this is a non-starter due to compliance regulations (HIPAA, GDPR) and intellectual property concerns.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px 0px 8px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;The SLM Advantage:&lt;/span&gt;&amp;nbsp;You can run SLMs entirely on your own infrastructure—be it your company&#39;s private cloud, a secure on-premise server, or even a fully air-gapped environment. This gives you full control and ownership over your data.&lt;/p&gt;&lt;ul style=&quot;box-sizing: border-box; font-size: 0.812rem; margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Use Cases:&lt;/span&gt;&amp;nbsp;Processing confidential legal documents, analyzing private patient data, generating internal financial reports.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote style=&quot;background-color: white; border-left: 2px solid rgb(173, 178, 184); box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 0px; padding-left: 14px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Choose an SLM when:&lt;/span&gt;&amp;nbsp;Data privacy, security, and regulatory compliance are top priorities.&lt;/p&gt;&lt;/blockquote&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px; text-shadow: none;&quot;&gt;And When Should You Still Use a Giant Foundation Model?&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;SLMs are brilliant, but they aren&#39;t magical. There are still clear scenarios where a large foundation model is the undisputed champion:&lt;/p&gt;&lt;ul style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;For Complex, Creative, or Open-Ended Tasks:&lt;/span&gt;&amp;nbsp;If you need highly creative writing, complex reasoning across multiple domains, or nuanced conversation that feels truly human, larger models still have the edge.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;As a &quot;Generalist&quot; Brain:&lt;/span&gt;&amp;nbsp;If you&#39;re building a product that needs to be a jack-of-all-trades—handling everything from code generation to poetry to complex analysis in a single interface—a larger model provides more consistent quality across this broad spectrum.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.8; margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;box-sizing: border-box; font-size: 0.812rem; line-height: 1.3rem; margin: 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;When You Have No Idea What Your Users Will Do:&lt;/span&gt;&amp;nbsp;For public, exploratory platforms (like ChatGPT), the model needs to be capable of handling any conceivable query, which demands the vast knowledge and capability of a giant model.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px; text-shadow: none;&quot;&gt;The Bottom Line: It&#39;s About Fit, Not Just Power&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;The era of one-size-fits-all AI is over. The future is a diverse ecosystem of models, each optimized for a specific purpose.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Think of it this way:&lt;/span&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;You use a massive, power-hungry truck to move furniture (the large foundation model), but you use an efficient, nimble compact car for your daily commute (the SLM). Both are vehicles, but you choose the right one for the job.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;For most practical business applications—specialized chatbots, content moderation, data extraction, text summarization, and internal automation—a well-chosen and finely-tuned Small Language Model isn&#39;t just a cheaper alternative. It&#39;s often a&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;superior one&lt;/span&gt;—delivering the speed, affordability, and control that modern applications demand.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; line-height: 1.3rem; margin: 16px 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Ready to experiment?&lt;/span&gt;&amp;nbsp;Start by exploring models like&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Llama 3 8B&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Mistral 7B&lt;/span&gt;, or&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 600; text-shadow: none;&quot;&gt;Microsoft&#39;s Phi-3&lt;/span&gt;&amp;nbsp;on platforms like Hugging Face. You might be surprised at how much power you can pack into such a small package.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/6864609319377318171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/11/the-rise-of-small-language-models.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/6864609319377318171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/6864609319377318171'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/11/the-rise-of-small-language-models.html' title='The Rise of Small Language Models: A Practical Guide to Choosing SLMs Over Giants'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-3416364047111510998</id><published>2025-11-01T01:50:00.000-07:00</published><updated>2025-11-01T01:50:00.150-07:00</updated><title type='text'>The AI-Powered DevOps Pipeline: Automating Code Reviews with Python and Node.js</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;Excellent concept! AI-powered DevOps pipelines are revolutionizing how teams ship code. Let me show you how to build a comprehensive automated code review system using Python for AI analysis and Node.js for pipeline integration.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;System Architecture Overview&lt;/h2&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;text&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;[GitHub/GitLab] --&amp;gt; [Node.js Webhook Handler] --&amp;gt; [Python AI Analyzer]
       ^                                              |
       |                                              v
[Status Updates] &amp;lt;-- [Node.js Orchestrator] &amp;lt;-- [Review Results &amp;amp; Suggestions]&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Core Components&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;1. Node.js Webhook Server &amp;amp; Orchestrator&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// server.js - Main webhook handler&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; express &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;express&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; axios &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;axios&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; crypto &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;crypto&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; spawn &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;child_process&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; app &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;express&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;express&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Configuration&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;CONFIG&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;GITHUB_WEBHOOK_SECRET&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;GITHUB_WEBHOOK_SECRET&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PYTHON_AI_SERVICE&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PYTHON_AI_SERVICE&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;http://localhost:5000&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;SUPPORTED_LANGUAGES&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;javascript&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;python&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;typescript&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;java&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;go&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// GitHub webhook verification&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;verifyGitHubSignature&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; next&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; signature &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;headers&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;x-hub-signature-256&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!&lt;/span&gt;signature&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;401&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Missing signature&#39;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; hmac &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; crypto&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;createHmac&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;sha256&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;GITHUB_WEBHOOK_SECRET&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; digest &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;sha256=&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;hmac&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;body&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;digest&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;hex&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!&lt;/span&gt;crypto&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;timingSafeEqual&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;Buffer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;signature&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; Buffer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;digest&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;401&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Invalid signature&#39;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
    
    &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// AI Code Review Orchestrator&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;CodeReviewOrchestrator&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;reviewCache &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;performCodeReview&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;pullRequest&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            repository&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;pull_request&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; pr
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; pullRequest&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; cacheKey &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;repository&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;full_name&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;pr&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;number&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Check cache for recent review&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;reviewCache&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;has&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;cacheKey&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;reviewCache&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;cacheKey&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// 1. Get PR details and changes&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; prDetails &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;getPRDetails&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;repository&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;number&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; files &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;getChangedFiles&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;repository&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;number&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            
            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// 2. Filter relevant files&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; reviewableFiles &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; files&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; 
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;isReviewableFile&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;file&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; 
                file&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;status &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;removed&#39;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// 3. Get file contents&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; fileContents &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;getFileContents&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;repository&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; reviewableFiles&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            
            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// 4. Send to Python AI service for analysis&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; aiAnalysis &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;analyzeWithAI&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; fileContents&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;pr_title&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; pr&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;title&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;pr_description&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; pr&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;body&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;repository&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; repository&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;full_name&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;base_branch&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; pr&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;base&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;ref&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;head_branch&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; pr&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;head&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;ref
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// 5. Post review comments to GitHub&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;postReviewComments&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;repository&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;number&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; aiAnalysis&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;comments&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// 6. Update PR status&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;updatePRStatus&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;repository&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;head&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;sha&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; aiAnalysis&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;summary&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Cache the result&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;reviewCache&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;cacheKey&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; aiAnalysis&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;reviewCache&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;cacheKey&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;300000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// 5 min cache&lt;/span&gt;

            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; aiAnalysis&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Code review failed:&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;throw&lt;/span&gt; error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;analyzeWithAI&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;reviewContext&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; response &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; axios&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PYTHON_AI_SERVICE&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/analyze&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; reviewContext&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;60000&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// 60 second timeout for AI analysis&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;AI service error:&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;message&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Error&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;AI analysis failed: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;message&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;getPRDetails&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;repo&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; prNumber&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Implementation for getting PR details from GitHub API&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; response &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; axios&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;repo&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;full_name&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/pulls/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;prNumber&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;Authorization&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;token &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;getChangedFiles&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;repo&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; prNumber&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; response &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; axios&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;repo&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;full_name&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/pulls/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;prNumber&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/files&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;Authorization&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;token &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;getFileContents&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;repo&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; files&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; contents &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; file &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;of&lt;/span&gt; files&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; response &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; axios&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                    &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;repo&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;full_name&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/contents/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;file&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;filename&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;?ref=&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;file&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;contents_url&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;?ref=&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;Authorization&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;token &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
                
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; content &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; Buffer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;base64&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
                contents&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;filename&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; file&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;changes&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; file&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;patch&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// The diff patch&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; file&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;status
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;warn&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;Could not fetch content for &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;file&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;filename&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;message&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; contents&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;postReviewComments&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;repo&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; prNumber&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; comments&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; comment &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;of&lt;/span&gt; comments&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; axios&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;repo&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;full_name&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/pulls/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;prNumber&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/comments&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;formatComment&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;commit_id&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;commit_id&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;file_path&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;line&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;line_number&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;side&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;side &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;RIGHT&#39;&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;Authorization&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;token &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            
            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Rate limiting&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;resolve&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;resolve&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;updatePRStatus&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;repo&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; sha&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; summary&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; state &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; summary&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;issues_found &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;failure&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;success&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; axios&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;repo&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;full_name&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/statuses/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;sha&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; state&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;target_url&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;CI_BUILD_URL&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; summary&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;issues_found &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;?&lt;/span&gt; 
                    &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;Found &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;summary&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;issues_found&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt; issues needing attention&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt;
                    &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;AI review passed - no critical issues found&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ai-code-review/bot&#39;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;Authorization&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;token &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;formatComment&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;comment&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;
🤖 **AI Code Review**

**&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;category&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toUpperCase&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;**: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;title&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;description&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;

**Suggestion**: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;suggestion&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;

**Confidence**: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;confidence &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toFixed&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;%

&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;example &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;**Example**: \`\`\`&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;language&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;comment&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;example&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;\n\`\`\`&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;trim&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;isReviewableFile&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;filename&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; extension &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;.&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; supported &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;js&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ts&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;py&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;java&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;go&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;cpp&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;c&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;rs&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;php&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; supported&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;includes&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;extension&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Initialize orchestrator&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; orchestrator &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;CodeReviewOrchestrator&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Webhook endpoint&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;/webhook/github&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; verifyGitHubSignature&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; res&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; event &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;headers&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;x-github-event&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; payload &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;body&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Only process pull request events&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;event &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;pull_request&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ignored&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;reason&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Not a pull request event&#39;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Only process opened, synchronize, or reopened PRs&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;opened&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;synchronize&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;reopened&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;includes&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;payload&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;action&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ignored&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;reason&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Action not relevant for review&#39;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Process in background&lt;/span&gt;
        &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;setImmediate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; orchestrator&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;performCodeReview&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;payload&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Background processing error:&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;202&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;accepted&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Code review started&#39;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Webhook processing error:&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Internal server error&#39;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Health check endpoint&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;/health&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; res&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; 
        &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;healthy&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; 
        &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ai-code-review-orchestrator&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toISOString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PORT&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PORT&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;3000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PORT&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;AI Code Review Orchestrator running on port &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PORT&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;2. Python AI Analysis Engine&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;python&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# ai_analyzer.py - Core AI analysis engine&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; Flask&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; request&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; jsonify
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; openai
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;from&lt;/span&gt; anthropic &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; Anthropic
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; os
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; re
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; ast
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; tempfile
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; subprocess
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;from&lt;/span&gt; pathlib &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; Path
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;from&lt;/span&gt; typing &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; Any
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; logging
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;from&lt;/span&gt; dataclasses &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; dataclass

app &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; Flask&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;__name__&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Configuration&lt;/span&gt;
OPENAI_API_KEY &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; os&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;getenv&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;OPENAI_API_KEY&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
ANTHROPIC_API_KEY &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; os&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;getenv&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ANTHROPIC_API_KEY&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
GITHUB_TOKEN &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; os&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;getenv&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;GITHUB_TOKEN&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Initialize clients&lt;/span&gt;
openai_client &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; openai&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;OpenAI&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;api_key&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;OPENAI_API_KEY&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; OPENAI_API_KEY &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;None&lt;/span&gt;
anthropic_client &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; Anthropic&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;api_key&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;ANTHROPIC_API_KEY&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; ANTHROPIC_API_KEY &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;None&lt;/span&gt;

&lt;span class=&quot;token decorator annotation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;@dataclass&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;CodeIssue&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    file_path&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;
    line_number&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;int&lt;/span&gt;
    category&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;
    title&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;
    description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;
    suggestion&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;
    confidence&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;float&lt;/span&gt;
    severity&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;  &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# low, medium, high, critical&lt;/span&gt;
    example&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;CodeAnalyzer&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;supported_patterns &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;security&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_analyze_security&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;performance&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_analyze_performance&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;maintainability&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_analyze_maintainability&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;bug_risk&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_analyze_bug_risk&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;best_practices&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_analyze_best_practices
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;analyze_code&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; files&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; Any&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Main analysis entry point&quot;&quot;&quot;&lt;/span&gt;
        all_issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; files&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            file_issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_analyze_file&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            all_issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;extend&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;file_issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Categorize and summarize&lt;/span&gt;
        summary &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_generate_summary&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;all_issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;issues&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; all_issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;summary&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; summary&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;comments&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_format_for_github&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;all_issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_analyze_file&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Analyze a single file&quot;&quot;&quot;&lt;/span&gt;
        issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        filename &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;filename&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        content &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;content&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        changes &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;changes&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Language-specific analysis&lt;/span&gt;
        file_extension &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; Path&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;suffix&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;lower&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Pattern-based analysis&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; category&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; analyzer &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;supported_patterns&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;items&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            category_issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; analyzer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; file_extension&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;extend&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;category_issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# AI-powered analysis&lt;/span&gt;
        ai_issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_ai_analysis&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;extend&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;ai_issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; issues
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_analyze_security&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; extension&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Security vulnerability analysis&quot;&quot;&quot;&lt;/span&gt;
        issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        security_patterns &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;javascript&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;eval\s*\(&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Use of eval() function&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;high&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;localStorage\.setItem\s*\([^)]*password&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Storing passwords in localStorage&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;critical&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;innerHTML\s*=&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Potential XSS vulnerability&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;high&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;https?://[^\s&quot;\&#39;]*&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Hardcoded URLs&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;medium&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;python&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;subprocess\.call|os\.system&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Shell command injection risk&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;high&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;pickle\.loads&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Unsafe deserialization&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;critical&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;exec\(|eval\(&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Code execution vulnerability&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;high&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;password\s*=\s*[&quot;\&#39;]&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Hardcoded credentials&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;critical&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        
        lang &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;javascript&#39;&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; extension &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;.js&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;.ts&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;.jsx&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;.tsx&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;python&#39;&lt;/span&gt;
        patterns &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; security_patterns&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;lang&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; severity &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; patterns&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            matches &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; re&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;finditer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; re&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;IGNORECASE&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;match&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; matches&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                line_number &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;start&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;count&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;\n&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;
                issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                    file_path&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    line_number&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;line_number&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    category&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;security&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    title&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    description&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;f&quot;Potential security vulnerability found&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    suggestion&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;f&quot;Consider using safer alternatives and validate inputs&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    confidence&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0.8&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    severity&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;severity&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    example&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_get_example_fix&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; lang&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; issues
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_analyze_performance&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; extension&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Performance issue analysis&quot;&quot;&quot;&lt;/span&gt;
        issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Common performance patterns&lt;/span&gt;
        performance_patterns &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;for\s*\([^)]*\)\s*{[\s\S]*?\bfor\s*\([^)]*\)\s*{&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Nested loops - O(n²) complexity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;medium&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;JSON\.parse\s*\([^)]*\)\s*in\s+loop&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;JSON parsing in loop&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;medium&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;document\.querySelectorAll\s*\([^)]*\)\s*\.forEach&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;DOM query in loop&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;medium&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; severity &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; performance_patterns&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; re&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;search&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; re&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;MULTILINE&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                    file_path&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    line_number&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Would need more sophisticated line detection&lt;/span&gt;
                    category&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;performance&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    title&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    description&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Performance optimization opportunity&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    suggestion&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Consider optimizing the algorithm or caching results&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    confidence&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0.7&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    severity&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;severity
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; issues
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_analyze_maintainability&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; extension&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Code maintainability analysis&quot;&quot;&quot;&lt;/span&gt;
        issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Large function detection&lt;/span&gt;
        functions &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_extract_functions&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; extension&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; func_name&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; func_info &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; functions&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;items&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; func_info&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;line_count&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                    file_path&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    line_number&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;func_info&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;start_line&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    category&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;maintainability&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    title&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;f&quot;Large function: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;func_name&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;func_info&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;line_count&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt; lines)&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    description&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Functions should generally be under 50 lines for maintainability&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    suggestion&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Consider breaking this function into smaller, focused functions&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    confidence&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0.9&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    severity&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;medium&#39;&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Complex conditional detection&lt;/span&gt;
        complex_conditionals &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; re&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;findall&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;if\s*\([^)]{100,}\)&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; conditional &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; complex_conditionals&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                file_path&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                line_number&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                category&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;maintainability&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                title&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Complex conditional expression&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                description&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Conditional logic is complex and hard to maintain&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                suggestion&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Extract complex conditions into well-named variables or functions&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                confidence&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0.8&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                severity&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;low&#39;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; issues
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_analyze_bug_risk&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; extension&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Potential bug detection&quot;&quot;&quot;&lt;/span&gt;
        issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        
        bug_patterns &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;javascript&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;==\s*(null|undefined)&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Use === for null/undefined checks&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;medium&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;console\.log\(&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Leftover debug statement&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;low&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;try\s*{[\s\S]*?}\s*catch\s*\([^)]*\)\s*{}&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Empty catch block&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;high&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;python&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;except:\s*pass&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Bare except with pass&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;high&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;print\(&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Leftover debug statement&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;low&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;assert\s+[^,)]*$&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Assert without message&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;medium&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        
        lang &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;javascript&#39;&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; extension &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;.js&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;.ts&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;python&#39;&lt;/span&gt;
        patterns &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; bug_patterns&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;lang&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; severity &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; patterns&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            matches &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; re&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;finditer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; re&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;MULTILINE&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;match&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; matches&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                line_number &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;start&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;count&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;\n&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;
                issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                    file_path&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    line_number&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;line_number&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    category&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;bug_risk&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    title&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    description&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Potential bug or code smell detected&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    suggestion&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Fix the issue to prevent potential bugs&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    confidence&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0.85&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    severity&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;severity
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; issues
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_analyze_best_practices&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; extension&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Coding best practices analysis&quot;&quot;&quot;&lt;/span&gt;
        issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        
        best_practice_patterns &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;//\s*TODO:&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;TODO comment left in code&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;low&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;//\s*FIXME:&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;FIXME comment left in code&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;medium&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;r&#39;function\s+[a-z][a-zA-Z]*&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Function name should be camelCase&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;low&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; severity &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; best_practice_patterns&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; re&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;search&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                    file_path&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    line_number&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    category&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;best_practices&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    title&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    description&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Code style or best practice issue&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    suggestion&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Follow team coding conventions and best practices&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    confidence&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0.9&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    severity&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;severity
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; issues
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_ai_analysis&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Use AI models for advanced code analysis&quot;&quot;&quot;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;not&lt;/span&gt; anthropic_client&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            prompt &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_build_analysis_prompt&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            
            response &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; anthropic_client&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;messages&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;create&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                model&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;claude-3-sonnet-20240229&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                max_tokens&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                temperature&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                system&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;You are an expert code reviewer. Analyze code for issues and provide specific, actionable feedback.&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                messages&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;role&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;content&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; prompt&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;_parse_ai_response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;text&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;except&lt;/span&gt; Exception &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            logging&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;f&quot;AI analysis failed: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_build_analysis_prompt&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Build prompt for AI analysis&quot;&quot;&quot;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;f&quot;&quot;&quot;
        Analyze this code file for the pull request:
        
        PR Title: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;pr_title&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;N/A&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;
        PR Description: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;pr_description&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;N/A&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;
        Repository: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;repository&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;N/A&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;
        
        File: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;
        
        Code Content:
        ```
        &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;
        ```
        
        Changes in this PR:
        ```
        &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;changes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;
        ```
        
        Please analyze for:
        1. Security vulnerabilities
        2. Performance issues
        3. Code smells and maintainability
        4. Potential bugs
        5. Best practices violations
        6. Architecture concerns
        
        Provide specific, actionable feedback with line numbers if possible.
        &quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_parse_ai_response&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Parse AI response into structured issues&quot;&quot;&quot;&lt;/span&gt;
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# This would parse the AI response into CodeIssue objects&lt;/span&gt;
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Implementation depends on the AI model&#39;s response format&lt;/span&gt;
        issues &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Simple pattern matching for demonstration&lt;/span&gt;
        lines &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;split&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;\n&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        current_issue &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;None&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; line &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; lines&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;CRITICAL:&#39;&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; line &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;HIGH:&#39;&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; line &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;MEDIUM:&#39;&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; line &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;LOW:&#39;&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; line&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; current_issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                    issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;current_issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
                
                severity &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;medium&#39;&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;CRITICAL&#39;&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; line&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; severity &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;critical&#39;&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;elif&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;HIGH&#39;&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; line&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; severity &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;high&#39;&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;elif&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;LOW&#39;&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; line&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; severity &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;low&#39;&lt;/span&gt;
                
                current_issue &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                    file_path&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    line_number&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    category&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ai_analysis&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    title&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;line&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;strip&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    description&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    suggestion&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    confidence&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0.8&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    severity&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;severity
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;elif&lt;/span&gt; current_issue &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;and&lt;/span&gt; line&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;strip&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;not&lt;/span&gt; current_issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                    current_issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;description &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; line&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;strip&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                    current_issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;suggestion &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; line&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;strip&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; current_issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;current_issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; issues
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_extract_functions&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; extension&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; Any&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Extract function information from code&quot;&quot;&quot;&lt;/span&gt;
        functions &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; extension &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;.py&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Python function extraction&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                tree &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; ast&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;parse&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; node &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; ast&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;walk&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;tree&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;isinstance&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;node&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;ast&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;FunctionDef&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; ast&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;AsyncFunctionDef&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                        start_line &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; node&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;lineno
                        end_line &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; node&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;end_lineno &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;or&lt;/span&gt; start_line
                        functions&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;node&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;name&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;start_line&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; start_line&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;line_count&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; end_line &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt; start_line &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;
                        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;except&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;pass&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; functions
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_get_example_fix&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; language&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Provide example fixes for common issues&quot;&quot;&quot;&lt;/span&gt;
        fixes &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;eval&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;javascript&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;// Instead of eval(expression)\n// Use: const result = safeEval(expression) or a parser&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;python&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;# Instead of eval(expression)\n# Use: ast.literal_eval(expression) or a safe parser&#39;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;localStorage password&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;javascript&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;// Instead of localStorage.setItem(&quot;password&quot;, pwd)\n// Use: secure authentication with backend&#39;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; key&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; examples &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; fixes&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;items&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; key &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; pattern&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; examples&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;language&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_generate_summary&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; Any&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Generate summary of all issues found&quot;&quot;&quot;&lt;/span&gt;
        severity_counts &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;critical&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;high&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;medium&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;low&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        category_counts &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; issue &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            severity_counts&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;severity&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;
            category_counts&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;category&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; category_counts&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;category&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;total_issues&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;issues_by_severity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; severity_counts&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;issues_by_category&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; category_counts&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;has_critical_issues&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; severity_counts&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;critical&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;has_high_issues&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; severity_counts&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;high&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;review_passed&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; severity_counts&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;critical&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;and&lt;/span&gt; severity_counts&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;high&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;_format_for_github&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; issues&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;CodeIssue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;Dict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Format issues for GitHub API&quot;&quot;&quot;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;file_path&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;file_path&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;line_number&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;line_number&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;category&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;category&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;title&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;title&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;description&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;description&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;suggestion&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;suggestion&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;confidence&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;confidence&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;severity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;severity&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;example&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; issue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;example
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; issue &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; issues
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Initialize analyzer&lt;/span&gt;
analyzer &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; CodeAnalyzer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token decorator annotation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;@app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;route&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;/analyze&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; methods&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;POST&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;analyze_code&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token triple-quoted-string string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&quot;Main analysis endpoint&quot;&quot;&quot;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        data &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; request&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;json
        files &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;files&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        pr_context &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;pr_title&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;pr_title&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;pr_description&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;pr_description&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;repository&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;repository&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;base_branch&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;base_branch&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;head_branch&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;head_branch&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        
        result &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; analyzer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;analyze_code&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;files&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; pr_context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; jsonify&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;result&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;except&lt;/span&gt; Exception &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        logging&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;f&quot;Analysis error: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; jsonify&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;error&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Analysis failed&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;message&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;500&lt;/span&gt;

&lt;span class=&quot;token decorator annotation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;@app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;route&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;/health&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; methods&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;GET&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;health_check&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; jsonify&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;status&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;healthy&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;service&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ai-code-analyzer&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ai_available&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;bool&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;anthropic_client &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;or&lt;/span&gt; openai_client&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; __name__ &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;__main__&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;run&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;host&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;0.0.0.0&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; port&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;5000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; debug&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;3. Package.json and Dependencies&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;json&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;ai-code-review-devops&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;version&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;1.0.0&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;AI-powered automated code review system&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;main&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;server.js&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;scripts&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;start&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;node server.js&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;dev&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;nodemon server.js&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;test&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;jest&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;lint&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;eslint .&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;build&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;echo &#39;No build step required&#39;&quot;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;dependencies&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;express&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^4.18.2&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;axios&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^1.6.0&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;crypto&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^1.0.1&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;dotenv&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^16.3.1&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;winston&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^3.11.0&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;express-rate-limit&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^7.1.5&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;helmet&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^7.1.0&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;cors&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^2.8.5&quot;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;devDependencies&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;nodemon&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^3.0.2&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;jest&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^29.7.0&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;eslint&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^8.54.0&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;supertest&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;^6.3.3&quot;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;engines&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot; style=&quot;color: #e45649;&quot;&gt;&quot;node&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&amp;gt;=18.0.0&quot;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;4. Docker Configuration&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;dockerfile&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;# Node.js Dockerfile
FROM node:18-alpine

WORKDIR /app

COPY package*.json ./
RUN npm ci --only=production

COPY . .

USER node

EXPOSE 3000

CMD [&quot;node&quot;, &quot;server.js&quot;]&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;dockerfile&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;# Python Dockerfile
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

USER nobody

EXPOSE 5000

CMD [&quot;gunicorn&quot;, &quot;-w&quot;, &quot;4&quot;, &quot;-b&quot;, &quot;0.0.0.0:5000&quot;, &quot;ai_analyzer:app&quot;]&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;yaml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# docker-compose.yml&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;3.8&#39;&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;node-orchestrator&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; ./node&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;orchestrator
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;3000:3000&quot;&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; GITHUB_WEBHOOK_SECRET=$&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;GITHUB_WEBHOOK_SECRET&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; GITHUB_TOKEN=$&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;GITHUB_TOKEN&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; PYTHON_AI_SERVICE=http&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;//python&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;analyzer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;5000&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; NODE_ENV=production
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; python&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;analyzer

  &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;python-analyzer&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; ./python&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;analyzer
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; OPENAI_API_KEY=$&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;OPENAI_API_KEY&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; ANTHROPIC_API_KEY=$&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;ANTHROPIC_API_KEY&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; GITHUB_TOKEN=$&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;GITHUB_TOKEN&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;redis&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; redis&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;alpine
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;6379:6379&quot;&lt;/span&gt;

  &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Monitoring&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;prometheus&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; prom/prometheus
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;9090:9090&quot;&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Key Features&lt;/h2&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Multi-Layer Analysis&lt;/span&gt;:&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Pattern-based security scanning&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Performance optimization detection&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Maintainability and complexity analysis&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;AI-powered contextual review&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Smart Integration&lt;/span&gt;:&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;GitHub webhook handling&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;PR status updates&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Inline comment posting&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Caching for performance&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Production Ready&lt;/span&gt;:&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Error handling and retries&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Rate limiting&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Health checks&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Comprehensive logging&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Setup and Deployment&lt;/h2&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Environment Variables&lt;/span&gt;:&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# GitHub Configuration&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot; style=&quot;color: #4078f2;&quot;&gt;GITHUB_WEBHOOK_SECRET&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;your_webhook_secret
&lt;span class=&quot;token assign-left variable&quot; style=&quot;color: #4078f2;&quot;&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;your_github_token

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# AI Services&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot; style=&quot;color: #4078f2;&quot;&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;your_openai_key
&lt;span class=&quot;token assign-left variable&quot; style=&quot;color: #4078f2;&quot;&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;your_anthropic_key

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Deployment&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot; style=&quot;color: #4078f2;&quot;&gt;NODE_ENV&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;production
&lt;span class=&quot;token assign-left variable&quot; style=&quot;color: #4078f2;&quot;&gt;PYTHON_AI_SERVICE&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;http://localhost:5000&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;ol start=&quot;2&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Webhook Configuration&lt;/span&gt;:&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Set up GitHub webhook to point to your Node.js service&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Configure for pull request events&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Set content type to&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;application/json&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Python Requirements&lt;/span&gt;:&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;txt&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;flask==2.3.3
openai==1.3.7
anthropic==0.7.4
gunicorn==21.2.0
python-dotenv==1.0.0&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/3416364047111510998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/11/the-ai-powered-devops-pipeline.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3416364047111510998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3416364047111510998'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/11/the-ai-powered-devops-pipeline.html' title='The AI-Powered DevOps Pipeline: Automating Code Reviews with Python and Node.js'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-8121387013900042007</id><published>2025-11-01T01:33:00.000-07:00</published><updated>2025-11-01T01:33:26.725-07:00</updated><title type='text'>From Model to Production: Serving Your Python ML Model with a Node.js API</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Why Node.js + Python for ML Serving?&lt;/h2&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Node.js&lt;/span&gt;: Excellent for I/O-bound tasks, real-time APIs, and handling concurrent requests&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Python&lt;/span&gt;: Unmatched for ML/Data Science workloads&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Together&lt;/span&gt;: Get the best of both worlds - Python&#39;s ML ecosystem with Node.js&#39;s performance&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Approach 1: HTTP API (Most Common)&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Python Flask/FastAPI Service&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;python&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# app.py - FastAPI Service&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;from&lt;/span&gt; fastapi &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; FastAPI&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; HTTPException
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;from&lt;/span&gt; pydantic &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; BaseModel
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; pickle
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; numpy &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; np
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; pandas &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; pd
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;from&lt;/span&gt; sklearn&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;ensemble &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; RandomForestClassifier
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; logging

app &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; FastAPI&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;title&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;ML Model API&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Load your trained model&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;model.pkl&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;rb&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        model &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; pickle&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;load&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;f&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    logging&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;info&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Model loaded successfully&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;except&lt;/span&gt; Exception &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    logging&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;f&quot;Error loading model: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    model &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;None&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;PredictionRequest&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;BaseModel&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;list&lt;/span&gt;
    model_name&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;default&quot;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;PredictionResponse&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;BaseModel&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    prediction&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;list&lt;/span&gt;
    confidence&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;list&lt;/span&gt;
    model_version&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;

&lt;span class=&quot;token decorator annotation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;@app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;/health&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;health_check&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;status&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;healthy&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;model_loaded&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; model &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token decorator annotation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;@app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;/predict&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; response_model&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;PredictionResponse&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;predict&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;request&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; PredictionRequest&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; model &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;raise&lt;/span&gt; HTTPException&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;status_code&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;503&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; detail&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Model not loaded&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Preprocess input&lt;/span&gt;
        features_array &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; np&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;array&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;request&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;reshape&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Make prediction&lt;/span&gt;
        prediction &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; model&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;predict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;features_array&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        probabilities &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; model&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;predict_proba&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;features_array&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        confidence &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; np&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;probabilities&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; axis&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;tolist&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; PredictionResponse&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
            prediction&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;prediction&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;tolist&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            confidence&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;confidence&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            model_version&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;1.0.0&quot;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;except&lt;/span&gt; Exception &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;raise&lt;/span&gt; HTTPException&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;status_code&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; detail&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;f&quot;Prediction error: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; __name__ &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;__main__&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; uvicorn
    uvicorn&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;run&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; host&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;0.0.0.0&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; port&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;8000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Node.js API Gateway&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// server.js - Node.js Gateway&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; express &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;express&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; axios &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;axios&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; cors &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;cors&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; rateLimit &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;express-rate-limit&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; app &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;express&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PORT&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PORT&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;3000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Middleware&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;cors&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;express&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Rate limiting&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; limiter &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;rateLimit&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;windowMs&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;15&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;60&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// 15 minutes&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// limit each IP to 100 requests per windowMs&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;limiter&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Configuration&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PYTHON_ML_SERVICE&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;ML_SERVICE_URL&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;http://localhost:8000&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Health check endpoint&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;/health&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; res&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; response &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; axios&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PYTHON_ML_SERVICE&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/health&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;healthy&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;ml_service&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toISOString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;503&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;unhealthy&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ML service unavailable&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toISOString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Prediction endpoint&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;/api/predict&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; res&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; model_name &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;body&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Input validation&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!&lt;/span&gt;features &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!&lt;/span&gt;Array&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;isArray&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Invalid input: features must be an array&#39;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Call Python ML service&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; response &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; axios&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PYTHON_ML_SERVICE&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/predict&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            model_name
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;10000&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// 10 second timeout&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Add Node.js gateway metadata&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; result &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;...&lt;/span&gt;response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;gateway_version&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;1.0.0&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;processed_at&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toISOString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;result&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Prediction error:&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;message&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;code &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ECONNREFUSED&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;503&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ML service unavailable&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Please try again later&#39;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Python service returned an error&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;status&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

        res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Internal server error&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Prediction failed&#39;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Batch prediction endpoint&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;/api/predict/batch&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; res&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; instances&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; model_name &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;body&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!&lt;/span&gt;instances &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!&lt;/span&gt;Array&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;isArray&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;instances&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Invalid input: instances must be an array of feature arrays&#39;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Process batch sequentially (for large batches, consider queuing)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; predictions &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; features &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;of&lt;/span&gt; instances&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; response &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; axios&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PYTHON_ML_SERVICE&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;/predict&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                    features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    model_name
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
                predictions&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                predictions&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;Prediction failed: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;message&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                    features
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

        res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            predictions&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;total&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; instances&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;length&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;successful&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; predictions&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!&lt;/span&gt;p&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;length
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Batch processing failed&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;message
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PORT&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;Node.js API Gateway running on port &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PORT&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;ML Service: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;PYTHON_ML_SERVICE&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Approach 2: Child Process Spawning&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;For simpler models or when you want to avoid separate services:&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// child-process-handler.js&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; spawn &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;child_process&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; path &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;path&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;PythonModelHandler&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;modelPath&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;modelPath &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; modelPath&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;predict&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;features&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;resolve&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; reject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; pythonProcess &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;spawn&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;python&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;
                path&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;__dirname&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;python_predict.py&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;let&lt;/span&gt; result &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;let&lt;/span&gt; error &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

            pythonProcess&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;stdout&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                result &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;+=&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

            pythonProcess&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;stderr&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                error &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;+=&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

            pythonProcess&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;close&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;code &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Error&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;Python process exited with code &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;code&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;error&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

                &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; prediction &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;result&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;prediction&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;parseError&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Error&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;Failed to parse prediction: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;parseError&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;message&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

module&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;exports &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; PythonModelHandler&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;python&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# python_predict.py&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; sys
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; json
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; pickle
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; numpy &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; np

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Load model (would be cached in production)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;load_model&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;model.pkl&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;rb&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; pickle&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;load&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;f&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; __name__ &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;__main__&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Parse input features&lt;/span&gt;
        features &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; json&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;loads&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;sys&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;argv&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        model &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; load_model&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Make prediction&lt;/span&gt;
        features_array &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; np&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;array&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;reshape&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        prediction &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; model&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;predict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;features_array&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;tolist&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        probability &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; model&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;predict_proba&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;features_array&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;item&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Return result as JSON&lt;/span&gt;
        result &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;prediction&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; prediction&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;confidence&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; probability&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;status&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;success&#39;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;json&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;dumps&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;result&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;except&lt;/span&gt; Exception &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        error_result &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;error&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;status&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;error&#39;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;json&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;dumps&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error_result&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        sys&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;exit&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Approach 3: Message Queue (RabbitMQ/Redis)&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;For high-throughput, asynchronous processing:&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// queue-producer.js&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; amqp &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;amqplib&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;PredictionQueue&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;connection &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;connection &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; amqplib&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;process&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;env&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;RABBITMQ_URL&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;amqp://localhost&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;connection&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;createChannel&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;assertQueue&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;predictions&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;durable&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;submitPredictionRequest&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; correlationId&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; message &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            correlationId&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toISOString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;sendToQueue&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;predictions&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            Buffer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;message&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;persistent&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

module&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;exports &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; PredictionQueue&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;python&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# queue_consumer.py&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; pika
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; json
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; pickle
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; numpy &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; np

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;PredictionConsumer&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; model_path&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;model &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; pickle&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;load&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;model_path&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;rb&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;connection &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;None&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;None&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;connection &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; pika&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;BlockingConnection&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
            pika&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;ConnectionParameters&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;host&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;localhost&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;connection&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;queue_declare&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;queue&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;predictions&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; durable&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;queue_declare&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;queue&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;results&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; durable&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;process_prediction&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; ch&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; method&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; properties&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; body&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            message &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; json&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;loads&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;body&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            features &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; np&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;array&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;message&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;features&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;reshape&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            
            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Make prediction&lt;/span&gt;
            prediction &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;model&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;predict&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;tolist&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            confidence &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;model&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;predict_proba&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;features&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;item&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            
            result &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;correlationId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; message&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;correlationId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;prediction&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; prediction&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;confidence&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; confidence&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;status&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;completed&#39;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
            
            &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Send result back&lt;/span&gt;
            self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;basic_publish&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
                exchange&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                routing_key&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;results&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                body&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;json&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;dumps&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;result&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                properties&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;pika&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;BasicProperties&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;delivery_mode&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            
            ch&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;basic_ack&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;delivery_tag&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;method&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;delivery_tag&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;except&lt;/span&gt; Exception &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;f&quot;Error processing prediction: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
            ch&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;basic_nack&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;delivery_tag&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;method&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;delivery_tag&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; requeue&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;start_consuming&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;basic_consume&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
            queue&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;predictions&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            on_message_callback&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;process_prediction
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;channel&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;start_consuming&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; __name__ &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;__main__&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    consumer &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; PredictionConsumer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;model.pkl&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    consumer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    consumer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;start_consuming&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Production-Grade Setup&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Docker Configuration&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;dockerfile&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;# Dockerfile for Node.js API
FROM node:18-alpine

WORKDIR /app

COPY package*.json ./
RUN npm ci --only=production

COPY . .

EXPOSE 3000

USER node

CMD [&quot;node&quot;, &quot;server.js&quot;]&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;dockerfile&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;# Dockerfile for Python ML Service
FROM python:3.9-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 8000

CMD [&quot;uvicorn&quot;, &quot;app:app&quot;, &quot;--host&quot;, &quot;0.0.0.0&quot;, &quot;--port&quot;, &quot;8000&quot;]&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;yaml&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# docker-compose.yml&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;3.8&#39;&lt;/span&gt;
&lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;node-api&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; ./node&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;api
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;3000:3000&quot;&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; ML_SERVICE_URL=http&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;//python&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;ml&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;service&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;8000&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; NODE_ENV=production
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; python&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;ml&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;service

  &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;python-ml-service&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; ./python&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;ml&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt;service
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;8000:8000&quot;&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; MODEL_PATH=/app/models/model.pkl

  &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;redis&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; redis&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;alpine
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;6379:6379&quot;&lt;/span&gt;

  &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Optional: for monitoring&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;prometheus&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; prom/prometheus
    &lt;span class=&quot;token key atrule&quot; style=&quot;color: #b76b01;&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;9090:9090&quot;&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Monitoring and Logging&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// monitoring.js&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; client &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;prom-client&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Collect default metrics&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; collectDefaultMetrics &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; client&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;collectDefaultMetrics&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;collectDefaultMetrics&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;5000&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Custom metrics&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; predictionCounter &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;client&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;Counter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;model_predictions_total&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Total number of predictions&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;labelNames&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;model&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;status&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; predictionDuration &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;client&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;Histogram&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;prediction_duration_seconds&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Duration of prediction requests&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;labelNames&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;model&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Express middleware for monitoring&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;monitoringMiddleware&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; next&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; start &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; Date&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    
    res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;finish&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; duration &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;Date&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt; start&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        predictionDuration&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;observe&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;default&#39;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; duration&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;path &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;/api/predict&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            predictionCounter&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;inc&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;default&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;statusCode &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;200&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;success&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;error&#39;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    
    &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Metrics endpoint&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;/metrics&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;req&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; res&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Content-Type&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; client&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;register&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;contentType&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    res&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; client&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;register&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;metrics&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

module&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;exports &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; monitoringMiddleware &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Best Practices&lt;/h2&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Error Handling&lt;/span&gt;: Always handle Python process failures gracefully&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Input Validation&lt;/span&gt;: Validate features before sending to Python&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Timeouts&lt;/span&gt;: Set appropriate timeouts for model predictions&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Caching&lt;/span&gt;: Cache frequent predictions&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Circuit Breaker&lt;/span&gt;: Implement circuit breaker pattern for ML service calls&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Versioning&lt;/span&gt;: Version your models and APIs&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Monitoring&lt;/span&gt;: Track prediction latency, success rates, and model performance&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Performance Considerations&lt;/h2&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Keep Python processes warm&lt;/span&gt;&amp;nbsp;to avoid model reloading&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Use connection pooling&lt;/span&gt;&amp;nbsp;for HTTP approach&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Implement request batching&lt;/span&gt;&amp;nbsp;for high-throughput scenarios&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Consider model quantization&lt;/span&gt;&amp;nbsp;for faster inference&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Use GPU acceleration&lt;/span&gt;&amp;nbsp;when available&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/8121387013900042007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/11/from-model-to-production-serving-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/8121387013900042007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/8121387013900042007'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/11/from-model-to-production-serving-your.html' title='From Model to Production: Serving Your Python ML Model with a Node.js API'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-4953207755276374241</id><published>2025-11-01T01:18:31.956-07:00</published><updated>2025-11-01T01:18:52.373-07:00</updated><title type='text'>Building a Real-Time AI Chatbot: Node.js for the WebSocket, Python for the Brain</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;The Core Concept: Why This Architecture?&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Node.js with WebSockets:&lt;/span&gt;&amp;nbsp;Node.js is exceptionally good at handling many simultaneous, lightweight, and I/O-heavy connections. WebSockets provide a persistent, full-duplex communication channel between the client (web browser) and the server, which is perfect for real-time chat.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Python for the Brain:&lt;/span&gt;&amp;nbsp;Python is the undisputed leader in the AI/ML ecosystem. With libraries like TensorFlow, PyTorch, Transformers (Hugging Face), and NLP tools (NLTK, spaCy), it&#39;s the ideal choice for processing natural language and generating intelligent responses.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;High-Level System Architecture&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Here&#39;s how the components interact:&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;text&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;[Web Client] &amp;lt;--WebSocket--&amp;gt; [Node.js Server] &amp;lt;--HTTP/RPC--&amp;gt; [Python AI Service]
                                      |
                              [Optional: Redis for Session/Msg History]&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Client:&lt;/span&gt;&amp;nbsp;A web app (HTML, JavaScript) connects to the Node.js server via a WebSocket.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Node.js Server (Gateway):&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Manages WebSocket connections (handles connect, disconnect, messages).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Acts as a gateway, validating and routing client messages to the Python AI service.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Relays the AI&#39;s response back to the specific client.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Python AI Service (The Brain):&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Listens for requests from the Node.js gateway.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Processes the user&#39;s message using an NLP model (e.g., a fine-tuned model, GPT, or a Rasa NLU model).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Generates a context-aware, intelligent response.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Sends the response back to the Node.js gateway.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border: none; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Implementation Guide&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;Let&#39;s build a simple but functional prototype. We&#39;ll use:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Node.js&lt;/span&gt;&amp;nbsp;with&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;ws&lt;/code&gt;&amp;nbsp;library for WebSockets.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Python&lt;/span&gt;&amp;nbsp;with&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;Flask&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;transformers&lt;/code&gt;&amp;nbsp;(for a pre-trained model from Hugging Face).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Redis&lt;/span&gt;&amp;nbsp;(optional) to store conversation history.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Part 1: The Node.js WebSocket Server (&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; padding: 0px 5px;&quot;&gt;server.js&lt;/code&gt;)&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;This server handles real-time connections and communicates with the Python backend.&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; WebSocket &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;ws&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; http &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;http&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;v4&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; uuidv4 &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;uuid&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// For unique session IDs&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Create an HTTP server and a WebSocket server on top of it&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; server &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; http&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; wss &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;WebSocket&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;Server&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; server &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// In-memory store for client sessions (use Redis in production!)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; sessions &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;color: #b76b01;&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Function to call the Python AI service&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;queryPythonAI&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;message&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; sessionId&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; data &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; message&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;session_id&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; sessionId &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Send session ID for context&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; response &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;http://localhost:5000/chat&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;POST&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token string-property property&quot; style=&quot;color: #e45649;&quot;&gt;&#39;Content-Type&#39;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;application/json&#39;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; result &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; result&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;reply&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Error calling Python AI service:&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; error&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;I&#39;m having trouble connecting to my brain right now.&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

wss&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;connection&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;ws&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Generate a unique session for this connection&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; sessionId &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;uuidv4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    sessions&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;sessionId&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; ws&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;history&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;New client connected: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;sessionId&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

    ws&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;session&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; sessionId &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

    ws&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;message&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;incoming&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;rawMessage&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Received from client:&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; rawMessage&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; userMessage &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; rawMessage&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; session &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; sessions&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;sessionId&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Store user message (optional)&lt;/span&gt;
        session&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;history&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; userMessage &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Get a reply from the Python AI service&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;const&lt;/span&gt; aiReply &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;queryPythonAI&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;userMessage&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; sessionId&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Store AI reply (optional)&lt;/span&gt;
        session&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;history&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;ai&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; aiReply &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;// Send the reply back to the client&lt;/span&gt;
        ws&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token constant&quot; style=&quot;color: #b76b01;&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;message&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot; style=&quot;color: #e45649;&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;:&lt;/span&gt; aiReply &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

    ws&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;close&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
        console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;Client disconnected: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;${&lt;/span&gt;sessionId&lt;span class=&quot;token interpolation-punctuation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot; style=&quot;color: #50a14f;&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
        sessions&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;sessionId&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;

server&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;8080&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;
    console&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;Node.js WebSocket server running on ws://localhost:8080&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Key Points:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Sessions:&lt;/span&gt;&amp;nbsp;We track each connection with a&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;sessionId&lt;/code&gt;. This is crucial for maintaining conversation history for each user.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Gateway Pattern:&lt;/span&gt;&amp;nbsp;The Node server doesn&#39;t do any AI processing. It just forwards the request and manages the connection.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Error Handling:&lt;/span&gt;&amp;nbsp;The&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;try/catch&lt;/code&gt;&amp;nbsp;around the Python service call ensures the Node server doesn&#39;t crash if the Python service is down.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border: none; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Part 2: The Python AI Service (&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; padding: 0px 5px;&quot;&gt;ai_service.py&lt;/code&gt;)&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;This is the &quot;brain&quot; of the operation. We&#39;ll use a lightweight Flask server and a model from Hugging Face.&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;python&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; Flask&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; request&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; jsonify
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;from&lt;/span&gt; transformers &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; pipeline&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; AutoModelForCausalLM&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; AutoTokenizer
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;import&lt;/span&gt; torch

app &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; Flask&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;__name__&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Load a pre-trained model (using a small model for example)&lt;/span&gt;
&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# You can swap this for GPT-2, DialoGPT, or your own fine-tuned model!&lt;/span&gt;
model_name &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;microsoft/DialoGPT-small&quot;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;Loading model... This might take a minute.&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
tokenizer &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; AutoTokenizer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;from_pretrained&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;model_name&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
model &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; AutoModelForCausalLM&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;from_pretrained&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;model_name&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
chat_pipeline &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; pipeline&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;text-generation&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; model&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;model&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; tokenizer&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;tokenizer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# In-memory history (use Redis in production for persistence!)&lt;/span&gt;
conversation_histories &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;generate_response&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;user_input&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Get or create history for this session&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; session_id &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;in&lt;/span&gt; conversation_histories&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        conversation_histories&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;session_id&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;

    history &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; conversation_histories&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;session_id&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
    
    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Format the input for the model. This is a simple format.&lt;/span&gt;
    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# For DialoGPT, we can use its specific format.&lt;/span&gt;
    history&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;user_input&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    
    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Create the conversation context&lt;/span&gt;
    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# We&#39;ll just use the last few messages to avoid going over max length&lt;/span&gt;
    recent_history &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; history&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;  &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Last 5 exchanges&lt;/span&gt;
    context &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;join&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;recent_history&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Generate a response&lt;/span&gt;
    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Note: This is a simplistic approach. You&#39;ll want to fine-tune this.&lt;/span&gt;
    response &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; chat_pipeline&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;
        context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        max_length&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        num_return_sequences&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        pad_token_id&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;tokenizer&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;eos_token_id&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        no_repeat_ngram_size&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        temperature&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0.7&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        top_k&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
        top_p&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0.9&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

    bot_reply &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;generated_text&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;strip&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    
    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Extract only the new part of the response (basic method)&lt;/span&gt;
    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# This is model-dependent and can be tricky!&lt;/span&gt;
    new_reply &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; bot_reply&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;replace&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;context&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;strip&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    
    history&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;new_reply&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    
    &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Keep history from growing indefinitely&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token builtin&quot; style=&quot;color: #50a14f;&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;history&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# Keep last 10 messages total&lt;/span&gt;
        conversation_histories&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;session_id&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; history&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; new_reply

&lt;span class=&quot;token decorator annotation punctuation&quot; style=&quot;color: #383a42;&quot;&gt;@app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;route&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;/chat&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; methods&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;POST&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;chat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    data &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; request&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get_json&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    user_message &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;message&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    session_id &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;session_id&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;not&lt;/span&gt; user_message&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; jsonify&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;error&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;No message provided&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;400&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        ai_reply &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt; generate_response&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;user_message&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; jsonify&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;reply&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; ai_reply&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;except&lt;/span&gt; Exception &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;as&lt;/span&gt; e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;f&quot;Error in AI service: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;e&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;return&lt;/span&gt; jsonify&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;reply&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&quot;I encountered an error processing your message.&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;color: #a626a4;&quot;&gt;if&lt;/span&gt; __name__ &lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;color: #50a14f;&quot;&gt;&#39;__main__&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;:&lt;/span&gt;
    app&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;.&lt;/span&gt;run&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;(&lt;/span&gt;port&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;color: #b76b01;&quot;&gt;5000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;,&lt;/span&gt; debug&lt;span class=&quot;token operator&quot; style=&quot;color: #4078f2;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot; style=&quot;color: #b76b01;&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Key Points:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Model Choice:&lt;/span&gt;&amp;nbsp;We&#39;re using&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;DialoGPT-small&lt;/code&gt;, a conversational model. You can easily swap this for&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;GPT-2&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;Facebook&#39;s BlenderBot&lt;/span&gt;, or even a custom model you&#39;ve trained with&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;Rasa&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;LangChain&lt;/span&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Conversation History:&lt;/span&gt;&amp;nbsp;The service maintains a simple history for each&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;session_id&lt;/code&gt;&amp;nbsp;to provide context-aware responses.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Prompt Engineering:&lt;/span&gt;&amp;nbsp;The&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;generate_response&lt;/code&gt;&amp;nbsp;function is quite basic. For a production system, you&#39;d invest heavily in crafting the right prompt and context format for your chosen model.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border: none; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 20px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 30px; margin: 32px 0px 16px;&quot;&gt;Part 3: The Web Client (&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; padding: 0px 5px;&quot;&gt;index.html&lt;/code&gt;)&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px;&quot;&gt;A simple HTML page to test our chatbot.&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px 11.43px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 740px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;html&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token doctype&quot; style=&quot;color: #383a42;&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span class=&quot;token doctype-tag&quot;&gt;DOCTYPE&lt;/span&gt; &lt;span class=&quot;token name&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;&lt;/span&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;&lt;/span&gt;head&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;&lt;/span&gt;title&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;AI Chatbot&lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;/&lt;/span&gt;title&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        #chatbox { border: 1px solid #ccc; height: 400px; overflow-y: scroll; padding: 10px; }
        .message { margin: 10px 0; }
        .user { text-align: right; color: blue; }
        .ai { text-align: left; color: green; }
    &lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;/&lt;/span&gt;head&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;&lt;/span&gt;body&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;&lt;/span&gt;h1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Real-Time AI Chatbot&lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;/&lt;/span&gt;h1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;color: #b76b01;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;color: #50a14f;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;color: #383a42;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;chatbox&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;color: #b76b01;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;color: #50a14f;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;color: #383a42;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;color: #b76b01;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;color: #50a14f;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;color: #383a42;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;messageInput&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;color: #b76b01;&quot;&gt;placeholder&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;color: #50a14f;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;color: #383a42;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Type your message...&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;color: #b76b01;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;color: #50a14f;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;color: #383a42;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;width: 80%;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;&lt;/span&gt;button&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;color: #b76b01;&quot;&gt;onclick&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;color: #50a14f;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;color: #383a42;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;sendMessage()&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Send&lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;/&lt;/span&gt;button&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;

    &lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        const chatbox = document.getElementById(&#39;chatbox&#39;);
        const messageInput = document.getElementById(&#39;messageInput&#39;);
        let ws;

        function connect() {
            ws = new WebSocket(&#39;ws://localhost:8080&#39;);

            ws.onopen = () =&amp;gt; {
                addMessage(&#39;ai&#39;, &#39;Connected to the chatbot!&#39;);
            };

            ws.onmessage = (event) =&amp;gt; {
                const data = JSON.parse(event.data);
                if (data.type === &#39;message&#39;) {
                    addMessage(&#39;ai&#39;, data.data);
                }
            };

            ws.onclose = () =&amp;gt; {
                addMessage(&#39;ai&#39;, &#39;Disconnected. Refresh to reconnect.&#39;);
            };
        }

        function sendMessage() {
            const message = messageInput.value.trim();
            if (message &amp;amp;&amp;amp; ws.readyState === WebSocket.OPEN) {
                addMessage(&#39;user&#39;, message);
                ws.send(message);
                messageInput.value = &#39;&#39;;
            }
        }

        function addMessage(sender, text) {
            const messageDiv = document.createElement(&#39;div&#39;);
            messageDiv.className = `message ${sender}`;
            messageDiv.textContent = `${sender === &#39;user&#39; ? &#39;You&#39; : &#39;AI&#39;}: ${text}`;
            chatbox.appendChild(messageDiv);
            chatbox.scrollTop = chatbox.scrollHeight;
        }

        // Allow sending message with Enter key
        messageInput.addEventListener(&#39;keypress&#39;, (e) =&amp;gt; {
            if (e.key === &#39;Enter&#39;) {
                sendMessage();
            }
        });

        // Connect on page load
        connect();
    &lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;/&lt;/span&gt;body&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot; style=&quot;color: #e45649;&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;lt;/&lt;/span&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;color: #383a42;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border: none; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;How to Run the Prototype&lt;/h2&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Setup:&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f9fafb; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-radius: 12px; margin: 16px 0px; position: relative;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; position: sticky; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(249, 250, 251); border-top-left-radius: 12px; border-top-right-radius: 12px; display: flex; font-size: 12.573px; justify-content: space-between; line-height: 12.573px; padding: 0px;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; display: flex; justify-content: space-between; padding: 6px; width: 722px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;flex-shrink: 0;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-size: 12px; line-height: 18px; margin-left: 8px;&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; margin: 0px !important; overflow: auto; padding: 16px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# In your Node.js project&lt;/span&gt;
&lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;npm&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;install&lt;/span&gt; ws uuid

&lt;span class=&quot;token comment&quot; style=&quot;color: #a0a1a7; font-style: italic;&quot;&gt;# In your Python environment&lt;/span&gt;
pip &lt;span class=&quot;token function&quot; style=&quot;color: #4078f2;&quot;&gt;install&lt;/span&gt; flask transformers torch&lt;/pre&gt;&lt;svg class=&quot;_9bc997d _33882ae&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;svg class=&quot;_9bc997d _28d7e84&quot; fill=&quot;none&quot; height=&quot;12&quot; viewbox=&quot;0 0 12 12&quot; width=&quot;12&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M-5.24537e-07 0C-2.34843e-07 6.62742 5.37258 12 12 12L0 12L-5.24537e-07 0Z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Start the Servers:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Terminal 1:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;node server.js&lt;/code&gt;&amp;nbsp;(runs on port 8080)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Terminal 2:&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;python ai_service.py&lt;/code&gt;&amp;nbsp;(runs on port 5000, downloads the model on first run)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Test:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Open&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;index.html&lt;/code&gt;&amp;nbsp;in your web browser.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Start chatting!&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px;&quot;&gt;Production Considerations &amp;amp; Enhancements&lt;/h2&gt;&lt;ol start=&quot;1&quot; style=&quot;background-color: white; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 16px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Scalability:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Use a Redis Pub/Sub system to allow multiple Node.js instances to communicate and broadcast messages. This lets you scale the WebSocket layer horizontally.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Use a message queue (like RabbitMQ or Redis Queue) between Node.js and Python to handle a large number of requests asynchronously.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Robustness:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Authentication:&lt;/span&gt;&amp;nbsp;Add JWT-based authentication during the WebSocket handshake.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Reconnection Logic:&lt;/span&gt;&amp;nbsp;Implement automatic reconnection with backoff on the client.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Health Checks:&lt;/span&gt;&amp;nbsp;Add health check endpoints to your Python service.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Containerization:&lt;/span&gt;&amp;nbsp;Dockerize both services for easy deployment.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;AI Enhancements:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin: 4px 0px 0px; padding-left: 18px;&quot;&gt;&lt;li&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Intent Recognition &amp;amp; Entities:&lt;/span&gt;&amp;nbsp;Use a framework like&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;Rasa&lt;/span&gt;&amp;nbsp;for more structured dialogue management.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Better Models:&lt;/span&gt;&amp;nbsp;Use larger, more powerful models like GPT-3.5/4 via an API or host your own open-source alternatives (LLaMA, Falcon).&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Retrieval-Augmented Generation (RAG):&lt;/span&gt;&amp;nbsp;Combine the LLM with a knowledge base from your company&#39;s documents for more accurate, grounded answers.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 6px;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Guardrails:&lt;/span&gt;&amp;nbsp;Implement libraries like&amp;nbsp;&lt;code style=&quot;align-items: center; background-color: #ebeef2; border-radius: 6px; box-sizing: border-box; display: inline-flex; font-family: Menlo, Monaco, Consolas, &amp;quot;Cascadia Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;JetBrains Mono&amp;quot;, &amp;quot;Fira Code&amp;quot;, Cousine, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, sans-serif, system-ui; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 0.875em !important; font-stretch: 100%; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 22px; padding: 0px 5px;&quot;&gt;guardrails-ai&lt;/code&gt;&amp;nbsp;to control the model&#39;s output and prevent harmful or off-topic responses.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/4953207755276374241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/11/building-real-time-ai-chatbot-nodejs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/4953207755276374241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/4953207755276374241'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/11/building-real-time-ai-chatbot-nodejs.html' title='Building a Real-Time AI Chatbot: Node.js for the WebSocket, Python for the Brain'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-498551109368239254</id><published>2025-10-29T10:21:00.000-07:00</published><updated>2025-10-29T10:21:06.432-07:00</updated><title type='text'>The Rise of &quot;Agentic AI&quot;: Beyond Chatbots to Autonomous Task Completion</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;We’ve all been amazed by ChatGPT. We’ve asked it to write poems, summarize complex topics, and even generate code. But for all its brilliance, it has a fundamental limitation: it’s a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;reactive&lt;/span&gt;&lt;span style=&quot;color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;intelligence. It waits for a prompt, generates a response, and then stops. It&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;talks&lt;/em&gt;&lt;span style=&quot;color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;about tasks, but it doesn’t&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;do&lt;/em&gt;&lt;span style=&quot;color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;them.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The next seismic shift is already here, and it’s called&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Agentic AI&lt;/span&gt;.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;This isn&#39;t just an incremental upgrade. It&#39;s a leap from a brilliant conversational partner to a proactive, autonomous digital employee. Let&#39;s dive into what Agentic AI is, how it works, and why it’s poised to redefine productivity and problem-solving.&lt;/p&gt;&lt;/h1&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;From Conversational to Agentic: A Fundamental Shift&lt;/h2&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Imagine the difference between a GPS that gives you turn-by-turn directions and a self-driving car.&lt;/p&gt;&lt;ul style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px 0px 0px 18px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;A&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Chatbot (like ChatGPT)&lt;/span&gt;&amp;nbsp;is the GPS. It provides the information and the plan, but&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;you&lt;/span&gt;&amp;nbsp;still have to do the driving—the clicking, the typing, the executing.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;An&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;AI Agent&lt;/span&gt;&amp;nbsp;is the self-driving car. You give it a destination (&quot;Book me a weekend trip to Seattle under $800&quot;), and it handles the entire process: researching flights, comparing hotels, checking your calendar, and even filling out the booking forms.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;An AI Agent doesn&#39;t just answer questions; it takes&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;goal-oriented action&lt;/span&gt;.&lt;/p&gt;&lt;/h1&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;How Does Agentic AI Actually Work? The &quot;Reasoning Loop&quot;&lt;/h2&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The magic of an AI Agent lies in its ability to break down a high-level goal into a series of steps, execute them using tools, and learn from the results. This creates a powerful reasoning loop:&lt;/p&gt;&lt;ol start=&quot;1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px 0px 0px 18px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Planning &amp;amp; Task Decomposition:&lt;/span&gt;&amp;nbsp;The agent receives a complex goal. Using a large language model (LLM) as its &quot;brain,&quot; it creates a step-by-step plan. &quot;Book a flight&quot; becomes: 1) Check user&#39;s calendar for availability, 2) Search the web for flight options, 3) Compare prices and times, 4) Select the best option, 5) Enter passenger details and pay.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px 0px 8px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Tool Use (The Key to Action):&lt;/span&gt;&amp;nbsp;This is the crucial difference. Agents have access to and can use&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;tools&lt;/span&gt;—both digital and physical.&lt;/p&gt;&lt;ul style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 4px 0px 0px; outline: none; padding: 0px 0px 0px 18px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Digital Tools:&lt;/span&gt;&amp;nbsp;Web browsers, APIs, software applications (Slack, Excel, Photoshop), database queries.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Physical Tools:&lt;/span&gt;&amp;nbsp;In robotics, this could be controlling motors, sensors, and actuators.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Execution &amp;amp; Iteration:&lt;/span&gt;&amp;nbsp;The agent executes the first step in its plan. It observes the outcome. If something doesn&#39;t work (e.g., a flight is sold out), it doesn&#39;t just give up. It&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;reasons&lt;/span&gt;&amp;nbsp;about the failure, adapts its plan, and tries a different approach. This loop of&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Thought -&amp;gt; Action -&amp;gt; Observation&lt;/span&gt;&amp;nbsp;continues until the task is complete.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/h1&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Real-World Use Cases: Agentic AI in Action&lt;/h2&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;This isn&#39;t just theoretical. Early applications are already showing staggering potential.&lt;/p&gt;&lt;ul style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px 0px 0px 18px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;In Customer Service:&lt;/span&gt;&amp;nbsp;An AI Agent can do more than just answer a query. It can autonomously handle a full refund process: access the company&#39;s CRM, verify the customer&#39;s purchase, process the refund in the payment system, and notify the customer via email—all without human intervention.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;In Software Development:&lt;/span&gt;&amp;nbsp;Beyond generating code snippets, an agentic developer can tackle a ticket like &quot;Add a user login feature.&quot; It would plan the architecture, write the backend and frontend code, run tests, debug errors, and even deploy the update to a staging environment.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;In Personal Productivity:&lt;/span&gt;&amp;nbsp;Your personal AI agent could monitor your inbox, identify an important meeting request, check your calendar for conflicts, propose a time, and send a confirmation email—acting as a true chief-of-staff.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;In Data Analysis:&lt;/span&gt;&amp;nbsp;Instead of a analyst writing complex SQL queries, they could ask an agent: &quot;Analyze our Q3 sales drop and create a presentation with the top three reasons.&quot; The agent would query the database, analyze the results, generate charts, and populate a slide deck.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/h1&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The Challenges and The Human Factor&lt;/h2&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;With great power comes great responsibility. The rise of Agentic AI brings a new set of challenges we must navigate:&lt;/p&gt;&lt;ul style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px 0px 0px 18px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The &quot;Hallucination&quot; Problem, Amplified:&lt;/span&gt;&amp;nbsp;An incorrect answer from a chatbot is one thing. An AI agent taking incorrect&amp;nbsp;&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;actions&lt;/em&gt;—deleting critical data or sending erroneous emails—can be catastrophic. Robust validation and &quot;guardrails&quot; are essential.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Security &amp;amp; Permissions:&lt;/span&gt;&amp;nbsp;How much access do we grant these autonomous systems? An agent needs carefully scoped permissions to perform its job without becoming a security risk.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The Need for Human-in-the-Loop (HITL):&lt;/span&gt;&amp;nbsp;The most effective models won&#39;t be fully autonomous. They will be&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;human-in-the-loop&lt;/span&gt;, where the agent performs 95% of the work and then prompts a human for a final &quot;approve&quot; or &quot;review&quot; before taking a critical action. The human shifts from a&amp;nbsp;&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;doer&lt;/em&gt;&amp;nbsp;to a&amp;nbsp;&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;supervisor&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/h1&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The Future is Agentic&lt;/h2&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;We are moving from an era of human-computer interaction to an era of human-AI collaboration. Agentic AI represents the next logical step: creating digital partners that share our goals and actively work to achieve them.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The question is no longer &quot;What can AI tell me?&quot; but&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;What can AI do for me?&quot;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The businesses and individuals who learn to harness these autonomous capabilities will unlock unprecedented levels of efficiency and creativity. The self-driving car for your digital work is no longer a sci-fi fantasy; it&#39;s pulling out of the garage.&lt;/p&gt;&lt;/h1&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/498551109368239254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/10/the-rise-of-agentic-ai-beyond-chatbots.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/498551109368239254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/498551109368239254'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/10/the-rise-of-agentic-ai-beyond-chatbots.html' title='The Rise of &quot;Agentic AI&quot;: Beyond Chatbots to Autonomous Task Completion'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-4624471367054726523</id><published>2025-10-29T10:18:00.000-07:00</published><updated>2025-10-29T10:18:36.286-07:00</updated><title type='text'>Generative AI for Video: Is This the End of the Stock Footage Industry</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px;&quot;&gt;If you&#39;ve spent any time online recently, you&#39;ve seen the breathtaking, slightly surreal, and utterly revolutionary clips generated by AI models like OpenAI&#39;s Sora, Runway ML, and Pika Labs. From a stylish woman walking down a neon-lit Tokyo street to historical footage of woolly mammoths, the ability to create high-quality video from a simple text prompt is no longer science fiction.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;This immediate, on-demand creation of exactly what you envision poses a fundamental question to a cornerstone of the creative industry:&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Is this the end of the stock footage industry as we know it?&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The short answer is&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;no, but it will be radically transformed.&lt;/span&gt;&amp;nbsp;The stock footage industry won&#39;t die; it will evolve, and in doing so, it will force a reevaluation of what we value in visual content.&lt;/p&gt;&lt;/h1&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The AI Assault: Why Stock Footage is Vulnerable&lt;/h2&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The value proposition of traditional stock footage sites like Shutterstock, Getty Images, and Pond5 has always been convenience and access. Need a shot of a business meeting in London? A time-lapse of the stars? A slow-motion clip of a splash? You can search, license, and download it.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Generative AI attacks this model at its core:&lt;/p&gt;&lt;ol start=&quot;1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px 0px 0px 18px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The End of &quot;Close Enough&quot;:&lt;/span&gt;&amp;nbsp;How many times have you searched for the &quot;perfect&quot; stock clip, only to settle for one that&#39;s &quot;close enough&quot;? With AI, you move from searching to&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;creating&lt;/span&gt;. You describe the exact scene, mood, angle, and style you need. The clip is generated to your precise specifications, not the other way around.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Unprecedented Speed and Iteration:&lt;/span&gt;&amp;nbsp;The traditional process involves searching, filtering, licensing, and downloading. The AI process involves writing a prompt and hitting &quot;generate.&quot; Need a different angle? A different time of day? A different actor? Change the prompt and generate a new version in minutes. This rapid iteration is a game-changer for creators on tight deadlines.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Cost at Scale:&lt;/span&gt;&amp;nbsp;While stock footage can be cheap for a single clip, costs skyrocket when you need multiple high-resolution clips for a project. AI video generation, especially as the technology becomes more commoditized, promises a much lower cost-per-clip, particularly for bulk and highly specific needs.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The Liberation of Specificity:&lt;/span&gt;&amp;nbsp;Want a &quot;3D animated robot cat wearing a Viking helmet, coding on a laptop in a minimalist apartment&quot;? Good luck finding that on a stock site. For hyper-specific, conceptual, or fantastical scenes, AI is the only feasible option.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/h1&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The Unshakeable Strengths of Traditional Stock Footage&lt;/h2&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Despite AI&#39;s dazzling capabilities, traditional stock footage holds significant advantages that won&#39;t disappear overnight.&lt;/p&gt;&lt;ol start=&quot;1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px 0px 0px 18px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The Ground Truth: Authenticity and Reality:&lt;/span&gt;&amp;nbsp;AI still struggles with consistency, physics, and realism. It can create &quot;uncanny valley&quot; effects, with weird hand movements, illogical physics, and a lack of genuine human emotion. For a documentary, a news segment, or a brand that prides itself on authenticity,&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;real footage of real people and real places is irreplaceable.&lt;/span&gt;&amp;nbsp;The raw, unscripted authenticity of a genuine moment carries a weight that AI cannot yet replicate.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px 0px 8px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Legal Certainty and Provenance:&lt;/span&gt;&amp;nbsp;This is a massive one. When you license a clip from a reputable stock agency, you are (generally) protected from copyright, trademark, and model release issues. The provenance of the content is clear. With AI, the legal landscape is a murky frontier.&lt;/p&gt;&lt;ul style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 4px 0px 0px; outline: none; padding: 0px 0px 0px 18px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Who owns the copyright&lt;/span&gt;&amp;nbsp;of an AI-generated clip?&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Could the AI have inadvertently&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;infringed on an existing artist&#39;s style&lt;/span&gt;&amp;nbsp;or a protected property in its training data?&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Do you have the right to use the likeness of the AI-generated person?&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Traditional stock sites offer a layer of legal security that AI currently lacks.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Established Curation and Quality Control:&lt;/span&gt;&amp;nbsp;Stock sites are built on human-curated libraries. You can search for specific camera shots (e.g., &quot;ARRI Alexa footage&quot;), know the exact technical specs, and be confident in the consistent quality. AI generation is still a lottery of quality, requiring multiple generations and &quot;luck&quot; to get a flawless result.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Archival and Niche Historical Content:&lt;/span&gt;&amp;nbsp;Need authentic footage of the 1990s tech boom? Or a specific, obscure cultural event? Stock and archival libraries are treasure troves of real historical moments that AI can only poorly imitate. It can create a&amp;nbsp;&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;pastiche&lt;/em&gt;&amp;nbsp;of the past, but not the&amp;nbsp;&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;actual&lt;/em&gt;&amp;nbsp;past.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/h1&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The Hybrid Future: Evolution, Not Extinction&lt;/h2&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;So, what happens next? We won&#39;t see a sudden switch, but a gradual blending. The stock footage industry is already adapting.&lt;/p&gt;&lt;ol start=&quot;1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px 0px 0px 18px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Stock Sites Embrace AI:&lt;/span&gt;&amp;nbsp;Shutterstock has already integrated OpenAI&#39;s DALL-E and is likely working on video. Getty Images has its own generative AI tool. The future stock site won&#39;t be just a library; it will be a&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;creation platform&lt;/span&gt;&amp;nbsp;where you can search for real footage&amp;nbsp;&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;and&lt;/em&gt;&amp;nbsp;generate AI clips to fill the gaps, all under one licensing and legal umbrella.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;A New Product Category: &quot;AI-Assisted&quot; and &quot;Ethically Sourced&quot; Footage:&lt;/span&gt;&amp;nbsp;We&#39;ll see the rise of stock agencies that specialize in high-quality, ethically trained AI models where the legal rights are crystal clear. They will market &quot;commercially safe&quot; AI footage, addressing the biggest fear for businesses.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 6px 0px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The Changing Role of the Creator:&lt;/span&gt;&amp;nbsp;The value of a video editor or content creator will shift from being a &quot;finder&quot; to being a&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-weight: 600; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;director and curator.&quot;&lt;/span&gt;&amp;nbsp;Their skill will lie in crafting the perfect prompts, seamlessly blending AI-generated elements with real stock footage, and applying the final artistic touches that make the content feel professional and cohesive. The prompt is the new search bar.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/h1&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 32px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;Conclusion: A More Powerful Toolkit, Not a Replacement&lt;/h2&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; color: #0f1115; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 24px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 34px; margin: 32px 0px 16px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The stock footage industry is not facing an end, but a necessary and exciting revolution. Generative AI for video is not a death knell; it&#39;s a power tool being added to the creator&#39;s workshop.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The &quot;close enough&quot; shot, the generic business meeting, the simple animated logo—these will likely be dominated by AI. But for authenticity, legal safety, historical truth, and genuine human connection, traditional stock footage will remain king.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; font-size: 16px; font-weight: 400; margin: 16px 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;The future belongs not to one or the other, but to the savvy creator who knows how to wield both, using the boundless imagination of AI alongside the grounded truth of real-world footage to tell stories that are more compelling and creative than ever before.&lt;/p&gt;&lt;/h1&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/4624471367054726523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/10/generative-ai-for-video-is-this-end-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/4624471367054726523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/4624471367054726523'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/10/generative-ai-for-video-is-this-end-of.html' title='Generative AI for Video: Is This the End of the Stock Footage Industry'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-4804248819937283717</id><published>2025-05-23T11:30:00.000-07:00</published><updated>2025-05-23T11:30:39.031-07:00</updated><title type='text'>Common Mistakes Students Make in Solving Linear Equations (With Fixes!)</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px;&quot;&gt;Solving linear equations is a fundamental skill in algebra, but students often make mistakes that lead to incorrect solutions. Here are some&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px;&quot;&gt;common mistakes&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px;&quot;&gt;&amp;nbsp;and how to fix them:&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px;&quot;&gt;&lt;strong&gt;1. Incorrectly Combining Like Terms&lt;/strong&gt;&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Mistake:&lt;/strong&gt;&lt;br /&gt;Students sometimes add or subtract terms that are not like terms.&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;10&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;→&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;10&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;(Incorrectly combining&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br /&gt;Only combine terms with the same variable (or constants).&lt;br /&gt;&lt;strong&gt;Correct Step:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;10&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;→&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6667em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;10&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 229, 229); border: none; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px;&quot;&gt;&lt;strong&gt;2. Misapplying the Distributive Property&lt;/strong&gt;&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Mistake:&lt;/strong&gt;&lt;br /&gt;Forgetting to multiply all terms inside the parentheses.&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;8&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 1em; vertical-align: -0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mopen&quot; style=&quot;border-color: currentcolor;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 1em; vertical-align: -0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mclose&quot; style=&quot;border-color: currentcolor;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;→&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;8&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;(Forgot to multiply&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;by&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br /&gt;Multiply&amp;nbsp;&lt;strong&gt;every&lt;/strong&gt;&amp;nbsp;term inside the parentheses by the outside factor.&lt;br /&gt;&lt;strong&gt;Correct Step:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;8&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 229, 229); border: none; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px;&quot;&gt;&lt;strong&gt;3. Sign Errors When Moving Terms&lt;/strong&gt;&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Mistake:&lt;/strong&gt;&lt;br /&gt;Forgetting to change the sign when moving terms across the equals sign.&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;→&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;(Should be&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br /&gt;When moving terms, reverse the sign:&lt;br /&gt;&lt;strong&gt;Correct Step:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;→&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;12&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;12&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 229, 229); border: none; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px;&quot;&gt;&lt;strong&gt;4. Dividing Incorrectly (Especially Negative Signs)&lt;/strong&gt;&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Mistake:&lt;/strong&gt;&lt;br /&gt;Dividing only one side or mishandling negative signs.&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;6&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;→&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;(Forgot to divide both sides by&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br /&gt;Always divide&amp;nbsp;&lt;strong&gt;both sides&lt;/strong&gt;&amp;nbsp;by the coefficient of&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;strong&gt;Correct Step:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 1.2484em; vertical-align: -0.4033em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot; style=&quot;border-color: currentcolor; display: inline-block; width: 0.12em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot; style=&quot;border-collapse: collapse; border-color: currentcolor; display: inline-table; margin-right: -2px; table-layout: fixed;&quot;&gt;&lt;span class=&quot;vlist-r&quot; style=&quot;border-color: currentcolor; display: table-row; text-align: center;&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;border-color: currentcolor; display: table-cell; height: 0.8451em; position: relative; vertical-align: bottom;&quot;&gt;&lt;span style=&quot;border-color: currentcolor; display: block; height: 0px; position: relative; top: -2.655em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 3em; overflow: hidden; width: 0px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot; style=&quot;border-color: currentcolor; display: inline-block; font-size: 0.7em;&quot;&gt;&lt;span class=&quot;mord mtight&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;mord mtight&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord mtight&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border-color: currentcolor; display: block; height: 0px; position: relative; top: -3.23em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 3em; overflow: hidden; width: 0px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot; style=&quot;border-bottom-style: solid; border-bottom-width: 0.04em; border-color: currentcolor; display: inline-block; min-height: 1px; width: 17.3333px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border-color: currentcolor; display: block; height: 0px; position: relative; top: -3.394em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 3em; overflow: hidden; width: 0px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot; style=&quot;border-color: currentcolor; display: inline-block; font-size: 0.7em;&quot;&gt;&lt;span class=&quot;mord mtight&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;mord mtight&quot; style=&quot;border-color: currentcolor;&quot;&gt;6&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot; style=&quot;border-color: currentcolor; display: table-cell; font-size: 1px; min-width: 2px; vertical-align: bottom; width: 2px;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot; style=&quot;border-color: currentcolor; display: table-row; text-align: center;&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;border-color: currentcolor; display: table-cell; height: 0.4033em; position: relative; vertical-align: bottom;&quot;&gt;&lt;span style=&quot;border-color: currentcolor; display: block; height: 0px; position: relative;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot; style=&quot;border-color: currentcolor; display: inline-block; width: 0.12em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 229, 229); border: none; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px;&quot;&gt;&lt;strong&gt;5. Not Simplifying Before Solving&lt;/strong&gt;&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Mistake:&lt;/strong&gt;&lt;br /&gt;Trying to solve without simplifying both sides first.&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6667em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;→ Complicated approach instead of simplifying.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br /&gt;First, combine like terms on each side.&lt;br /&gt;&lt;strong&gt;Correct Step:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6667em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;→&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 229, 229); border: none; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px;&quot;&gt;&lt;strong&gt;6. Forgetting to Check the Solution&lt;/strong&gt;&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Mistake:&lt;/strong&gt;&lt;br /&gt;Assuming the answer is correct without verifying.&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;Solving&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.7278em; vertical-align: -0.0833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;6&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;→&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;border-color: currentcolor; font-family: KaTeX_Math; font-style: italic;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, but not plugging back in to check.&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br /&gt;Always substitute the solution back into the original equation.&lt;br /&gt;&lt;strong&gt;Verification:&lt;/strong&gt;&lt;br /&gt;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 1em; vertical-align: -0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;mopen&quot; style=&quot;border-color: currentcolor;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mclose&quot; style=&quot;border-color: currentcolor;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 1em; vertical-align: -0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mopen&quot; style=&quot;border-color: currentcolor;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;mclose&quot; style=&quot;border-color: currentcolor;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot; style=&quot;border-color: currentcolor;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;6&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;→&amp;nbsp;&lt;span class=&quot;katex&quot; style=&quot;font-family: KaTeX_Main, &amp;quot;Times New Roman&amp;quot;, serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 1.21em; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: 1.2; text-rendering: auto;&quot;&gt;&lt;span class=&quot;katex-mathml&quot; style=&quot;border: 0px; clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;12&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;12&lt;/mn&gt;&lt;/mrow&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot; style=&quot;border-color: currentcolor;&quot;&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot; style=&quot;border-color: currentcolor;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;border-color: currentcolor; display: inline-block; margin-right: 0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot; style=&quot;border-color: currentcolor; display: inline-block; position: relative; text-wrap-mode: nowrap; width: min-content;&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;border-color: currentcolor; display: inline-block; height: 0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot; style=&quot;border-color: currentcolor;&quot;&gt;12&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;(Valid!)&lt;/p&gt;&lt;hr style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 229, 229); border: none; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; height: 1px; margin: 32px 0px;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px;&quot;&gt;&lt;strong&gt;Key Takeaways to Avoid Mistakes:&lt;/strong&gt;&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px;&quot;&gt;✅&amp;nbsp;&lt;strong&gt;Combine only like terms&lt;/strong&gt;&amp;nbsp;(same variable or constants).&lt;br /&gt;✅&amp;nbsp;&lt;strong&gt;Apply the distributive property correctly&lt;/strong&gt;&amp;nbsp;(multiply all terms inside).&lt;br /&gt;✅&amp;nbsp;&lt;strong&gt;Flip signs when moving terms&lt;/strong&gt;&amp;nbsp;across the equals sign.&lt;br /&gt;✅&amp;nbsp;&lt;strong&gt;Divide both sides properly&lt;/strong&gt;&amp;nbsp;(especially with negatives).&lt;br /&gt;✅&amp;nbsp;&lt;strong&gt;Simplify first&lt;/strong&gt;&amp;nbsp;before solving.&lt;br /&gt;✅&amp;nbsp;&lt;strong&gt;Always check your solution&lt;/strong&gt;&amp;nbsp;by substitution.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/4804248819937283717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/05/common-mistakes-students-make-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/4804248819937283717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/4804248819937283717'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/05/common-mistakes-students-make-in.html' title='Common Mistakes Students Make in Solving Linear Equations (With Fixes!)'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-7609403173187044275</id><published>2025-05-11T05:39:00.000-07:00</published><updated>2025-05-11T05:42:21.192-07:00</updated><title type='text'>Pagination in Laravel with Ajax</title><content type='html'>&lt;p&gt;&lt;span face=&quot;DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif&quot; style=&quot;background-color: white; color: #404040; font-size: 16.002px;&quot;&gt;Implementing pagination with Ajax in Laravel allows you to load paginated content without page refreshes. Here&#39;s a complete guide to implementing this feature:&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 22.86px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px; text-shadow: none;&quot;&gt;Basic Setup&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px; text-shadow: none;&quot;&gt;1. Controller Setup&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px; text-shadow: none;&quot;&gt;First, set up your controller to return paginated data:&lt;/p&gt;&lt;p class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f5f5f5; --ds-md-code-block-banner-wrap-background-color: white; --ds-md-code-block-border-color: #e5e5e5; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: rgb(250, 250, 250); border-radius: 12px; box-sizing: border-box; color: #494949; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 12.573px; line-height: 20.1168px; margin-bottom: 11.43px; margin-top: 0px; text-shadow: none;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; box-shadow: none; box-sizing: border-box; color: #1f1f1f; font-family: Manrope, sans-serif; font-size: 16px; position: sticky; text-shadow: none; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(245, 245, 245); border-top-left-radius: 12px; border-top-right-radius: 12px; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; line-height: 12.573px; padding: 0px; text-shadow: none;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; padding: 6px 14px 6px 6px; text-shadow: none; width: 732px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;box-shadow: none; box-sizing: border-box; flex-shrink: 0; text-shadow: none;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;box-sizing: border-box; color: #525252; font-size: 12px; line-height: 18px; margin-left: 8px; text-shadow: none;&quot;&gt;php&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;background-color: white; box-sizing: border-box; color: #1f1f1f; font-family: Menlo, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace, Inter, sans-serif; font-size: 14px; margin-bottom: 0px; margin-top: 0px; overflow: auto; padding: 9.144px 13.716px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #a0a1a7; font-style: italic; text-shadow: none;&quot;&gt;// app/Http/Controllers/PostController.php&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;token package&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;App&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;\&lt;/span&gt;Http&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;\&lt;/span&gt;Controllers&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;token package&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;App&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;\&lt;/span&gt;Models&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;\&lt;/span&gt;Post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;token package&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;Illuminate&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;\&lt;/span&gt;Http&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;\&lt;/span&gt;Request&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name-definition class-name&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;PostController&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;token class-name&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;Controller&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function-definition function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$posts&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token class-name static-context&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;paginate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #a0a1a7; font-style: italic; text-shadow: none;&quot;&gt;// 10 items per page&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;posts.index&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;compact&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;posts&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function-definition function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;fetch_data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name type-declaration&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;Request&lt;/span&gt; &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$posts&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token class-name static-context&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;paginate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;posts.pagination_data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;compact&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;posts&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #1f1f1f; font-family: Manrope, sans-serif; font-size: 0.812rem; line-height: 1.3rem; margin-bottom: 0.5rem; margin-top: 0px; text-shadow: none;&quot;&gt;&lt;/p&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px; text-shadow: none;&quot;&gt;2. Create Views&lt;/h3&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: bolder;&quot;&gt;Main view (resources/views/posts/index.blade.php):&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f5f5f5; --ds-md-code-block-banner-wrap-background-color: white; --ds-md-code-block-border-color: #e5e5e5; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: rgb(250, 250, 250); border-radius: 12px; box-sizing: border-box; color: #494949; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 12.573px; line-height: 20.1168px; margin-bottom: 11.43px; margin-top: 0px; text-shadow: none;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; box-shadow: none; box-sizing: border-box; color: #1f1f1f; font-family: Manrope, sans-serif; font-size: 16px; position: sticky; text-shadow: none; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(245, 245, 245); border-top-left-radius: 12px; border-top-right-radius: 12px; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; line-height: 12.573px; padding: 0px; text-shadow: none;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; padding: 6px 14px 6px 6px; text-shadow: none; width: 732px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;box-shadow: none; box-sizing: border-box; flex-shrink: 0; text-shadow: none;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;box-sizing: border-box; color: #525252; font-size: 12px; line-height: 18px; margin-left: 8px; text-shadow: none;&quot;&gt;html&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;background-color: white; box-sizing: border-box; color: #1f1f1f; font-family: Menlo, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace, Inter, sans-serif; font-size: 14px; margin-bottom: 0px; margin-top: 0px; overflow: auto; padding: 9.144px 13.716px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;@extends(&#39;layouts.app&#39;)

@section(&#39;content&#39;)
&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&quot;&lt;/span&gt;container&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;&lt;/span&gt;h2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Posts&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;/&lt;/span&gt;h2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&quot;&lt;/span&gt;post-data&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        @include(&#39;posts.pagination_data&#39;)
    &lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
@endsection&lt;/pre&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #1f1f1f; font-family: Manrope, sans-serif; font-size: 0.812rem; line-height: 1.3rem; margin-bottom: 0.5rem; margin-top: 0px; text-shadow: none;&quot;&gt;&lt;/p&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px; text-shadow: none;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: bolder;&quot;&gt;Pagination partial (resources/views/posts/pagination_data.blade.php):&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f5f5f5; --ds-md-code-block-banner-wrap-background-color: white; --ds-md-code-block-border-color: #e5e5e5; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: rgb(250, 250, 250); border-radius: 12px; box-shadow: none; box-sizing: border-box; color: #494949; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 12.573px; line-height: 20.1168px; margin-bottom: 11.43px; text-shadow: none;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; box-shadow: none; box-sizing: border-box; position: sticky; text-shadow: none; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(245, 245, 245); border-top-left-radius: 12px; border-top-right-radius: 12px; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; line-height: 12.573px; padding: 0px; text-shadow: none;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; padding: 6px 14px 6px 6px; text-shadow: none; width: 732px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;box-shadow: none; box-sizing: border-box; flex-shrink: 0; text-shadow: none;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;box-sizing: border-box; color: #525252; font-size: 12px; line-height: 18px; margin-left: 8px; text-shadow: none;&quot;&gt;html&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: Menlo, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace, Inter, sans-serif; font-size: 14px; margin-bottom: 0px; margin-top: 0px; overflow: auto; padding: 9.144px 13.716px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&quot;&lt;/span&gt;posts&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    @foreach($posts as $post)
        &lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&quot;&lt;/span&gt;post&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;&lt;/span&gt;h3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;{{ $post-&amp;gt;title }}&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;/&lt;/span&gt;h3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;{{ $post-&amp;gt;body }}&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    @endforeach
&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&quot;&lt;/span&gt;pagination&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    {{ $posts-&amp;gt;links() }}
&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px; text-shadow: none;&quot;&gt;3. Routes&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f5f5f5; --ds-md-code-block-banner-wrap-background-color: white; --ds-md-code-block-border-color: #e5e5e5; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: rgb(250, 250, 250); border-radius: 12px; box-shadow: none; box-sizing: border-box; color: #494949; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 12.573px; line-height: 20.1168px; margin-bottom: 11.43px; text-shadow: none;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; box-shadow: none; box-sizing: border-box; position: sticky; text-shadow: none; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(245, 245, 245); border-top-left-radius: 12px; border-top-right-radius: 12px; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; line-height: 12.573px; padding: 0px; text-shadow: none;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; padding: 6px 14px 6px 6px; text-shadow: none; width: 732px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;box-shadow: none; box-sizing: border-box; flex-shrink: 0; text-shadow: none;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;box-sizing: border-box; color: #525252; font-size: 12px; line-height: 18px; margin-left: 8px; text-shadow: none;&quot;&gt;php&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: Menlo, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace, Inter, sans-serif; font-size: 14px; margin-bottom: 0px; margin-top: 0px; overflow: auto; padding: 9.144px 13.716px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #a0a1a7; font-style: italic; text-shadow: none;&quot;&gt;// routes/web.php&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;token package&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;App&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;\&lt;/span&gt;Http&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;\&lt;/span&gt;Controllers&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;\&lt;/span&gt;PostController&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token class-name static-context&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;Route&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;/posts&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token class-name static-context&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;PostController&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;index&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name static-context&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;Route&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;/posts/fetch_data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token class-name static-context&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;PostController&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;fetch_data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;posts.fetch_data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 22.86px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px; text-shadow: none;&quot;&gt;Ajax Implementation&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px; text-shadow: none;&quot;&gt;Add jQuery/Ajax to handle pagination clicks:&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f5f5f5; --ds-md-code-block-banner-wrap-background-color: white; --ds-md-code-block-border-color: #e5e5e5; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: rgb(250, 250, 250); border-radius: 12px; box-shadow: none; box-sizing: border-box; color: #494949; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 12.573px; line-height: 20.1168px; margin-bottom: 11.43px; text-shadow: none;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; box-shadow: none; box-sizing: border-box; position: sticky; text-shadow: none; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(245, 245, 245); border-top-left-radius: 12px; border-top-right-radius: 12px; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; line-height: 12.573px; padding: 0px; text-shadow: none;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; padding: 6px 14px 6px 6px; text-shadow: none; width: 732px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;box-shadow: none; box-sizing: border-box; flex-shrink: 0; text-shadow: none;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;box-sizing: border-box; color: #525252; font-size: 12px; line-height: 18px; margin-left: 8px; text-shadow: none;&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: Menlo, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace, Inter, sans-serif; font-size: 14px; margin-bottom: 0px; margin-top: 0px; overflow: auto; padding: 9.144px 13.716px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #a0a1a7; font-style: italic; text-shadow: none;&quot;&gt;// In your main view or a separate JS file&lt;/span&gt;
&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;.pagination a&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
        e&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;preventDefault&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;var&lt;/span&gt; page &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;href&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;page=&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;fetch_data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;page&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;fetch_data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
        $&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token literal-property property&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&quot;{{ route(&#39;posts.fetch_data&#39;) }}?page=&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;+&lt;/span&gt; page&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token function-variable function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;#post-data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 22.86px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px; text-shadow: none;&quot;&gt;Advanced Implementation with Filters&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px; text-shadow: none;&quot;&gt;If you need filtering with pagination:&lt;/p&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px; text-shadow: none;&quot;&gt;1. Update Controller&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f5f5f5; --ds-md-code-block-banner-wrap-background-color: white; --ds-md-code-block-border-color: #e5e5e5; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: rgb(250, 250, 250); border-radius: 12px; box-shadow: none; box-sizing: border-box; color: #494949; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 12.573px; line-height: 20.1168px; margin-bottom: 11.43px; text-shadow: none;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; box-shadow: none; box-sizing: border-box; position: sticky; text-shadow: none; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(245, 245, 245); border-top-left-radius: 12px; border-top-right-radius: 12px; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; line-height: 12.573px; padding: 0px; text-shadow: none;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; padding: 6px 14px 6px 6px; text-shadow: none; width: 732px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;box-shadow: none; box-sizing: border-box; flex-shrink: 0; text-shadow: none;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;box-sizing: border-box; color: #525252; font-size: 12px; line-height: 18px; margin-left: 8px; text-shadow: none;&quot;&gt;php&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: Menlo, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace, Inter, sans-serif; font-size: 14px; margin-bottom: 0px; margin-top: 0px; overflow: auto; padding: 9.144px 13.716px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function-definition function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;fetch_data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name type-declaration&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;Request&lt;/span&gt; &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$sort_by&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;sort_by&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;created_at&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$sort_type&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;sort_type&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;desc&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
        
        &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$posts&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token class-name static-context&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;orderBy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$sort_by&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$sort_type&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;paginate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
                    
        &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;posts.pagination_data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;compact&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;posts&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 18.288px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px; text-shadow: none;&quot;&gt;2. Update Ajax&lt;/h3&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f5f5f5; --ds-md-code-block-banner-wrap-background-color: white; --ds-md-code-block-border-color: #e5e5e5; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: rgb(250, 250, 250); border-radius: 12px; box-shadow: none; box-sizing: border-box; color: #494949; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 12.573px; line-height: 20.1168px; margin-bottom: 11.43px; text-shadow: none;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; box-shadow: none; box-sizing: border-box; position: sticky; text-shadow: none; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(245, 245, 245); border-top-left-radius: 12px; border-top-right-radius: 12px; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; line-height: 12.573px; padding: 0px; text-shadow: none;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; padding: 6px 14px 6px 6px; text-shadow: none; width: 732px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;box-shadow: none; box-sizing: border-box; flex-shrink: 0; text-shadow: none;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;box-sizing: border-box; color: #525252; font-size: 12px; line-height: 18px; margin-left: 8px; text-shadow: none;&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: Menlo, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace, Inter, sans-serif; font-size: 14px; margin-bottom: 0px; margin-top: 0px; overflow: auto; padding: 9.144px 13.716px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;fetch_data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;page&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; sort_by&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; sort_type&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
    $&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token literal-property property&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&quot;{{ route(&#39;posts.fetch_data&#39;) }}?page=&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;+&lt;/span&gt; page &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;+&lt;/span&gt; 
             &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&quot;&amp;amp;sort_by=&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;+&lt;/span&gt; sort_by &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;+&lt;/span&gt; 
             &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&quot;&amp;amp;sort_type=&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;+&lt;/span&gt; sort_type&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token function-variable function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;#post-data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #a0a1a7; font-style: italic; text-shadow: none;&quot;&gt;// Example of calling with sorting&lt;/span&gt;
&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;#sort-title&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;fetch_data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;title&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;asc&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 22.86px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px; text-shadow: none;&quot;&gt;Loading Indicator&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px; text-shadow: none;&quot;&gt;Add a loading indicator for better UX:&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f5f5f5; --ds-md-code-block-banner-wrap-background-color: white; --ds-md-code-block-border-color: #e5e5e5; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: rgb(250, 250, 250); border-radius: 12px; box-shadow: none; box-sizing: border-box; color: #494949; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 12.573px; line-height: 20.1168px; margin-bottom: 11.43px; text-shadow: none;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; box-shadow: none; box-sizing: border-box; position: sticky; text-shadow: none; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(245, 245, 245); border-top-left-radius: 12px; border-top-right-radius: 12px; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; line-height: 12.573px; padding: 0px; text-shadow: none;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; padding: 6px 14px 6px 6px; text-shadow: none; width: 732px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;box-shadow: none; box-sizing: border-box; flex-shrink: 0; text-shadow: none;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;box-sizing: border-box; color: #525252; font-size: 12px; line-height: 18px; margin-left: 8px; text-shadow: none;&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: Menlo, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace, Inter, sans-serif; font-size: 14px; margin-bottom: 0px; margin-top: 0px; overflow: auto; padding: 9.144px 13.716px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;fetch_data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;#post-data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;&amp;lt;div class=&quot;text-center&quot;&amp;gt;&amp;lt;i class=&quot;fa fa-spinner fa-spin&quot;&amp;gt;&amp;lt;/i&amp;gt; Loading...&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
    
    $&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token literal-property property&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&quot;{{ route(&#39;posts.fetch_data&#39;) }}?page=&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;+&lt;/span&gt; page&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token function-variable function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;#post-data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token function-variable function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;#post-data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;&amp;lt;div class=&quot;alert alert-danger&quot;&amp;gt;Error loading data.&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 22.86px; font-weight: 500; line-height: 1.5; margin: 18.288px 0px 13.716px; text-shadow: none;&quot;&gt;Using Laravel Resources (API-style)&lt;/h2&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin: 13.716px 0px; text-shadow: none;&quot;&gt;For a more API-like approach:&lt;/p&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f5f5f5; --ds-md-code-block-banner-wrap-background-color: white; --ds-md-code-block-border-color: #e5e5e5; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: rgb(250, 250, 250); border-radius: 12px; box-shadow: none; box-sizing: border-box; color: #494949; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 12.573px; line-height: 20.1168px; margin-bottom: 11.43px; text-shadow: none;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; box-shadow: none; box-sizing: border-box; position: sticky; text-shadow: none; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(245, 245, 245); border-top-left-radius: 12px; border-top-right-radius: 12px; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; line-height: 12.573px; padding: 0px; text-shadow: none;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; padding: 6px 14px 6px 6px; text-shadow: none; width: 732px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;box-shadow: none; box-sizing: border-box; flex-shrink: 0; text-shadow: none;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;box-sizing: border-box; color: #525252; font-size: 12px; line-height: 18px; margin-left: 8px; text-shadow: none;&quot;&gt;php&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: Menlo, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace, Inter, sans-serif; font-size: 14px; margin-bottom: 0px; margin-top: 0px; overflow: auto; padding: 9.144px 13.716px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #a0a1a7; font-style: italic; text-shadow: none;&quot;&gt;// In controller&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function-definition function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;fetch_data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name type-declaration&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;Request&lt;/span&gt; &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$posts&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token class-name static-context&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;paginate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #b76b01; text-shadow: none;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;[&lt;/span&gt;
        &lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;html&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;posts.pagination_data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;compact&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;posts&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string single-quoted-string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;next_page&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;token variable&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$posts&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;nextPageUrl&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;md-code-block md-code-block-light&quot; style=&quot;--ds-md-code-banner-background-color: #f5f5f5; --ds-md-code-block-banner-wrap-background-color: white; --ds-md-code-block-border-color: #e5e5e5; --ds-md-code-block-border-radius: 12px; --ds-md-code-block-font-size: calc(1.143*11px); background: rgb(250, 250, 250); border-radius: 12px; box-shadow: none; box-sizing: border-box; color: #494949; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 12.573px; line-height: 20.1168px; margin-bottom: 11.43px; text-shadow: none;&quot;&gt;&lt;div class=&quot;md-code-block-banner-wrap&quot; style=&quot;background-color: white; box-shadow: none; box-sizing: border-box; position: sticky; text-shadow: none; top: 0px; z-index: 6;&quot;&gt;&lt;div class=&quot;md-code-block-banner md-code-block-banner-lite&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(245, 245, 245); border-top-left-radius: 12px; border-top-right-radius: 12px; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; line-height: 12.573px; padding: 0px; text-shadow: none;&quot;&gt;&lt;div class=&quot;_121d384&quot; style=&quot;align-items: center; box-shadow: none; box-sizing: border-box; display: flex; justify-content: space-between; padding: 6px 14px 6px 6px; text-shadow: none; width: 732px;&quot;&gt;&lt;div class=&quot;d2a24f03&quot; style=&quot;box-shadow: none; box-sizing: border-box; flex-shrink: 0; text-shadow: none;&quot;&gt;&lt;span class=&quot;d813de27&quot; style=&quot;box-sizing: border-box; color: #525252; font-size: 12px; line-height: 18px; margin-left: 8px; text-shadow: none;&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: Menlo, &amp;quot;Roboto Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace, Inter, sans-serif; font-size: 14px; margin-bottom: 0px; margin-top: 0px; overflow: auto; padding: 9.144px 13.716px; text-wrap-mode: wrap; word-break: break-all;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #a0a1a7; font-style: italic; text-shadow: none;&quot;&gt;// In AJAX&lt;/span&gt;
$&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&quot;{{ route(&#39;posts.fetch_data&#39;) }}?page=&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;+&lt;/span&gt; page&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token literal-property property&quot; style=&quot;box-sizing: border-box; color: #e45649; text-shadow: none;&quot;&gt;dataType&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;json&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token function-variable function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #a626a4; text-shadow: none;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot; style=&quot;box-sizing: border-box; text-shadow: none;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #50a14f; text-shadow: none;&quot;&gt;&#39;#post-data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #4078f2; text-shadow: none;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;(&lt;/span&gt;response&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;.&lt;/span&gt;html&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #a0a1a7; font-style: italic; text-shadow: none;&quot;&gt;// You can use response.next_page if needed&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #383a42; text-shadow: none;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class=&quot;ds-markdown-paragraph&quot; style=&quot;background-color: white; box-sizing: border-box; color: #404040; font-family: DeepSeek-CJK-patch, Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; line-height: 28.575px; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px; margin-top: 13.716px; margin: 13.716px 0px 0px; text-shadow: none;&quot;&gt;This implementation provides a smooth, dynamic pagination experience without page reloads in our Laravel application.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/7609403173187044275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2025/05/pagination-in-laravel-with-ajax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/7609403173187044275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/7609403173187044275'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2025/05/pagination-in-laravel-with-ajax.html' title='Pagination in Laravel with Ajax'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-7243356099325298131</id><published>2024-01-21T07:39:00.000-08:00</published><updated>2024-01-21T07:39:37.354-08:00</updated><title type='text'>Replace all occurrences of the old class with the new class</title><content type='html'>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; font-family: Arial; font-size: 13px; white-space-collapse: preserve;&quot;&gt;$(&#39;.old-class&#39;).removeClass(&#39;old-class&#39;).addClass(&#39;new-class&#39;);


&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/7243356099325298131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2024/01/replace-all-occurrences-of-old-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/7243356099325298131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/7243356099325298131'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2024/01/replace-all-occurrences-of-old-class.html' title='Replace all occurrences of the old class with the new class'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-8446079322566625160</id><published>2024-01-14T09:35:00.000-08:00</published><updated>2024-01-14T09:35:29.292-08:00</updated><title type='text'>THE PERSON YOU WILL BE IN 5 YEARS DEPENDS LARGELY ON</title><content type='html'>&lt;p&gt;1. The books you read&lt;/p&gt;&lt;p&gt;2. The people you spend time with&lt;/p&gt;&lt;p&gt;3. The habits you adopt&lt;/p&gt;&lt;p&gt;4. The food you eat&lt;/p&gt;&lt;p&gt;5. The conversations you engage in&amp;nbsp;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/8446079322566625160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2024/01/the-person-you-will-be-in-5-years.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/8446079322566625160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/8446079322566625160'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2024/01/the-person-you-will-be-in-5-years.html' title='THE PERSON YOU WILL BE IN 5 YEARS DEPENDS LARGELY ON'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-3210667950186859436</id><published>2024-01-07T09:27:00.000-08:00</published><updated>2024-01-07T09:27:11.703-08:00</updated><title type='text'>How do I log in a user with a master password in Laravel</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; white-space-collapse: preserve;&quot;&gt;In Laravel, logging in a user with a master password is a feature that isn&#39;t provided out-of-the-box, but it can be implemented with some custom code. A master password is a single password that can be used to log in as any user, which can be useful for administrators or developers needing access to multiple accounts. However, this approach should be used cautiously due to its security implications. Here&#39;s a general approach you can take:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: var(--tw-prose-headings); font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 1.25em; white-space-collapse: preserve;&quot;&gt;Prerequisites&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; display: flex; flex-direction: column; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.25em; padding: 0px; white-space-collapse: preserve;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;A Laravel project setup&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;Familiarity with Laravel&#39;s authentication system&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;A User model and corresponding database table&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-headings); font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 1.25em; line-height: 1.6; margin: 1rem 0px 0.5rem; white-space-collapse: preserve;&quot;&gt;Steps to Implement a Master Password&lt;/h3&gt;&lt;div&gt;&lt;h4 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-headings); font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; line-height: 1.5; margin: 1rem 0px 0.5rem; white-space-collapse: preserve;&quot;&gt;1. &lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: inherit; font-weight: 700;&quot;&gt;Environment Configuration&lt;/span&gt;&lt;/h4&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: inherit; font-weight: 700;&quot;&gt;&lt;span style=&quot;color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; white-space-collapse: preserve;&quot;&gt;Set the master password in your &lt;/span&gt;&lt;code style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-code); font-family: &amp;quot;Söhne Mono&amp;quot;, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace !important; font-size: 0.875em; margin-top: 1.25em; white-space-collapse: preserve;&quot;&gt;.env&lt;/code&gt;&lt;span style=&quot;color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; white-space-collapse: preserve;&quot;&gt; file for security.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Helvetica Neue, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;&quot;&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;MASTER_PASSWORD=YourMasterPasswordHere&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; white-space-collapse: preserve;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h4 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-headings); font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; line-height: 1.5; margin: 1rem 0px 0.5rem; white-space-collapse: preserve;&quot;&gt;2. &lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: inherit; font-weight: 700;&quot;&gt;User Model Modification&lt;/span&gt;&lt;/h4&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: flex; flex-direction: column; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.25em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; display: block; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; margin: 0px; min-height: 28px; padding-left: 0.375em; white-space-collapse: preserve;&quot;&gt;Add a method to the User model to validate the master password.&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;span style=&quot;color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Helvetica Neue, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;&quot;&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;public function validateMasterPassword($password)
{
    return $password === env(&#39;MASTER_PASSWORD&#39;);
}&lt;/span&gt;&lt;/span&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;h4 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-headings); font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; font-weight: 400; line-height: 1.5; margin: 1rem 0px 0.5rem; white-space-collapse: preserve;&quot;&gt;3. &lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: inherit; font-weight: 700;&quot;&gt;Customizing the Login Controller&lt;/span&gt;&lt;/h4&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; display: flex; flex-direction: column; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.25em; padding: 0px; white-space-collapse: preserve;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;Override the credentials method in your &lt;code style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-code); font-family: &amp;quot;Söhne Mono&amp;quot;, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace !important; font-size: 0.875em; font-weight: 600; margin-top: 1.25em;&quot;&gt;LoginController&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span style=&quot;color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Helvetica Neue, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;&quot;&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;protected function credentials(Request $request)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;&amp;nbsp; &amp;nbsp; $password = $request-&amp;gt;get(&#39;password&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;&amp;nbsp; &amp;nbsp; // Check if the password is the master password&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;&amp;nbsp; &amp;nbsp; if (User::first()-&amp;gt;validateMasterPassword($password)) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Use the email provided to log in&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return [&#39;email&#39; =&amp;gt; $request-&amp;gt;get(&#39;email&#39;), &#39;password&#39; =&amp;gt; $password];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;&amp;nbsp; &amp;nbsp; // Default behavior&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;&amp;nbsp; &amp;nbsp; return $request-&amp;gt;only($this-&amp;gt;username(), &#39;password&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;white-space-collapse: preserve;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;white-space-collapse: preserve;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;white-space-collapse: preserve;&quot;&gt;&lt;h3 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-headings); font-size: 1.25em; line-height: 1.6; margin: 1rem 0px 0.5rem;&quot;&gt;Security Considerations&lt;/h3&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: flex; flex-direction: column; font-size: 16px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.25em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600; margin-bottom: 1.25em; margin-top: 1.25em;&quot;&gt;Usage Logging&lt;/span&gt;: Always log when the master password is used, including details like who used it, when, and for which account.&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600; margin-bottom: 1.25em; margin-top: 1.25em;&quot;&gt;Access Control&lt;/span&gt;: Restrict the use of the master password to specific IP addresses or during specific times.&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600; margin-bottom: 1.25em; margin-top: 1.25em;&quot;&gt;Auditing&lt;/span&gt;: Regularly review the logs to detect any unauthorized or suspicious use.&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600; margin-bottom: 1.25em; margin-top: 1.25em;&quot;&gt;Complexity&lt;/span&gt;: Ensure the master password is complex and changed regularly.&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600; margin-bottom: 1.25em; margin-top: 1.25em;&quot;&gt;Encryption &amp;amp; Security Practices&lt;/span&gt;: Keep the master password encrypted and follow best security practices to prevent leaks.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/3210667950186859436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2024/01/how-do-i-log-in-user-with-master.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3210667950186859436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3210667950186859436'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2024/01/how-do-i-log-in-user-with-master.html' title='How do I log in a user with a master password in Laravel'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-1566019130678186240</id><published>2023-07-12T10:12:00.010-07:00</published><updated>2023-07-12T10:12:55.894-07:00</updated><title type='text'>How to align all li on one line</title><content type='html'>&lt;p&gt;&amp;nbsp;HTML&lt;/p&gt;&lt;pre class=&quot;lang-html s-code-block&quot; style=&quot;--_cb-line-numbers-bg: var(--black-050); border-radius: var(--br-md); border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: var(--ff-mono); font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-stretch: inherit; font-variant-alternates: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-variation-settings: inherit; line-height: var(--lh-md); margin-bottom: calc(1.5em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: var(--su12); vertical-align: baseline; width: auto;&quot;&gt;&lt;code class=&quot;hljs language-xml&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UL class&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&quot;fruit-prop&quot;&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;LI&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-size: 13px; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt;&amp;gt;&lt;/span&gt;Apple&lt;/span&gt;&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LI&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;LI&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-size: 13px; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt;&amp;gt;&lt;/span&gt;Orange&amp;lt;/&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;LI&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-size: 13px; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;LI&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-size: 13px; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt;&amp;gt;&lt;/span&gt;Banana&amp;lt;/&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;LI&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-size: 13px; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LI&lt;/span&gt;&amp;gt;&lt;/span&gt;Mango&amp;lt;/&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;LI&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-size: 13px; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;/UL&lt;/span&gt;&lt;/code&gt;&amp;gt;&lt;/pre&gt;&lt;pre class=&quot;lang-html s-code-block&quot; style=&quot;--_cb-line-numbers-bg: var(--black-050); border-radius: var(--br-md); border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: var(--ff-mono); font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-stretch: inherit; font-variant-alternates: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-variation-settings: inherit; line-height: var(--lh-md); margin-bottom: calc(1.5em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: var(--su12); vertical-align: baseline; width: auto;&quot;&gt;CSS&lt;/pre&gt;&lt;pre class=&quot;lang-html s-code-block&quot; style=&quot;--_cb-line-numbers-bg: var(--black-050); border-radius: var(--br-md); border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: var(--ff-mono); font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-stretch: inherit; font-variant-alternates: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-variation-settings: inherit; line-height: var(--lh-md); margin-bottom: calc(1.5em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: var(--su12); vertical-align: baseline; width: auto;&quot;&gt;&lt;pre class=&quot;lang-html s-code-block&quot; style=&quot;--_cb-line-numbers-bg: var(--black-050); border-radius: var(--br-md); border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: var(--ff-mono); font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: var(--fs-body1); font-stretch: inherit; font-variant-alternates: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-variation-settings: inherit; line-height: var(--lh-md); margin-bottom: calc(1.5em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: var(--su12); vertical-align: baseline; width: auto;&quot;&gt;&lt;code class=&quot;hljs language-xml&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: var(--_pr-code-fs); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;ul.fruit-prop {&lt;br /&gt;  display: table;
  width: 100%;
  text-align: center;
}

ul.fruit-prop &amp;gt; li {&lt;br /&gt;  display: table-cell;
}&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-html s-code-block&quot; style=&quot;--_cb-line-numbers-bg: var(--black-050); border-radius: var(--br-md); border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: var(--ff-mono); font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: var(--fs-body1); font-stretch: inherit; font-variant-alternates: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-variation-settings: inherit; line-height: var(--lh-md); margin-bottom: calc(1.5em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: var(--su12); vertical-align: baseline; width: auto;&quot;&gt;&lt;code class=&quot;hljs language-xml&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: var(--_pr-code-fs); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;SCSS&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-html s-code-block&quot; style=&quot;--_cb-line-numbers-bg: var(--black-050); border-radius: var(--br-md); border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: var(--ff-mono); font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: var(--fs-body1); font-stretch: inherit; font-variant-alternates: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-variation-settings: inherit; line-height: var(--lh-md); margin-bottom: calc(1.5em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: var(--su12); vertical-align: baseline; width: auto;&quot;&gt;&lt;code class=&quot;hljs language-xml&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-size: var(--_pr-code-fs); font-stretch: inherit; font-style: inherit; font-variant: inherit; font-variation-settings: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;ul {
  &amp;amp;.fruit-prop {&lt;br /&gt;    display: table;
    width: 100%;
    text-align: center;
    
    &amp;gt; li {
      display: table-cell;
    }
  } 
}&lt;/code&gt;&lt;/pre&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/1566019130678186240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2023/07/how-to-align-all-li-on-one-line.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/1566019130678186240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/1566019130678186240'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2023/07/how-to-align-all-li-on-one-line.html' title='How to align all li on one line'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-3056769132077004710</id><published>2023-07-11T11:51:00.000-07:00</published><updated>2023-07-11T11:51:30.312-07:00</updated><title type='text'>Print sql query in Laravel</title><content type='html'>&lt;p&gt;&amp;nbsp;Use the following code to print query in Laravel, There are following way to print query in Laravel&lt;/p&gt;&lt;p&gt;1.&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Arial; font-size: 13px; white-space-collapse: preserve;&quot;&gt;\DB::enableQueryLog();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; font-family: Arial; font-size: 13px; white-space-collapse: preserve;&quot;&gt;2.&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Arial; font-size: 13px; white-space-collapse: preserve;&quot;&gt;dd(\DB::getQueryLog());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; font-family: Arial; font-size: 13px; white-space-collapse: preserve;&quot;&gt;3.&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Arial; font-size: 13px; white-space-collapse: preserve;&quot;&gt;User::where(&#39;user_id&#39;, $iserId)-&amp;gt;toSql();&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/3056769132077004710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2023/07/print-sql-query-in-laravel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3056769132077004710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3056769132077004710'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2023/07/print-sql-query-in-laravel.html' title='Print sql query in Laravel'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-3435972970676438471</id><published>2022-06-01T11:15:00.002-07:00</published><updated>2022-06-01T11:15:45.573-07:00</updated><title type='text'>Setup a master password for your laravel application.</title><content type='html'>&lt;p&gt;&amp;nbsp;Most of the time we face issue, to login other&#39;s account to help them. But we cannot ask them.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Solution is to setup master password so that each account have 2 password.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; Follow the following steps&lt;/p&gt;&lt;p&gt;&amp;nbsp; Step1:-&amp;nbsp; Install composer&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;composer require imanghafoori/laravel-masterpass&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;Step2:-&amp;nbsp;&amp;nbsp;Then, do not forget to run:&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;php artisan vendor:publish --tag=master_password&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Step3:- Add this to your .env&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MASTER_PASSWORD=mySecretMasterPass&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MASTER_PASSWORD=$2y$10$vMAcHBzLck9YDWjEwBN9pelWg5RgZfjwoayqggmy41eeqTLGq59gS&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/3435972970676438471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2022/06/setup-master-password-for-your-laravel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3435972970676438471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3435972970676438471'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2022/06/setup-master-password-for-your-laravel.html' title='Setup a master password for your laravel application.'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-5042944878247772619</id><published>2022-05-07T09:10:00.007-07:00</published><updated>2022-05-07T09:10:44.953-07:00</updated><title type='text'>Enable query log Laravel</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #999999; font-family: Source Sans Pro, arial, serif;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;Use the enableQueryLog method: Use the enableQueryLog method:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #999999; font-family: Source Sans Pro, arial, serif;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;DB::connection()-&amp;gt;enableQueryLog();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #999999; font-family: Source Sans Pro, arial, serif;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #999999; font-family: Source Sans Pro, arial, serif;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; color: #999999; font-family: &amp;quot;Source Sans Pro&amp;quot;, arial, serif; font-size: 15px;&quot;&gt;We can get an array of the executed queries by using the getQueryLog method:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; color: #999999; font-family: &amp;quot;Source Sans Pro&amp;quot;, arial, serif; font-size: 15px;&quot;&gt;$queries = DB::getQueryLog();&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/5042944878247772619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2022/05/enable-query-log-laravel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/5042944878247772619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/5042944878247772619'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2022/05/enable-query-log-laravel.html' title='Enable query log Laravel'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-7118156168038079684</id><published>2021-04-07T11:44:00.001-07:00</published><updated>2021-04-07T11:44:29.269-07:00</updated><title type='text'>Find all IDs in a class : JQuery</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-size: 13px; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt; idArray = [];&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;$(&lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;.red&#39;&lt;/span&gt;).each(&lt;span class=&quot;hljs-function&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt; (&lt;span class=&quot;hljs-params&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;) &lt;/span&gt;{
    idArray.push(&lt;span class=&quot;hljs-built_in&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;this&lt;/span&gt;.id);
});&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/7118156168038079684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2021/04/find-all-ids-in-class-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/7118156168038079684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/7118156168038079684'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2021/04/find-all-ids-in-class-jquery.html' title='Find all IDs in a class : JQuery'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-3611361569971897661</id><published>2021-04-07T11:14:00.003-07:00</published><updated>2021-04-07T11:26:05.689-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="NodeJs"/><title type='text'>jQuery: sending JSON data to PHP with AJAX</title><content type='html'>&lt;p&gt;&amp;nbsp;Passing JSON data with jQuery and AJAX to Node.js is relatively simple, passing JSON data with jQuery and AJAX to PHP requires a few extra steps.&lt;/p&gt;&lt;p&gt;Instead of trying to send JSON as is, you should only send a well-formed JSON string and let PHP to transform it into an object or an associative array (depending on how you use the json_decode() function).&lt;/p&gt;&lt;p&gt;Bear in mind that PHP not only requires the string to be valid JSON: your string must also be UTF-8 compliant. So with jQuery we can write:&lt;/p&gt;&lt;p&gt;var data = {&lt;/p&gt;&lt;p&gt;&amp;nbsp; test: $( &quot;#test&quot; ).val()&lt;/p&gt;&lt;p&gt;};&lt;/p&gt;&lt;p&gt;var options = {&lt;/p&gt;&lt;p&gt;&amp;nbsp; url: &quot;test.php&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; dataType: &quot;text&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; type: &quot;POST&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; data: { test: JSON.stringify( data ) }, // Our valid JSON string&lt;/p&gt;&lt;p&gt;&amp;nbsp; success: function( data, status, xhr ) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;//...&lt;/p&gt;&lt;p&gt;&amp;nbsp; },&lt;/p&gt;&lt;p&gt;&amp;nbsp; error: function( xhr, status, error ) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; //...&lt;/p&gt;&lt;p&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;};&lt;/p&gt;&lt;p&gt;$.ajax( options );&lt;/p&gt;&lt;p&gt;And with PHP we have to take care of the string encoding before using it:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;?php&lt;/p&gt;&lt;p&gt;&amp;nbsp; header(&#39;Content-Type: text/plain&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; $test = utf8_encode($_POST[&#39;test&#39;]); // Don&#39;t forget the encoding&lt;/p&gt;&lt;p&gt;&amp;nbsp; $data = json_decode($test);&lt;/p&gt;&lt;p&gt;&amp;nbsp; echo $data-&amp;gt;test;&lt;/p&gt;&lt;p&gt;&amp;nbsp; exit();&lt;/p&gt;&lt;p&gt;&amp;nbsp;?&amp;gt;&lt;br /&gt;&lt;br /&gt;Reff :&amp;nbsp;https://gabrieleromanato.name/jquery-sending-json-data-to-php-with-ajax&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/3611361569971897661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2021/04/jquery-sending-json-data-to-php-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3611361569971897661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/3611361569971897661'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2021/04/jquery-sending-json-data-to-php-with.html' title='jQuery: sending JSON data to PHP with AJAX'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-401871196748512106.post-7520003591706705321</id><published>2021-02-27T13:12:00.001-08:00</published><updated>2021-02-27T13:13:17.618-08:00</updated><title type='text'>Tooltip For Angular</title><content type='html'>&lt;p&gt;1.&amp;nbsp; Installation&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; npm i ng2-tooltip-directive&lt;/p&gt;&lt;p&gt;2.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Import Ng2Module&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;import { TooltipModule } from &#39;ng2-tooltip-directive&#39;;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;@NgModule({&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;imports: [ TooltipModule ]&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;})&lt;/p&gt;&lt;p&gt;3.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Usage&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Options can be set in the directive tag, so they have the highest priority.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;lt;span tooltip=&quot;Tooltip&quot; placement=&quot;top&quot; show-delay=&quot;500&quot;&amp;gt;Tooltip on top&amp;lt;/span&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;may pass as an object:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;lt;span tooltip=&quot;Tooltip&quot; [options]=&quot;myOptions&quot;&amp;gt;Tooltip on left&amp;lt;/span&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;myOptions = {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&#39;placement&#39;: &#39;left&#39;,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&#39;show-delay&#39;: 500&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Pass HTML as content:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;lt;span tooltip=&quot;&amp;lt;p&amp;gt;Hello i&#39;m a &amp;lt;strong&amp;gt;bold&amp;lt;/strong&amp;gt; text!&amp;lt;/p&amp;gt;&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; Tooltip with HTML content&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;lt;/span&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;lt;ng-template #HtmlContent&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;lt;p&amp;gt;Hello i&#39;m a &amp;lt;strong&amp;gt;bold&amp;lt;/strong&amp;gt; text!&amp;lt;/p&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;lt;/ng-template&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp;&amp;lt;span [tooltip]=&quot;HtmlContent&quot; content-type=&quot;template&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; Tooltip with template content&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;lt;/span&amp;gt;&amp;nbsp;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://hsubhani.blogspot.com/feeds/7520003591706705321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hsubhani.blogspot.com/2021/02/tooltip-for-angular.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/7520003591706705321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/401871196748512106/posts/default/7520003591706705321'/><link rel='alternate' type='text/html' href='http://hsubhani.blogspot.com/2021/02/tooltip-for-angular.html' title='Tooltip For Angular'/><author><name>Hanzala Subhani</name><uri>http://www.blogger.com/profile/08214478868351869733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>