npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ant-design/x-sdk

v2.1.0

Published

placeholder for @ant-design/x-sdk

Downloads

2,569

Readme

Efficiently manage large model data streams

CI status codecov NPM version

NPM downloads antd Follow zhihu

Changelog · Report a Bug · Request a Feature · English · 中文

Introduction

@ant-design/x-sdk provides a set of tool APIs designed to help developers manage AI conversation application data flows out of the box.

📦 Installation

npm install @ant-design/x-sdk
yarn add @ant-design/x-sdk
pnpm add @ant-design/x-sdk
ut install @ant-design/x-sdk

Browser Import

Use script and link tags to directly import files in the browser, and use the global variable XSDK.

We provide x-sdk.js, x-sdk.min.js, and x-sdk.min.js.map in the dist directory of the npm package.

Strongly not recommended to use built files, as this prevents on-demand loading and makes it difficult to get quick bug fixes for underlying dependency modules.

Note: x-sdk.js, x-sdk.min.js, and x-sdk.min.js.map depend on react and react-dom. Please ensure these files are imported in advance.

Example

import React from 'react';
import { XRequest } from '@ant-design/x-sdk';

export default () => {
  const [status, setStatus] = React.useState('');
  const [lines, setLines] = React.useState<Record<string, string>[]>([]);

  React.useEffect(() => {
    setStatus('pending');

    XRequest('https://api.example.com/chat', {
      params: {
        model: 'gpt-3.5-turbo',
        messages: [{ role: 'user', content: 'hello, who are u?' }],
        stream: true,
      },
      callbacks: {
        onSuccess: (messages) => {
          setStatus('success');
          console.log('onSuccess', messages);
        },
        onError: (error) => {
          setStatus('error');
          console.error('onError', error);
        },
        onUpdate: (msg) => {
          setLines((pre) => [...pre, msg]);
          console.log('onUpdate', msg);
        },
      },
    });
  }, []);

  return (
    <div>
      <div>Status: {status}</div>
      <div>Lines: {lines.length}</div>
    </div>
  );
};

🌈 Enterprise-level LLM Components Out of the Box

@ant-design/x provides a rich set of atomic components for different interaction stages based on the RICH interaction paradigm, helping you flexibly build your AI applications. See details here.

✨ Markdown Renderer

@ant-design/x-markdown aims to provide a streaming-friendly, highly extensible, and high-performance Markdown renderer. It supports streaming rendering of formulas, code highlighting, mermaid, and more. See details here.

How to Contribute

Before participating in any form, please read the Contributor Guide. If you wish to contribute, feel free to submit a Pull Request or report a Bug.

We highly recommend reading How To Ask Questions The Smart Way, How to Ask Questions in Open Source Community, How to Report Bugs Effectively, and How to Submit Unanswerable Questions to Open Source Projects. Better questions are more likely to get help.

Community Support

If you encounter problems during use, you can seek help through the following channels. We also encourage experienced users to help newcomers through these channels.

When asking questions on GitHub Discussions, it is recommended to use the Q&A tag.

  1. GitHub Discussions
  2. GitHub Issues