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

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