SShortSingh.
Back to feed

Dev Blog: Why a Chat Client Should Return Partial Results Instead of Hard Errors

0
·1 views

A software developer has argued against Go's conventional constructor pattern — returning either a usable object or an error — when building AI chat clients with complex configuration options. The author contends that a chat client involves many independent settings, such as temperature, credentials, and streaming support, where some may not apply to a chosen model without making the entire client unusable. Instead of failing completely, their library returns the best functional client it can build along with an itemised list of settings that could not be applied, called a 'receipt'. A hard failure is still triggered for truly fatal issues, such as missing credentials, using a sentinel error called ErrUnableToConstruct. The author emphasises that each dropped-setting error must carry enough detail — including the affected field, required capability, and reason — to allow developers to diagnose and fix the problem quickly.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer Experiment Reveals Hidden Latency After AI Code Generation Ends

A developer found that the real performance bottleneck in an AI-assisted coding workflow was not the remote language model but the file-writing steps that followed token generation. Standard product dashboards typically highlight first-token latency, masking heavier stalls that occur during the apply phase. To investigate, the developer built a lightweight Python timer using perf_counter to record named spans and render them as an ASCII waterfall chart. The experiment used a small local JSON fixture with no production traffic, deliberately keeping the setup simple and reproducible. The findings showed that apply-phase operations like writing and fsyncing files produced multiple distinct spans, collectively outweighing the generation span in wall-clock time.

0
ProgrammingDEV Community ·

Study Finds Half of 330 AI Models Fail to Respond Correctly in Korean

A benchmark evaluation of 330 large language models tested Korean language ability across seven axes, including honorifics, terminology, register, and format compliance. A script-based script-contamination check — not an AI judge — automatically failed any response containing less than 25% Hangul, more than three Chinese characters, or any Japanese kana. Using this method, 766 of 2,304 responses (33.2%) were auto-failed before human or AI review, and 54 models failed all seven tasks entirely. Honorifics and knowledge of Korean institutions proved the hardest axes, with AI success rates of just 8.5% and 9.4% respectively. Among vendors with at least eight models tested, Anthropic led with a mean score of 2.29 out of 3, while five models — mostly from OpenAI — achieved a perfect score.

0
ProgrammingDEV Community ·

Faster Software Development Means Little If Users Still Struggle to Navigate It

Modern tools like agile workflows, component libraries, cloud platforms, and AI-assisted coding have dramatically reduced the time it takes to build software. However, writer Parvej Shah argues that development speed and product usability are fundamentally different metrics, and shipping features quickly does not guarantee those features are easy to use. Shah contends that the true advantage of rapid development lies not in building more features faster, but in shortening the feedback loop — testing assumptions with real users sooner and iterating based on what is observed. While engineering teams measure progress through deployments and passing tests, users only care whether a product helps them accomplish their goal. As competitors also accelerate their development pace, Shah suggests the real strategic question is not how to build faster, but how to use that speed more wisely.

0
ProgrammingDEV Community ·

React Router Data Mode Explained: How v6 Upgraded Single Page App Management

React Router offers three progressive modes — Declarative, Data, and Framework — each adding more features at the cost of architectural control. Declarative Mode handles basic URL-to-component matching using APIs like useNavigate and useLocation, while Data Mode, introduced in React Router v6, moves route configuration outside React rendering to enable data loading, actions, and pending states. Data Mode uses APIs such as loader, action, and useFetcher, giving developers more hands-on control including parallel data loading. Framework Mode builds further on Data Mode by integrating a Vite plugin to support type-safe routing, intelligent code splitting, and SSR or static rendering strategies. This article series focuses primarily on Data Mode, aiming to provide a deep-dive into its capabilities and practical usage.

Dev Blog: Why a Chat Client Should Return Partial Results Instead of Hard Errors · ShortSingh