LLM API Capabilities Guide: A Practical Framework for Building Intelligent Applications

    This article presents a practical engineering guide to five general-purpose LLM API capabilities: web search, deep thinking search, file input, link reading, and safety validation. It explains the tool-calling paradigm in which the model decides while the application executes, compares single-round and multi-round retrieval, and outlines how to handle document parsing, untrusted web content, and compliance checks. It also covers production concerns such as observability, graceful degradation, and replayability, helping developers design context assembly strategies, parameter constraints, and audit loops.

    1. Introduction: From Chatting to Getting Things Done

    Over the past two years, the shape of LLM applications has changed significantly. Early on, developers mostly treated models as text completion engines, using a single question-and-answer exchange to handle summarization, rewriting, and classification. Today, users expect assistants that can actually get things done: they look up information on their own, read uploaded contracts and screenshots, follow a link to consume its content, and keep gathering evidence through multi-step reasoning.

    This shift places a fundamental requirement on the serving side: capabilities must be decoupled from the model itself and exposed to the application layer as callable tools and configurable parameters. The industry commonly refers to this design as tool calling or the function-calling paradigm. The model does not perform actions directly; it emits a structured call intent, the application runtime performs the actual retrieval, fetching, and parsing, and the results are fed back into the context so reasoning can continue.

    This article takes a set of general-purpose interface capabilities recently opened up by a cloud provider as its technical background and abstracts five typical capabilities: web search, deep thinking search, file input, link reading, and safety validation. It discusses their engineering logic and implementation considerations. The article does not reference any specific product model or proprietary interface name; all descriptions correspond to common industry practices.

    2. Capability Overview: What the Five Capabilities Solve

    These five capabilities are not isolated from one another. They all revolve around a single theme: extending the boundary of the context.

    • Web search: Addresses the limited freshness of model knowledge. In non-thinking mode, once the application enables a search tool, the model can automatically issue web or image queries based on the question and include citation sources in its answer.
    • Deep thinking search: Addresses the need for multi-round evidence gathering on complex problems. In thinking mode, the model can autonomously issue searches and read links during multi-step reasoning, forming a “reason, retrieve, reason again” loop.
    • File input: Addresses the difficulty of getting unstructured material into the context. It supports uploading documents, spreadsheets, presentations, images, and other formats, which are converted through plain-text extraction or mixed text-and-image parsing and then assembled into the conversation context.
    • Link reading: Addresses the problem of “the user provided a URL but the model cannot see the content.” Once the corresponding tool is enabled, the model can recognize links in messages, fetch the page body, and answer in combination with the context.
    • Safety validation: Addresses input and output compliance. Once the validation parameter is enabled, the serving side provides basic risk control, reviews inputs and outputs, and returns a refusal flag when a risk is hit.

    One engineering fact that is easy to overlook: the first four capabilities are all doing the same thing, converting external information into context fragments that can be assembled. The fifth capability adds a gate at both the entry and exit of the context. Understanding this keeps architecture design on track.

    3. The Tool-Calling Paradigm: The Model Decides, the Application Executes

    To implement the capabilities above, you first need to understand the basic loop of tool calling. A schematic interaction flow looks like this:

    1. User question
    2. -> Application assembles the request (available tool list, toggle parameters)
    3. -> Model returns: a direct answer or a tool call intent (tool name + parameters)
    4. -> Application executes the tool (retrieval/fetching/parsing) and gets structured results
    5. -> Results are fed back as context fragments (with source metadata)
    6. -> Model generates the final answer based on the expanded context (with citations)

    There are three key design points here.

    First, keep the tool list minimal. The more tools you expose to the model, the higher the probability of incorrect calls. In production, trim the tool set per business scenario rather than enabling everything at once.

    Second, call parameters must be constrainable. Retrieval tools typically allow limiting the number of results, time range, content type (web/image), and so on. Tightening these parameters can significantly improve answer quality and latency.

    Third, citations must be preserved in a structured way. Metadata such as source title, URL, and fetch time should be passed along the context as separate fields rather than concatenated into a block of plain text. Otherwise the frontend cannot render clickable citations, and later auditing becomes impossible.

    The two are often treated as the same thing, but the difference is substantial.

    Web search in non-thinking mode is single-round evidence gathering: the model determines that external information is needed, issues one search, and answers directly once results arrive. It has low latency and controllable cost, making it suitable for factual queries, price lookups, and time-sensitive news.

    Deep thinking search in thinking mode is multi-round evidence gathering: the model first decomposes the problem and identifies missing information, then issues a search; after reading the results, if the evidence is insufficient or conflicting, it issues new searches or reads specific links; this repeats until the evidence chain is closed. It suits tasks that require comparison, reasoning, and multi-constraint validation, such as “compare the applicable boundaries of three technical approaches and give a selection recommendation.”

    The engineering recommendation is to make mode selection a configurable item, decided by the business side based on problem complexity, rather than requiring users to switch manually. A lightweight complexity check can route requests, for example whether the question involves comparing multiple entities, whether it asks for supporting evidence, and whether it involves a time range.

    1. {
    2. "mode": "think",
    3. "tools": ["web_search"],
    4. "search_options": {
    5. "max_results": 8,
    6. "include_images": false,
    7. "recency": "year"
    8. }
    9. }

    It is worth emphasizing that multi-round evidence gathering amplifies latency and call cost. Set a maximum iteration count and timeout limit to avoid runaway reasoning.

    5. File Input: Parsing Quality Sets the Ceiling

    The value of the file input capability depends on the quality of the parsing stage. The common practice is to split the flow into three stages:

    1. Format normalization: Documents, spreadsheets, presentations, and images are converted into a processable intermediate representation. Text-based files go through plain-text extraction; files with heavy layout information go through mixed text-and-image parsing that preserves paragraph order and the positional relationship of charts.
    2. Structure annotation: Attach locating information such as page numbers, section titles, and table indices to fragments. This step determines whether citations can later be precise down to “page X, paragraph Y,” which directly affects the verifiability of answers.
    3. Context assembly: Control the injected length. For overly long documents, perform retrieval-based recall first and assemble only the fragments most relevant to the question into the context, rather than stuffing everything in.

    Common engineering pitfalls include: scanned files lacking a text layer, causing extraction to come back empty; multi-column layouts being incorrectly concatenated line by line; and tables losing their row-and-column relationships after being flattened. It is advisable to add a lightweight validation after parsing (character count, fragment count, empty-fragment ratio) and, on anomalies, fall back to prompting the user for clarification rather than forcing the model to answer on an empty context.

    The implementation difficulty of link reading lies not in fetching but in trusted handling. Fetched page bodies are untrusted input. They should undergo body extraction, noise removal, and length truncation, and be clearly marked as external content in the context to reduce the chance of instructions embedded in the page interfering with the model.

    Safety validation should be designed as a closed loop rather than a single point:

    • On the entry side, review user input; on a risk hit, refuse directly and return a clear flag;
    • On the exit side, review model output to prevent leaks and inappropriate content;
    • External content returned by tools is also brought into the review scope;
    • All refusal events are logged for later policy tuning.
    1. Input review -> Call and reasoning -> Output review -> On risk hit, return refusal flag
    2. ^ |
    3. +-------- Audit log <----------+

    7. Architecture in Practice: Observable, Degradable, Replayable

    When combining the capabilities above into a production system, three principles are recommended.

    Observable: Record the latency, response size, hit and failure reasons for every tool call, forming a metrics dashboard broken down by capability, used together with logging services and monitoring alerts.

    Degradable: External retrieval and fetching are inherently unstable, so prepare fallback paths. On timeout, answer using the model’s internal knowledge and explicitly state that no live search was performed; on parsing failure, prompt the user to paste text instead.

    Replayable: Save snapshots of requests and tool results (after desensitization) to make it easy to reproduce issues and evaluate the effect of prompt and parameter adjustments.

    If the application needs to carry a large volume of files and snapshots, object storage can hold the original files and intermediate artifacts; asynchronous parsing tasks can be handed to a message queue to smooth out peaks; and the model service and parsing service are best hosted on a container platform for easy elastic scaling.

    8. Conclusion

    The significance of opening up interface capabilities is that infrastructure originally requiring teams to build themselves, such as retrieval, parsing, fetching, and risk control, is converged into configurable capability items. For developers, the real competitive edge lies not in whether these capabilities are used, but in whether you can design clear context assembly strategies, strict parameter constraints, and complete degradation and audit loops around them. Baidu AI Cloud’s practical thinking on related general technology directions is consistent with the engineering principles above: using combinations of general capabilities to support the robust construction of upper-layer applications.