Urgent.News

What's breaking now, across thousands of outlets.

Tech

2026 Node.js Summarize Text API Chat Completions Example for Support Answers

Short answer: for a support agent answering from a private knowledge base, the difficult part is not producing a shorter paragraph. It is producing a valid, bounded answer that preserves the facts the agent is allowed to use. Put that contract in the prompt and application validation, call a chat-completions endpoint, use a temperature around 0.3 to 0.5, and reject output that cannot be parsed.…

The article explains how to use a Node.js text summarization API with chat completions for support answers. The key points are:

1. The difficult part is producing a valid, bounded answer that preserves the facts allowed by the knowledge base. Specify this contract in the prompt and validate the output.

2. Use a temperature of 0.3 to 0.5 when calling the chat-completions endpoint. GPT-4o-mini is a reasonable starting point.

3. The API should only summarize supplied passages, preserve restrictions and dates, distinguish an explicit answer from missing information, and return JSON fields like "answer", "key_facts", "missing_information", and "source_ids".

4. The system prompt should instruct the model on what to do when retrieval doesn't answer the question - i.e., "I do not have enough information in the supplied knowledge base".

5. Implement validation and retrieval boundaries to ensure correctness, even if determinism isn't perfect. Retry HTTP 429 responses with the Retry-After header.

The provided code shows how to implement this in Node.js using the OpenAI Chat Completions API. It reads parameters from environment variables, sends the request, parses the response, validates the structure, and handles errors like timeouts and rate limits gracefully.

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 Tech

How ATS Parsers Read Work Experience Dates, Career Gaps & Overlapping Roles (Greenhouse, Workday & iCIMS Breakdown)

When a software engineer or product manager with seven years of full-time experience gets auto-rejected within 90 seconds of applying for a role requiring "5+ years of experience," the culprit is…

  • ATS parsers require explicit start and end dates in ISO-8601 format (YYYY-MM)
  • Work experience calculation uses regex tokenizers for month and year pairs
  • Proper date formatting prevents undercounting in work experience totals

Kimi K3.1 Pro API: endpoints, tool calls, cache, and errors

The Kimi K3.1 Pro API runs at https://api.moonshot.ai/v1 with the model IDs kimi-k3.1-pro and kimi-k3.1-pro-highspeed. It speaks three transmission formats: OpenAI Chat Completions, Anthropic's…

  • Kimi K3.1 Pro API accessible at https://api.moonshot.ai/v1
  • API supports OpenAI, Anthropic, and custom response formats
  • Cache management and usage logging vary across API surfaces

The State of Context Engineering

This was interesting to me because I was under the naïve impression that context management was a thing of the past, but in actuality it's the opposite: context is here to stay, and managing it has…

More from Monday 26 October →