百宝箱
百宝箱
这篇指南将介绍如何在使用 Ant Design X 搭建的应用中接入百宝箱智能体服务。
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);});
使用URL接入智能体是 X SDK提供的基础能力,详情请查看X SDK,百宝箱完整样板间请查看样板间-百宝箱。