<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Model Calls on Programmer.ie: Modern AI programming</title>
    <link>http://programmer.ie/tags/model-calls/</link>
    <description>Recent content in Model Calls on Programmer.ie: Modern AI programming</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 14 Sep 2026 05:00:11 +0100</lastBuildDate>
    <atom:link href="http://programmer.ie/tags/model-calls/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The Smallest Useful Model Call</title>
      <link>http://programmer.ie/books/applied-ai/11-chapter/</link>
      <pubDate>Mon, 14 Sep 2026 05:00:11 +0100</pubDate>
      <guid>http://programmer.ie/books/applied-ai/11-chapter/</guid>
      <description>&lt;p&gt;&lt;em&gt;Part 2 — Get the Model Out of the Chat Box&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-smallest-working-call&#34;&gt;The smallest working call&lt;/h2&gt;&#xA;&lt;p&gt;CodeAI&amp;rsquo;s OpenCode cognition adapter, invoked directly without the recorded-call runtime, does the minimum well. One &lt;code&gt;CallSpec&lt;/code&gt; becomes one user message, the message goes out as an ordinary HTTP request, and a &lt;code&gt;CallResult&lt;/code&gt; comes back:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;adapter &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; OpenCodeCognitionAdapter(model&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;mimo-v2.5&amp;#34;&lt;/span&gt;, protocol&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;chat_completions&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;result &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; adapter&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;invoke(spec)  &lt;span style=&#34;color:#75715e&#34;&gt;# one CallSpec in, one CallResult back&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; result&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;status &lt;span style=&#34;color:#f92672&#34;&gt;!=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;succeeded&amp;#34;&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;raise&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;RuntimeError&lt;/span&gt;(result&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;error)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;review &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; result&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;raw_output&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It keeps failure in its own channel instead of passing a diagnostic off as a review. It returns the usage with its source label alongside the convenient string. Those two habits already put it ahead of a great deal of production code.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
