<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Llm on Ompluscator&#39;s Blog</title>
    <link>https://www.ompluscator.io/tags/llm/</link>
    <description>Recent content in Llm on Ompluscator&#39;s Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <managingEditor>marko.milojevic@ompluscator.io (Marko Milojevic)</managingEditor>
    <webMaster>marko.milojevic@ompluscator.io (Marko Milojevic)</webMaster>
    <copyright>© 2026 Marko Milojevic</copyright>
    <lastBuildDate>Thu, 19 Mar 2026 10:00:00 +0100</lastBuildDate><atom:link href="https://www.ompluscator.io/tags/llm/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>LLM and Go: OpenAI integration via Responses API</title>
      <link>https://www.ompluscator.io/article/golang/llm-and-golang-gpt-responses/</link>
      <pubDate>Thu, 19 Mar 2026 10:00:00 +0100</pubDate>
      <author>marko.milojevic@ompluscator.io (Marko Milojevic)</author>
      <guid>https://www.ompluscator.io/article/golang/llm-and-golang-gpt-responses/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;https://www.ompluscator.io/article/golang/llm-and-golang-gpt-chat-completion/&#34; title=&#34;LLM and Go: OpenAI Integration via Chat Completions API&#34;&gt;previous two articles&lt;/a&gt;&#xA;in this series covered the Chat Completions API — how to set up a client, maintain conversation history manually, call&#xA;external tools, and control output structure with &lt;code&gt;response_format&lt;/code&gt;. That API gives you full control and a clear mental&#xA;model of what goes over the wire. This article covers the other primary OpenAI interface: the Responses API.&lt;/p&gt;&#xA;&lt;p&gt;The Responses API moves conversation state from the client to OpenAI&amp;rsquo;s servers. You no longer maintain a &lt;code&gt;history&lt;/code&gt; slice&#xA;and re-send it with every call. Instead, you track a response ID and pass it back on the next request. That is a meaningful&#xA;shift for agent-oriented applications — less maintenance, but also less transparency. Understanding the trade-offs between the&#xA;two APIs is worth doing before choosing which one to build on.&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;Responses API&#xA;    &lt;div id=&#34;responses-api&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#responses-api&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;OpenAI introduced the Responses API in 2025, positioning it as the foundation for building agents. The Chat Completions&#xA;API is stateless — every request must carry the full conversation history, and the client owns that state entirely. The&#xA;Responses API inverts this: conversation state lives on OpenAI&amp;rsquo;s servers, and you reference previous turns by ID rather&#xA;than re-sending them.&lt;/p&gt;&#xA;&lt;p&gt;Both APIs give you access to the same underlying models and tool-calling mechanics. The difference is where the orchestration&#xA;responsibility sits. The table below, first introduced in&#xA;&lt;a href=&#34;https://www.ompluscator.io/article/golang/llm-and-golang-gpt-chat-completion/&#34; title=&#34;LLM and Go: OpenAI Integration via Chat Completions API&#34;&gt;the Chat Completions API article&lt;/a&gt;, summarizes the trade-offs:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Feature&lt;/th&gt;&#xA;          &lt;th&gt;Chat Completions API&lt;/th&gt;&#xA;          &lt;th&gt;Responses API&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Conversation state&lt;/td&gt;&#xA;          &lt;td&gt;Client-managed&lt;/td&gt;&#xA;          &lt;td&gt;Server-managed&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;History management&lt;/td&gt;&#xA;          &lt;td&gt;Manual — sent with every request&lt;/td&gt;&#xA;          &lt;td&gt;Automatic&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Tool support&lt;/td&gt;&#xA;          &lt;td&gt;Manual function calling&lt;/td&gt;&#xA;          &lt;td&gt;Built-in tools (web search, code interpreter)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Streaming&lt;/td&gt;&#xA;          &lt;td&gt;Yes&lt;/td&gt;&#xA;          &lt;td&gt;Yes&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Control&lt;/td&gt;&#xA;          &lt;td&gt;Full&lt;/td&gt;&#xA;          &lt;td&gt;Limited&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Vendor coupling&lt;/td&gt;&#xA;          &lt;td&gt;Low&lt;/td&gt;&#xA;          &lt;td&gt;Higher&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Best for&lt;/td&gt;&#xA;          &lt;td&gt;Custom agents, full control&lt;/td&gt;&#xA;          &lt;td&gt;Rapid prototyping, built-in tooling&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;The Chat Completions API is the right default when you want to control exactly what the model sees and when you need&#xA;portability across providers. The Responses API reduces boilerplate and fits well when you want to prototype quickly&#xA;or lean on OpenAI&amp;rsquo;s managed tooling. In this article we build the same conversational agent we built before — but with&#xA;the Responses API driving state management.&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;First AI agent&#xA;    &lt;div id=&#34;first-ai-agent&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#first-ai-agent&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;a href=&#34;https://github.com/openai/openai-go&#34; title=&#34;openai-go&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;&lt;code&gt;openai-go&lt;/code&gt;&lt;/a&gt; SDK covers both APIs under one package. The same client initialization you used for&#xA;Chat Completions works here. To call the API, you need a secret key from&#xA;&lt;a href=&#34;https://platform.openai.com&#34; title=&#34;OpenAI Platform&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;platform.openai.com&lt;/a&gt; — navigate to the API Keys section, generate a key,&#xA;and store it in an environment variable.&lt;/p&gt;</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://www.ompluscator.io/article/golang/llm-and-golang-gpt-responses/featured.png" />
    </item>
    
    <item>
      <title>LLM and Go: Investigating OpenAI Chat Completions API</title>
      <link>https://www.ompluscator.io/article/golang/llm-and-golang-gpt-api-parameters/</link>
      <pubDate>Fri, 06 Mar 2026 01:00:00 +0100</pubDate>
      <author>marko.milojevic@ompluscator.io (Marko Milojevic)</author>
      <guid>https://www.ompluscator.io/article/golang/llm-and-golang-gpt-api-parameters/</guid>
      <description>&lt;p&gt;In &lt;a href=&#34;https://www.ompluscator.io/article/golang/llm-and-golang-gpt-chat-completion/&#34; title=&#34;LLM and Go: OpenAI Integration &#xA;via Chat Completions API&#34;&gt;the previous article&lt;/a&gt; I covered the fundamentals of the Chat Completions API: setting up a client,&#xA;maintaining conversation history, and integrating tools. That was enough to build a working conversational&#xA;agent. This article goes a level deeper — into the API parameters that shape what the model returns and how it thinks.&lt;/p&gt;&#xA;&lt;p&gt;Two parameters stand out as particularly useful in production: &lt;code&gt;response_format&lt;/code&gt; and &lt;code&gt;reasoning_effort&lt;/code&gt;. The first&#xA;gives you control over the structure of the model&amp;rsquo;s output. The second controls how much the model reasons before&#xA;responding — which turns out to matter more than you might expect once you start caring about latency and cost.&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;Chat Completions API details&#xA;    &lt;div id=&#34;chat-completions-api-details&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#chat-completions-api-details&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The Chat Completions API endpoint accepts a rich set of parameters. Most have sensible defaults and you will rarely&#xA;touch them, but understanding what is available saves you from reaching for workarounds that already exist in the API.&#xA;The table below covers the current non-deprecated parameters from the&#xA;&lt;a href=&#34;https://platform.openai.com/docs/api-reference/chat/create&#34; title=&#34;Chat Completions API reference&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;API reference&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Parameter&lt;/th&gt;&#xA;          &lt;th&gt;Type&lt;/th&gt;&#xA;          &lt;th&gt;Description&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;model&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;string&lt;/td&gt;&#xA;          &lt;td&gt;ID of the model to use&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;messages&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;array&lt;/td&gt;&#xA;          &lt;td&gt;Conversation history as an ordered list of messages&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;response_format&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;object&lt;/td&gt;&#xA;          &lt;td&gt;Output format: &lt;code&gt;text&lt;/code&gt;, &lt;code&gt;json_object&lt;/code&gt;, or &lt;code&gt;json_schema&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;reasoning_effort&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;string&lt;/td&gt;&#xA;          &lt;td&gt;Reasoning intensity for reasoning models: &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;temperature&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;number&lt;/td&gt;&#xA;          &lt;td&gt;Sampling temperature from 0 to 2; higher values produce more random output&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;top_p&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;number&lt;/td&gt;&#xA;          &lt;td&gt;Alternative to temperature; nucleus sampling probability mass&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;max_completion_tokens&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;integer&lt;/td&gt;&#xA;          &lt;td&gt;Maximum tokens the model may generate in the response&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;n&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;integer&lt;/td&gt;&#xA;          &lt;td&gt;Number of completion choices to return&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;stream&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;boolean&lt;/td&gt;&#xA;          &lt;td&gt;Stream partial responses as server-sent events&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;stop&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;string/array&lt;/td&gt;&#xA;          &lt;td&gt;Sequences at which the API stops generating&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;presence_penalty&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;number&lt;/td&gt;&#xA;          &lt;td&gt;Penalises new tokens based on whether they appear in the text so far&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;frequency_penalty&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;number&lt;/td&gt;&#xA;          &lt;td&gt;Penalises new tokens based on their frequency in the text so far&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;tools&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;array&lt;/td&gt;&#xA;          &lt;td&gt;List of tools (functions) the model may call&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;tool_choice&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;string/object&lt;/td&gt;&#xA;          &lt;td&gt;Controls which tool the model calls&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;seed&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;integer&lt;/td&gt;&#xA;          &lt;td&gt;Seed for deterministic sampling&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;user&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;string&lt;/td&gt;&#xA;          &lt;td&gt;Unique identifier for the end user&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;In this article we focus on &lt;code&gt;response_format&lt;/code&gt; and &lt;code&gt;reasoning_effort&lt;/code&gt; — two parameters with a direct, visible impact on&#xA;production systems.&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;Information extraction with response_format&#xA;    &lt;div id=&#34;information-extraction-with-response_format&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#information-extraction-with-response_format&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;code&gt;response_format&lt;/code&gt; parameter controls how the model structures its output. The default is plain text. Setting it to&#xA;&lt;code&gt;json_object&lt;/code&gt; tells the model to return valid JSON, but gives you no control over the schema. Setting it to&#xA;&lt;code&gt;json_schema&lt;/code&gt; goes further: you provide a &lt;a href=&#34;https://json-schema.org/&#34; title=&#34;JSON Schema&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;JSON Schema&lt;/a&gt; document and the model&#xA;guarantees its output will conform to it. OpenAI calls this structured output.&lt;/p&gt;</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://www.ompluscator.io/article/golang/llm-and-golang-gpt-api-parameters/featured.png" />
    </item>
    
    <item>
      <title>LLM and Go: OpenAI Integration via Chat Completions API</title>
      <link>https://www.ompluscator.io/article/golang/llm-and-golang-gpt-chat-completion/</link>
      <pubDate>Thu, 05 Mar 2026 10:00:00 +0100</pubDate>
      <author>marko.milojevic@ompluscator.io (Marko Milojevic)</author>
      <guid>https://www.ompluscator.io/article/golang/llm-and-golang-gpt-chat-completion/</guid>
      <description>&lt;p&gt;For most of my career, integrating external intelligence into an application meant calling a rules engine, training a&#xA;custom classifier, or encoding business logic that someone had painfully documented in a spreadsheet. The idea that I&#xA;could describe a task in plain language and have a model respond with genuine reasoning was not something I expected to&#xA;become production-ready in my working life. Then GPT happened, and it changed what backend developers need to know.&lt;/p&gt;&#xA;&lt;p&gt;This article is the first in a series on using LLMs in Go. We start with the OpenAI&#xA;&lt;a href=&#34;https://platform.openai.com/docs/api-reference/chat&#34; title=&#34;Chat Completions API&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Chat Completions API&lt;/a&gt;&#xA;— the stateless, request-based interface that gives you direct control over every aspect of the conversation.&#xA;By the end, you will have a working conversational agent that can call external tools to answer questions it otherwise could not.&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;A short introduction to ChatGPT and OpenAI&#xA;    &lt;div id=&#34;a-short-introduction-to-chatgpt-and-openai&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#a-short-introduction-to-chatgpt-and-openai&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The path to large language models runs through a decade of incremental progress in deep learning. Early models like&#xA;word2vec and GloVe learned to embed words into dense vector spaces, capturing semantic relationships between terms.&#xA;The transformer architecture, introduced by Google in 2017, changed the trajectory of the field — it processes sequences&#xA;in parallel using attention mechanisms that capture long-range dependencies far more effectively than recurrent networks.&#xA;This architectural shift made it practical to train models on orders of magnitude more data. GPT-1 in 2018 showed that&#xA;large-scale unsupervised pre-training followed by fine-tuning could match or beat purpose-built models across a range of language tasks.&lt;/p&gt;&#xA;&lt;p&gt;Understanding what these models actually do removes a lot of the mysticism around them. An LLM is, at its core, a&#xA;next-token predictor. It takes a sequence of tokens as input and outputs a probability distribution over the vocabulary&#xA;for the next token. The transformer&amp;rsquo;s attention mechanism allows every token in the input to attend to every other token,&#xA;building a rich contextual representation before making that prediction. Training adjusts billions of parameters to minimise&#xA;prediction error across enormous text corpora. What emerges is a model with broad world knowledge encoded in its weights —&#xA;not because it was taught facts directly, but because predicting text well requires internalising the structure of&#xA;the world that produced that text.&lt;/p&gt;&#xA;&lt;p&gt;ChatGPT is OpenAI&amp;rsquo;s conversational product built on the GPT model series. What set it apart from raw GPT-3 was the&#xA;addition of reinforcement learning from human feedback (RLHF) — a technique that fine-tunes the base model to follow&#xA;instructions and produce responses that human raters judge as helpful and safe. When ChatGPT launched in late 2022,&#xA;it became one of the fastest-adopted consumer products in history. For developers, the more relevant artefact is the&#xA;API behind it — specifically the Chat Completions API, which gives programmatic access to the same models powering the product.&lt;/p&gt;</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://www.ompluscator.io/article/golang/llm-and-golang-gpt-chat-completion/featured.png" />
    </item>
    
  </channel>
</rss>
