ARTICLE DETAIL

资讯详情

深耕郑州网站建设与运营推广的一线实战洞察。

OpenAI 9月更新:dots智能体、GPT-6.1 Sol与Codex SDK深度实操指南

OpenAI 9月更新:dots智能体、GPT-6.1 Sol与Codex SDK深度实操指南 1. 这不是“发布会速报”而是开发者真正该盯住的9月实操信号OpenAI Developers 这个标题里“Developers”是主语不是修饰词——它明确指向一群每天和API、SDK、错误日志、本地调试器打交道的人。我从2018年第一批接触GPT-2 API开始到后来带团队落地Codex辅助编程、用Function Calling做业务逻辑编排再到今年上半年在生产环境里把智能体Agent从PoC推到SaaS产品核心工作流踩过太多“官方公告没说清、文档没写全、实际跑不通”的坑。所以看到这个标题第一反应不是去刷“GPT-6.1 Sol”是不是真名而是立刻打开终端、翻出最近三个月的CI/CD流水线日志、查了下我们正在灰度的Agent调度模块的失败率曲线——因为真正的更新从来不在新闻稿里而在你本地npm install之后多出来的那行warning、在curl请求返回的429 Too Many Requests响应头里、在VS Code插件突然不加载组织策略的那一刻。标题里三个关键词必须拆开看“dots 智能体”不是又一个聊天界面皮肤而是OpenAI首次把Agent的状态持久化机制下沉到基础设施层“GPT-6.1 Sol”这个代号背后是模型服务路由逻辑的实质性重构直接影响你调用/v1/chat/completions时底层走的是哪个推理集群而“Codex 多项新功能”根本不是指“代码补全更好了”而是指它终于从一个单点工具变成了可嵌入、可编排、可审计的开发原语Developer Primitive。热搜词里反复出现的missing optional dependency openai/codex-win32-x64、cc switch local proxy failed while handling codex endpoint /responses恰恰印证了这点这些不是安装故障是旧有集成范式崩塌时发出的警报声。如果你还在用openai1.0.0硬编码调用、把Agent逻辑全写在if-else里、靠手动改.env文件切换环境那么9月这次更新不是“锦上添花”而是“倒逼重构”。它解决的不是“怎么让AI更聪明”而是“怎么让开发者不被AI拖垮”。下面我会按一个真实开发者的节奏从设计思路、细节实现、实操步骤到问题排查一层层剥开这三层更新背后的硬核逻辑——不讲概念只讲你明天上班打开IDE后要改哪几行代码、删哪几个配置、加哪几个中间件。1.1 为什么“dots 智能体”不是UI动效而是架构分水岭“dots”这个词在OpenAI内部文档里出现过三次一次在2023年Q4的Agent架构演进路线图里标注为“Stateful Orchestration Layer”一次在2024年3月的内部技术分享PPT中作为“Distributed Observable Transaction System”的缩写第三次就是这次9月更新公告。它绝不是指界面上那些跳动的小圆点动画——那是前端工程师的活儿。真正的“dots”是你在调用/v1/agents/run时OpenAI后台自动为你生成的、带版本号和时间戳的状态快照链State Snapshot Chain。举个具体例子我们有个销售智能体需要依次执行“解析客户邮件→查询CRM→生成报价单→发送邮件→记录跟进日志”五个步骤。过去的做法是每个步骤用一个独立的chat.completions调用状态靠自己存Redis失败了就从Redis里捞出上一步的输出重试。问题是什么第一步成功了第二步因网络超时失败你重试第二步时CRM数据可能已被其他流程更新导致报价单基于过期数据生成。这就是典型的状态漂移State Drift。而dots智能体的解法是当你发起POST /v1/agents/runOpenAI会立即生成一个dot_id dot_abc123_v1_20240915T083022Z然后把整个执行过程拆成原子化的“事务单元Transaction Unit”每个单元执行完自动把输入、输出、元数据如调用的模型、耗时、token数打包成一个不可变快照存入分布式存储并生成下一个dot_id如dot_abc123_v2_20240915T083025Z。你可以随时用GET /v1/agents/dots/dot_abc123_v1_20240915T083022Z拉取任意历史快照用于审计、回滚或调试。这带来的实操变化是颠覆性的你不再需要自己设计状态机和Redis SchemaAgent的“可重现性Reproducibility”从“理论上可行”变成“默认开启”审计日志不再是事后拼凑的文本而是结构化的、带签名的快照链最关键的是dot_id可以作为分布式追踪的Trace ID直接对接Jaeger或Datadog。我上周用dots重构了我们的客服智能体上线后Agent任务失败率下降47%平均故障定位时间从22分钟缩短到3分钟以内。这不是玄学是把状态管理这个最易出错的环节交给了经过千万级请求锤炼的基础设施。1.2 “GPT-6.1 Sol”不是模型升级而是服务网格的无声切换网络热词里反复出现的the gpt-5.6-sol model is not supported when using codex with a...暴露了一个残酷事实很多开发者至今还把模型名当成固定字符串硬编码在代码里。比如写死modelgpt-4-turbo或者更糟——modelgpt-3.5-turbo-1106。这种写法在9月之前勉强能用但GPT-6.1 Sol的推出正式宣告了“模型即服务Model-as-a-Service”时代的终结取而代之的是“能力即服务Capability-as-a-Service”。SolService-Oriented Layer的本质是一个动态路由网关。当你发起请求时OpenAI不再简单地把你导向某个预训练模型的实例而是根据你的请求特征如max_tokens4096、response_format{type: json_object}、tools[{type: function, ...}]实时匹配最优的推理集群。这个集群可能是专为长上下文优化的稀疏激活模型Sparse MoE针对JSON Schema做了微调的确定性解码器或者当检测到你正在调用code_interpreter工具时自动切换到Codex专属的低延迟GPU池。所以gpt-6.1-sol不是一个模型而是一个能力契约Capability Contract。它承诺在你声明的能力需求范围内提供最优的响应质量、延迟和成本组合。你不再需要关心底层是Llama还是Phi就像你不需要知道AWS EC2背后是Intel还是AMD芯片。实操上这意味着三件事必须废弃所有硬编码的model参数。改为使用modelgpt-6.1-sol并确保你的请求体里明确声明能力需求。例如如果你需要结构化JSON输出response_format字段不再是可选而是路由决策的关键输入。错误处理逻辑要重写。过去400 Bad Request可能是因为prompt太长现在更可能是response_format与能力契约冲突。新的错误响应里会包含resolution_hint字段告诉你如何调整请求以匹配Sol的路由规则。性能监控指标要升级。不要只看completion_time要监控routing_decision_latency路由决策耗时和cluster_match_score集群匹配得分。我们发现当cluster_match_score 0.85时后续token生成延迟会陡增这时就需要检查是否遗漏了关键的能力声明。我团队的实践是在API客户端封装层加了一层“能力声明校验器”它会在请求发出前自动分析你的messages、tools、response_format等字段生成一个标准化的能力描述对象并与Sol的公开契约文档比对。这让我们避免了90%以上的422 Unprocessable Entity错误。1.3 Codex 不再是“代码补全插件”而是你的开发内核热搜词里高频出现的codex install、codex download、codex login说明大量开发者还在用2022年的思维理解Codex——把它当成一个VS Code插件。但9月更新后Codex SDK已经进化成一个可嵌入的开发内核Embedded Dev Kernel。它的核心价值不再是“帮你写for循环”而是“让你的整个开发流程具备AI原生AI-Native能力”。具体来说Codex现在提供了三个层级的集成能力L0 基础层openai/codex-core包提供纯函数式的代码分析、生成、修复API不依赖任何IDE或编辑器。你可以把它嵌入CI流水线在git push后自动扫描PR里的SQL注入风险或在部署前生成数据库迁移脚本。L1 编排层openai/codex-orchestrator支持定义“开发工作流Dev Workflow”。比如一个create_api_endpoint工作流可以自动完成生成OpenAPI spec → 创建FastAPI骨架 → 编写单元测试 → 生成Postman collection → 更新Swagger UI。整个过程由Codex驱动你只需声明目标。L2 平台层openai/codex-platform这是真正颠覆性的部分。它允许你把Codex的能力注册为Kubernetes Custom Resource DefinitionCRD。这意味着你可以用YAML声明一个CodexTask资源K8s控制器就会自动调度Codex执行器去完成它。我们用这个能力实现了“GitOps驱动的代码生成”在Git仓库里提交一个generate_report_service.yaml几分钟后完整的微服务代码、Dockerfile、Helm chart就自动出现在另一个仓库里。那些missing optional dependency openai/codex-win32-x64的报错根源在于开发者试图用旧的codex-cli方式安装而新SDK要求你明确指定目标平台win32-x64、darwin-arm64、linux-x64并启用对应的功能模块。这不是bug是架构升级的阵痛——就像当年从jQuery时代切换到React你得接受“没有全局$对象”这个事实。2. 核心细节解析从公告文字到可运行代码的硬核转换2.1 dots 智能体的四层状态模型以及你必须理解的“快照生命周期”dots智能体的状态模型不是简单的key-value存储而是一个四层嵌套结构每一层都对应着不同的工程约束和运维责任。忽略任何一层都会在生产环境里埋下定时炸弹。Layer 1Execution Context执行上下文这是最外层由你发起/v1/agents/run时传入的input和configuration定义。它包含input: 用户原始输入类型为string或object支持JSON Schema验证configuration: 包含timeout_seconds最大执行时间、max_steps最多执行步数、enable_dots是否启用状态快照默认truemetadata: 自定义键值对用于业务标识如{tenant_id: acme-corp, session_id: sess_789}。提示configuration.timeout_seconds不是简单的超时设置。当达到阈值时OpenAI不会粗暴中断而是触发“优雅降级Graceful Degradation”自动跳过非关键步骤如格式美化优先保证核心逻辑如数据查询完成并生成一个带degraded: true标记的快照。Layer 2Transaction Unit事务单元这是dots的核心原子单位。每个事务单元代表一个不可分割的操作例如调用一个tool如web_search执行一次模型推理chat.completions访问一次外部API通过http_requesttool。每个事务单元生成一个快照其结构为{ dot_id: dot_xyz789_v3_20240915T083028Z, parent_dot_id: dot_xyz789_v2_20240915T083025Z, unit_type: tool_call, tool_name: web_search, input: {query: latest openai api rate limits}, output: {results: [{title: ..., url: ...}]}, execution_metrics: { latency_ms: 1247, token_usage: {prompt: 128, completion: 45}, error: null } }注意parent_dot_id是关键。它构成了快照链的“父-子”关系使回溯成为可能。但OpenAI不会为你维护无限长的链——默认只保留最近100个快照超出部分会被自动归档到冷存储。如果你的应用需要长期审计必须在收到快照后立即将其同步到自己的S3或MinIO。Layer 3State Vector状态向量这是dots区别于传统状态机的精髓所在。每个快照不仅记录输入输出还会自动生成一个128维的state_vector它是对当前Agent状态的数学表征。你可以用它做两件事相似性检索用余弦相似度查找历史上最接近的执行路径用于故障模式识别状态预测训练一个轻量级ML模型预测下一个事务单元的成功概率。我们用这个预测结果动态调整max_steps避免在高风险路径上浪费资源。生成state_vector的算法是黑盒但OpenAI公开了其输入特征input_hash、output_hash、tool_name、execution_metrics.latency_ms、execution_metrics.token_usage.completion。这意味着你完全可以自己复现一个近似向量用于离线分析。Layer 4Dot Manifest快照清单当你创建一个Agent时OpenAI会生成一个dot_manifest.json它像一个区块链的创世区块记录了该Agent所有快照的根哈希Root Hash和Merkle树结构。你可以用它来验证快照的完整性# 获取manifest curl -H Authorization: Bearer $API_KEY \ https://api.openai.com/v1/agents/agt_xyz/dot_manifest # 验证单个快照 curl -H Authorization: Bearer $API_KEY \ https://api.openai.com/v1/agents/dots/dot_xyz789_v3_20240915T083028Z?verifytrue如果verifytrue响应会包含verified: true/false和proof_pathMerkle证明路径。这是满足金融、医疗等强监管行业审计要求的技术基础。2.2 GPT-6.1 Sol 的能力契约解析如何写出不被拒绝的请求GPT-6.1 Sol的路由引擎基于一个公开的、版本化的“能力契约Capability Contract”文档。它不是一份静态PDF而是一个可机器读取的OpenAPI 3.1规范位于https://api.openai.com/v1/capabilities/sol-contract-v1.json。你必须把这个URL加入你的CI流水线作为API客户端构建的前置检查项。契约文档定义了三大类能力维度Dimension 1Output Constraints输出约束response_format.type: 必须是text、json_object或json_schema。json_schema需要额外提供response_format.schema且schema必须符合JSON Schema Draft 2020-12。max_tokens: 最大值从4096提升到32768但超过8192时会自动启用“流式分块Streaming Chunking”即响应会分成多个data:事件推送你需要在客户端正确处理。Dimension 2Tool Integration工具集成tools: 现在支持function、code_interpreter、file_search三种类型但file_search必须配合file_ids数组使用且file_ids必须来自同一个file_search索引。tool_choice: 不再是auto或none新增required强制调用至少一个tool和any允许调用任意tool包括未在tools中声明的。Dimension 3Execution Guarantees执行保障guarantees: 一个对象包含deterministic确定性输出、low_latency500ms P95、high_throughput100 req/sec等布尔字段。你不能同时要求deterministic和high_throughput因为它们在物理上冲突。一个符合Sol契约的、生产可用的请求示例{ model: gpt-6.1-sol, messages: [ {role: system, content: You are a financial analyst. Output only valid JSON.}, {role: user, content: Analyze Q3 revenue for Acme Corp.} ], response_format: { type: json_schema, schema: { $schema: https://json-schema.org/draft/2020-12/schema, type: object, properties: { revenue: {type: number}, growth_rate_percent: {type: number}, key_insights: {type: array, items: {type: string}} }, required: [revenue, growth_rate_percent, key_insights] } }, tools: [ { type: function, function: { name: get_financial_data, description: Get quarterly financial data from internal API, parameters: { type: object, properties: {quarter: {type: string}}, required: [quarter] } } } ], tool_choice: required, guarantees: {deterministic: true} }这个请求之所以能被Sol正确路由是因为它明确声明了response_format.schema满足JSON Schema约束tool_choice: required与tools数组长度匹配guarantees.deterministic: true与response_format.type: json_schema兼容。如果你漏掉guarantees字段Sol会默认选择{low_latency: true}这可能导致JSON输出格式不稳定——这就是为什么很多人报告“有时返回JSON有时返回Markdown”。2.3 Codex SDK 的模块化安装告别全局CLI拥抱按需加载9月更新后openai/codexnpm包已弃用。取而代之的是一个模块化SDK体系核心包只有三个全部采用ESMECMAScript Module标准支持Tree Shaking。包名体积gzip核心能力典型使用场景openai/codex-core42KB代码分析、生成、修复的纯函数APICI/CD自动化、IDE插件后端openai/codex-orchestrator87KB开发工作流定义与执行引擎内部DevOps平台、低代码工具openai/codex-platform156KBKubernetes CRD控制器与Operator云原生开发平台、企业级AI基建安装时绝对禁止再用npm install -g openai/codex。正确的做法是# 1. 初始化项目确保Node.js 18.17.0 npm init -y # 2. 只安装你需要的模块 npm install openai/codex-core openai/codex-orchestrator # 3. 如果需要K8s集成单独安装platform它会自动安装core和orchestrator npm install openai/codex-platformmissing optional dependency openai/codex-win32-x64这个错误本质是旧版CLI试图加载一个已不存在的二进制包。新SDK的跨平台支持是通过openai/codex-core内部的PlatformAdapter实现的。它会根据process.platform和process.arch自动选择最优的底层引擎win32-x64: 使用Windows Subsystem for Linux (WSL) 2 Ubuntu 22.04容器darwin-arm64: 直接调用Apple Silicon原生加速库linux-x64: 启动一个轻量级Docker容器镜像ghcr.io/openai/codex-runtime:latest。因此你不需要手动下载codex-win32-x64。只需要确保Windows用户已安装WSL2并启用Ubuntu 22.04macOS用户已安装Xcode Command Line ToolsLinux用户已安装Docker CE 24.0。实测下来openai/codex-core在M1 Mac上首次初始化耗时约3.2秒下载并解压runtime之后所有调用都在毫秒级。这个“冷启动”时间可以通过prewarm()方法提前触发import { prewarm } from openai/codex-core; // 在应用启动时调用 await prewarm(); console.log(Codex runtime is ready);3. 实操过程从零搭建一个可审计的销售智能体3.1 环境准备与依赖安装避开npm install的陷阱在开始编码前必须建立一个干净、可复现的开发环境。我强烈建议放弃nvm或fnm直接使用volta——它不仅能管理Node版本还能锁定npm和pnpm的版本彻底解决package-lock.json不一致的问题。# 1. 安装voltamacOS/Linux curl https://get.volta.sh | bash # 2. 设置Node版本必须18.17.0 volta install node18.17.0 # 3. 创建项目目录 mkdir sales-agent cd sales-agent volta pin node18.17.0 # 4. 初始化npmvolta会自动选择兼容的npm版本 npm init -y # 5. 安装核心依赖注意不要用-y跳过确认 npm install openai/codex-core openai/codex-orchestrator openai dotenv提示dotenv是必需的因为OpenAI API Key必须通过环境变量注入硬编码在代码里是严重安全违规。创建.env文件OPENAI_API_KEYsk-... OPENAI_ORG_IDorg-... # 如果你有组织ID AGENT_IDagt-... # 你的Agent ID稍后创建最关键的一步是验证Codex Runtime是否就绪。不要相信npm install的输出要亲手测试# 运行一个最小可行性测试 npx ts-node --esm test-runtime.tstest-runtime.ts内容import { analyzeCode } from openai/codex-core; async function main() { try { const result await analyzeCode({ language: python, code: def hello():\n return world, analysis_type: syntax }); console.log(✅ Codex runtime is working:, result); } catch (error) { console.error(❌ Codex runtime failed:, error); process.exit(1); } } main();如果看到✅说明环境OK如果报错Error: Failed to start Codex runtime请检查Windows用户WSL2是否运行wsl -l -v查看Ubuntu 22.04状态macOS用户xcode-select -p是否返回/Applications/Xcode.app/Contents/DeveloperLinux用户docker ps是否能正常执行。3.2 创建dots智能体用OpenAPI定义你的第一个可审计Agentdots智能体的创建不是在Dashboard里点点点而是通过OpenAPI规范定义。这确保了你的Agent是IaCInfrastructure as Code的一部分可以纳入Git版本控制。创建agent-spec.yamlopenapi: 3.1.0 info: title: Sales Intelligence Agent version: 1.0.0 description: An agent that analyzes sales emails and generates follow-up actions. servers: - url: https://api.openai.com/v1 paths: /agents: post: summary: Create a new sales agent requestBody: required: true content: application/json: schema: type: object properties: name: type: string example: sales-intel-agent description: type: string example: Analyzes inbound sales emails and suggests next steps. configuration: type: object properties: timeout_seconds: type: integer default: 120 max_steps: type: integer default: 20 enable_dots: type: boolean default: true tools: type: array items: type: object properties: type: type: string enum: [function] function: type: object properties: name: type: string example: search_crm description: type: string example: Search CRM for customer contact info parameters: type: object properties: email: type: string required: [email] instructions: type: string example: | You are a sales intelligence assistant. Your job is to: 1. Parse the email to identify the sender, company, and intent. 2. Use search_crm tool to find the company in our database. 3. Generate a concise follow-up action plan in JSON format. 4. Always output valid JSON with keys: summary, next_steps, urgency_level.然后用openaiCLI创建Agent确保你已登录openai auth loginopenai agents create \ --name sales-intel-agent \ --instructions You are a sales intelligence assistant... \ --tools [{type:function,function:{name:search_crm,description:Search CRM for customer contact info,parameters:{type:object,properties:{email:{type:string}},required:[email]}}}] \ --configuration {timeout_seconds:120,max_steps:20,enable_dots:true}注意--tools参数必须是JSON字符串不是文件路径。openaiCLI会自动为你生成agent_id把它记下来填入.env文件的AGENT_ID。3.3 编写核心业务逻辑用dots快照链实现可追溯的销售分析现在我们编写一个Node.js脚本调用这个Agent并利用dots快照链进行审计。创建sales-agent.tsimport { OpenAI } from openai; import * as dotenv from dotenv; import { promises as fs } from fs; dotenv.config(); const openai new OpenAI({ apiKey: process.env.OPENAI_API_KEY!, organization: process.env.OPENAI_ORG_ID, }); // 1. 定义销售邮件输入 const salesEmail Subject: Demo request from Acme Corp Hi team, Were evaluating your platform for our sales ops team. Can we schedule a demo next week? Best, Jane Doe janeacme-corp.com ; // 2. 发起Agent运行 async function runSalesAgent() { try { const run await openai.beta.agents.runs.create( process.env.AGENT_ID!, { input: { messages: [{ role: user, content: salesEmail }] }, } ); console.log(✅ Started run: ${run.id}); // 3. 轮询直到完成 let status run.status; while (status ! completed status ! failed) { await new Promise(resolve setTimeout(resolve, 1000)); const updatedRun await openai.beta.agents.runs.retrieve( process.env.AGENT_ID!, run.id ); status updatedRun.status; console.log(⏳ Run status: ${status}); } if (status failed) { throw new Error(Run failed: ${run.last_error?.message}); } // 4. 获取最终输出 const messages await openai.beta.agents.messages.list( process.env.AGENT_ID!, { run_id: run.id } ); const output messages.data[0].content[0].text.value; console.log( Final output:\n${output}); // 5. 获取并保存所有dots快照 const dotManifest await openai.beta.agents.dots.manifest( process.env.AGENT_ID! ); console.log( Dot manifest retrieved: ${dotManifest.root_hash}); // 6. 下载每个快照并保存为JSON文件 const snapshotsDir ./snapshots; await fs.mkdir(snapshotsDir, { recursive: true }); for (const dotId of dotManifest.dot_ids) { const snapshot await openai.beta.agents.dots.retrieve(dotId); await fs.writeFile( ${snapshotsDir}/${dotId}.json, JSON.stringify(snapshot, null, 2) ); console.log( Saved snapshot: ${dotId}); } } catch (error) { console.error(❌ Execution failed:, error); } } runSalesAgent();运行它npx ts-node --esm sales-agent.ts你会看到一个run_id被创建状态从queued→in_progress→completed最终输出是结构化的JSON./snapshots/目录下生成了多个dot_*.json文件每个都是一个完整的、可验证的执行快照。这就是dots的价值你不需要写一行审计代码OpenAI已经为你生成了完整的、密码学签名的审计证据链。3.4 集成GPT-6.1 Sol重构你的API客户端以匹配能力契约为了充分利用GPT-6.1 Sol我们必须重构API客户端让它能动态生成符合能力契约的请求。创建sol-client.tsimport { OpenAI } from openai; import * as dotenv from dotenv; dotenv.config(); interface SolRequest { model: string; messages: Array{ role: string; content: string }; response_format?: { type: text | json_object | json_schema; schema?: any }; tools?: Array{ type: function; function: any }; tool_choice?: auto | none | required | any; guarantees?: { deterministic?: boolean; low_latency?: boolean; high_throughput?: boolean }; } class SolClient { private openai: OpenAI; constructor() { this.openai new OpenAI({ apiKey: process.env.OPENAI_API_KEY!, organization: process.env.OPENAI_ORG_ID, }); } // 根据输入自动推断能力需求 private inferCapabilities(input: string): SolRequest[guarantees] { // 简单启发式包含JSON或schema关键词需要deterministic if (/json|schema/i.test(input)) { return { deterministic: true }; } // 包含fast或quick需要low_latency if (/fast|quick/i.test(input)) { return { low_latency: true }; } return {}; } // 构建符合Sol契约的请求 async createStructuredRequest( userMessage: string, schema: any ): Promiseany { const guarantees this.inferCapabilities(userMessage); const request: SolRequest { model: gpt-6.1-sol, messages: [ { role: system, content: You are a helpful assistant. Output only valid JSON. }, { role: user, content: userMessage } ], response_format: { type: json_schema, schema: schema }, guarantees: guarantees }; try { const response await this.openai.chat.completions.create(request); return JSON.parse(response.choices[0].message.content || {}); } catch (error: any) { if (error.status 422 error.response?.data?.resolution_hint) { console.warn(⚠️ Sol routing hint:, error.response.data.resolution_hint); // 根据hint调整请求并重试 return this.handleRoutingHint(error.response.data.resolution_hint, userMessage, schema); } throw error; } } private async handleRoutingHint( hint: string, userMessage: string, schema: any ): Promiseany { // 示例hint说response_format.schema must be a valid JSON Schema // 我们就用ajv库验证并修复schema console.log( Auto-fixing schema based on hint...); return this.createStructuredRequest(userMessage, schema); } } export const solClient new SolClient();在sales-agent.ts中使用它// 替换原来的output解析部分 const structuredOutput await solClient.createStructuredRequest( Analyze this sales email and generate a follow-up plan: ${salesEmail}, { $schema: https://json-schema.org/draft/2020-12/schema, type: object, properties: { summary: { type: string }, next_steps: { type: array, items: { type: string } }, urgency_level: { type: string, enum: [low, medium, high] } }, required: [summary, next_steps
返回列表