Skip to content

2.0.0 — Gemma text-call parsing moves to AIChatKitMLX; failed turns keep role alternation

Latest

Choose a tag to compare

@NerdSnipe NerdSnipe released this 27 Sep 03:18
· 2 commits to main since this release

Gemma text tool-call parsing moves out of AIChatUI into AIChatKitMLX, and a turn that fails before
any output no longer leaves two user messages in a row.

Breaking

  • Removed GemmaOutputRecovery, GemmaToolArguments and EmbeddedToolCallParser (all were public
    in AIChatUI).
  • ChatSession no longer parses tool calls out of assistant text (call:name{…},
    <tool_call>{json}</tool_call>, ```tool_code). Text a provider streams as text is shown as text.
    A provider that talks to a model which writes calls as text must turn them into .toolCallComplete
    events itself. AIChatKitMLX 1.4.0+ does this for Gemma, at stream level.
  • ChatSession no longer rewrites tool-call arguments. It trims them, treats blank as {}, and still
    sends anything that is not a JSON object to the provider as {}.

Fixed

  • A turn that ends in an error, or an empty reply, before any output is now dropped from the history
    sent to the provider, the same way a cancel before output is. Previously the next send could send
    two consecutive user turns, which strict chat templates (Gemma) reject. Errors after partial
    output are unchanged: the partial reply is committed, so roles already alternate.

Added

  • ChatSession.UserEntry.isFailed (default false): set on such a turn. ConversationView shows it
    dimmed with the caption “Not answered — the model won't see this message” and a matching VoiceOver
    label (UserMessagePresentation.failedCaption).
  • docs/CHAT_SESSION_BEHAVIOUR.md documents the thinking tile and where tool-call parsing lives.

Changed

  • README: “Known limits” is now “Upgrade notes”. Swift / platform / license badges.

Upgrading from 1.x

  1. Using AIChatKitMLX with Gemma? Update it to 1.4.0 or later in the same change. With an older
    AIChatKitMLX, a Gemma model that writes <tool_call> XML or tool_code blocks would show them as
    plain text, because 2.0.0 no longer recovers them in the UI.
  2. Called GemmaOutputRecovery, GemmaToolArguments or EmbeddedToolCallParser directly? They are
    gone. Use a provider that emits .toolCallComplete (AIChatKitMLX 1.4.0+ for Gemma), or copy the
    parser into your own provider.
  3. Draw your own user-message rows? Treat UserEntry.isFailed like isCancelled: the message was
    never answered and is not in the provider history. Resending it retries.
  4. Depend on other NerdSnipe packages? They must allow AIChatKit 2.x. Compatible releases:
    AIChatKitMLX 1.4.0, AiPersona 1.1.1, GHLAIService 0.2.1. AIChatKitLlama 1.0.2 and earlier require
    AIChatKit <2.0.0.
  5. Nothing else in the public API changed.