Skip to Content
开发文档快速开始

快速开始

本指南将帮助你快速开始使用 Toco AI。

安装

前提条件

  • Node.js 18+
  • npm 或 yarn 或 pnpm

安装步骤

# 使用 npm npm install toco-ai # 使用 yarn yarn add toco-ai # 使用 pnpm pnpm add toco-ai

基本使用

初始化

import { TocoAI } from 'toco-ai'; const toco = new TocoAI({ apiKey: 'your-api-key', environment: 'production' });

第一个示例

// 创建一个简单的代码生成任务 const result = await toco.generateCode({ prompt: "创建一个 React 组件,显示用户列表", language: "typescript" }); console.log(result.code);

下一步

Last updated on