Urgent.News

What's breaking now, across thousands of outlets.

AI

Your LLM returned almost-valid JSON. Stop hand-patching it.

You asked the model for { id: number, active: boolean } . Here's what came back: { "id" : "42" , "active" : "true" , "role" : "admin" } Every field is almost right. id is a string. active is a string. There's a role you never asked for. And the whole thing is wrapped in a markdown code fence. So this: const user = User . parse ( JSON . parse ( raw )); // ๐Ÿ’ฅ throws twice โ€” once on the fence, andโ€ฆ

The provided JSON from the LLM model contained several issues, including mismatched data types, missing fields, and incorrect formatting. For example, the "id" and "active" fields were strings instead of the expected number and boolean types, respectively. Additionally, the JSON was wrapped in a markdown code fence, which made parsing difficult. Furthermore, an extra "role" field was present that was not part of the requested schema.

Written by urgent.news from Dev.to's reporting โ€” not their text. Machine-written โ€” may contain errors; check the original before relying on it.

Read the original at dev.to โ†’

More in AI

Grew the Collection from 5 Entries to 741 Real Chunks

Every retrieval test since Entry 05 has run against the same handful of entries โ€” three documents in Entries 05-06, twenty after Entry 07's chunking.

  • Collection grew from 5 to 741 real chunks
  • Fresh bulk script processed 45 files without duplicates
  • Collection includes Today I Ran back catalog

What the Board Asks Me About AI Agents

I sit in the meetings your architecture decisions eventually reach. Here are the questions that actually get asked about agents at the board level.

  • Board meetings focus on three key concerns about AI agents
  • First concern: blast radius of potential agent mistakes
  • Last concern: references and case studies for agent performance

More from Thursday 8 October โ†’