核心类型
type ChatMode =
| "auto" | "fast" | "think" | "image" | "video"
| "code" | "research" | "roast" | "genui"
| "data_extraction";
type PersonaInput = "theo" | "none" | { system_prompt: string };
type CompletionAttachment =
| { type: "image_url"; url: string }
| { type: "image_base64"; data: string; mime_type: "image/png" | "image/jpeg" | "image/webp" | "image/gif" };
type TheoImageEngine =
| "auto" | "theo-1-create" | "theo-1-photo" | "theo-1-rapid"
| "theo-1-design" | "theo-1-studio" | "theo-1-type";
type TheoImageQuality = "draft" | "standard" | "hd";
type TheoStealthAspect = "square" | "portrait" | "landscape" | "wide";
type TheoStealthDuration = "5s" | "6s" | "10s";
针对特定场景,还提供了更多领域专用模式。请联系我们或查阅 API 以获取完整列表。
补全请求 / 响应类型
| 类型 | 使用方 | 说明 |
|---|---|---|
CompletionRequest | theo.complete()、theo.stream() | 请求体 — 支持 conversation、personality_config、response_style、theo_branding、brand_soul、attachments、隐身固定参数 |
CompletionResponse | theo.complete() | 响应 — 包含 request_id、conversation_id、完整的 usage |
CompletionUsage | CompletionResponse、StreamDoneData | { cost_cents, prompt_tokens, completion_tokens, total_tokens, cached? } |
GenUICompletionResponse | 当 mode === "genui" 时用于 theo.complete() | 新增 genui_code 字段 |
PersonalityConfigInput | CompletionRequest.personality_config | 单次请求级别的特质与无审查模式覆盖 |
ResponseStyleInput | CompletionRequest.response_style | 单次请求级别的格式/精确度/意图覆盖 |
InlineConversation、InlineConversationMessage | CompletionRequest.conversation | 供无状态调用方使用的内联历史信封 |
流式类型
| 类型 | 说明 |
|---|---|
TheoStream | theo.stream() 返回的类 — 可异步迭代,提供 cancel()、conversationId、usage、model、requestId、content、isCancelled |
StreamEvent | 基于 meta | token | tool | artifact | genui_meta | skills | done | error 的可辨识联合类型 |
StreamMetaData | meta 事件的负载 |
StreamTokenData | { token: string } |
StreamToolData | { name, status, description? } |
StreamSkillsData | { active: [...] } |
StreamDoneData | done 事件的负载(完整内容 + 用量 + 各类 ID) |
StreamErrorData | error 事件的负载 — 与 REST 错误信封保持一致 |
GenUIMetaEvent | genui_meta 事件的负载 |
诊断类型
| 类型 | 使用方 | 说明 |
|---|---|---|
VerifyResult | theo.verify() | { healthy, authenticated, baseUrl, latencyMs, modelCount?, version?, error?, hint? } |
媒体与音频类型
| 类型 | 使用方 | 说明 |
|---|---|---|
ImageRequest、ImageResponse | theo.images() | 图像请求/响应 |
VideoRequest | theo.video() | 视频生成请求 |
CodeRequest、CodeResponse | theo.code() | 代码请求/响应 |
ResearchRequest | theo.research() | 研究请求 |
DocumentRequest、DocumentResponse | theo.documents() | 文档请求/响应 |
TtsRequest | theo.tts() | TTS(文本转语音)请求 |
SttResponse | theo.stt() | STT(语音转文本)响应 |
AsyncJobResponse | theo.video()、theo.research() | 异步任务创建响应 |
JobStatus | theo.job()、theo.waitForJob() | 任务轮询响应 |
资源记录类型
| 类型 | 使用方 | 说明 |
|---|---|---|
ConversationSummary | theo.conversations() | 精简的会话元数据 |
ConversationDetail | theo.conversation(id) | 摘要信息加完整消息历史 |
ConversationMessage | ConversationDetail.messages[] | 单条消息记录 |
SkillSummary | theo.skills()、theo.createSkill() | 技能列表条目结构 |
SdkToolDefinition | theo.tools() | 工具定义 — name, description, inputSchema, outputSchema?, permissionLevel, requiresApproval, skillId?, category? |
WorkflowRecord | theo.workflows()、theo.createWorkflow() | 工作流结构 |
WorkflowRunRecord | theo.triggerWorkflow() | 工作流运行记录结构 |
SubmissionRecord | theo.submitSkill()、theo.submissions() | 技能市场提交记录 |
SkillVersion | theo.skillVersions() | 版本历史条目 |
WebhookRecord、WebhookDelivery | Webhook 相关方法 | Webhook 端点 + 投递尝试记录 |
HookRecord、HookExecution | Hook 相关方法 | Hook 及其执行历史 |
EventAck | theo.publishEvent() | 发布确认回执 |
UsageReport | theo.usage() | 聚合用量总计,以及按模式/按模型的明细 |
HealthResponse | theo.health() | 系统健康状态响应 |
ModelInfo | theo.models() | 模型注册表条目 |
浏览器会话类型
| 类型 | 使用方 | 说明 |
|---|---|---|
BrowserRegion | BrowserCreateRequest.region | 数据中心区域 |
BrowserCreateRequest | theo.browser.create() | 会话启动选项 |
BrowserSessionHandle、BrowserSessionSnapshot | theo.browser.create() / list() / get() | 会话元数据 |
BrowserLiveView | theo.browser.live() | 实时查看 URL + 页面 + 版本 |
BrowserEndResult | theo.browser.end() | 时长 + 计费字节数 |
技能编写类型
| 类型 | 说明 |
|---|---|
SkillManifestInput | defineSkill() 的输入 |
SkillManifest | defineSkill() 校验后的输出 |
SkillCategory | "productivity"、"domain"、"integration"、"automation"、"creative" |
SkillPermission | "read:conversations"、"read:artifacts"、"write:artifacts" 等 |
SkillTriggerType | "manual"、"keyword"、"event"、"schedule" |
SkillToolInput | 技能清单中的工具定义 |
SkillTriggerInput | 触发器配置 |
E.V.I. 类型
| 类型 | 说明 |
|---|---|
EviConfig | theo.evi() 的配置 |
CanvasVisibility、CanvasStatus | 画布可见性 + 生命周期状态 |
CanvasRecord | API 返回的画布记录行 |
CreateCanvasInput、UpdateCanvasInput、PublishCanvasInput | 画布变更操作的输入 |
CanvasCompileResult、CanvasTestResult、CanvasPublishResult | 编译 / 测试 / 发布结果 |
TheoProjectConfig | theo.config.ts 的配置 |
TheoConfig | 客户端构造函数选项 |
