logoAnt Design X

DesignDevelopmentComponentsX MarkdownX SDKPlayground
  • Ant Design X
  • Changelog
    v2.0.0-alpha.9
  • Model Integration
    • OpenAI
    • Qwen
  • Agent Integration
    • Tbox
  • Basic Usage
    • Usage with create-react-app
    • Usage with Vite
    • Usage with Next.js
    • Usage with Umi
    • Usage with Rsbuild
  • Advanced Usage
    • Common Props
  • Other
    • Contributing
    • FAQ

Tbox

Resources

Ant Design
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

This guide introduces how to integrate Tbox agent services into applications built with Ant Design X.

Related Documentation

  • Tbox Open Platform Official Website - https://tbox.cn/open
  • Tbox Open Platform Overview - https://alipaytbox.yuque.com/sxs0ba/doc/tbox_open_overview
  • Authorization Management - https://alipaytbox.yuque.com/sxs0ba/doc/tbox_open_token
  • OpenAPI - https://alipaytbox.yuque.com/sxs0ba/doc/tbox_openapi_overview

tbox-nodejs-sdk

ts
import { TboxClient } from 'tbox-nodejs-sdk';
const client = new TboxClient({
httpClientConfig: {
authorization: 'Tbox-your-token-xxx',
},
});
const stream = client.chat({
appId: 'your-app-id',
query: '今天杭州天气怎么样?',
userId: 'user123',
});
stream.on('data', (data) => {
console.log('Received data:', data);
});
stream.on('end', () => {
console.log('Stream ended');
});
stream.on('error', (error) => {
console.error('Stream error:', error);
});

Integrate tbox-nodejs-sdk with X SDK

Using URL to integrate agents is a basic capability provided by X SDK. For details, see X SDK. For the complete Tbox template, see Template - Tbox.

Example

Integrate with X SDK
CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code