OpenAI 发布客户服务智能体演示的开源版本,集成Agents SDK

  OpenAI 在GitHub上(https://github.com/openai/openai-cs-agents-dem)o)开源了一个全新的多智能体客户服务演示项目,展示了如何利用其Agents SDK构    建领域专用的AI智能体。这个名为openai-cs-agents-demo的项目模拟了一个航空公司客户服务聊天机器人,该机器人能够通过将请求动态路由至专业智能体,来处理一系列与旅行相关的查询。该系统采用Python后端和Next.js前端构建,既提供了功能完善的对话界面,又能可视化呈现智能体交接和护栏激活的过程。

Image

   其架构主要分为两个核心组件:Python后端利用Agents SDK处理智能体的编排工作,而Next.js前端则提供聊天界面以及智能体转换的交互式可视化功能。这种设置使得智能体在对用户查询进行分类、响应或拒绝时,其决策和任务分配过程具有透明度。该演示包含多个专注型智能体:分诊智能体、座位预订智能体、航班状态智能体、取消预订智能体以及常见问题解答智能体。每个智能体都配置了专门的指令和工具,以完成各自的特定子任务。

  当用户输入请求时,例如“更改我的座位”或“取消我的航班”,分诊智能体会处理该输入以确定意图,并将查询分发给相应的下游智能体。例如,预订更改请求会被路由至座位预订智能体,该智能体可以验证确认号码、提供座位图选择,并完成座位更改。如果用户请求取消预订,系统会将任务交接给取消预订智能体,该智能体会遵循结构化流程来确认并执行取消操作。此外,该演示还包括用于实时航班查询的航班状态智能体,以及回答行李政策或机型等一般性问题的常见问题解答智能体。

  该系统的一个关键优势在于其集成了用于确保安全性和相关性的护栏机制。演示中包含两种护栏:相关性护栏和越狱护栏。相关性护栏会过滤掉无关主题的查询,例如拒绝“为我写一首关于草莓的诗”这类提示。越狱护栏则会阻止试图规避系统边界或操纵智能体行为的尝试,例如要求模型透露其内部指令。当任何一种护栏被触发时,系统会在追踪过程中突出显示该情况,并向用户发送结构化的错误消息。

  Agents SDK本身是作为编排的核心存在。每个智能体都被定义为一个可组合的单元,包含提示模板、工具访问权限、交接逻辑和输出模式。SDK通过“交接”来处理智能体的链式调用,支持实时追踪,并允许开发人员通过护栏来执行输入/输出约束。这个框架与驱动OpenAI内部使用工具和推理智能体的实验框架相同,但现在以具有教育意义且可扩展的形式对外开放。

  开发人员可以在本地运行该演示,只需使用Uvicorn启动Python后端服务器,并通过单个npm run dev命令启动前端。整个系统是可配置的,开发人员可以插入新的智能体、定义自己的任务路由策略,以及实现自定义护栏。通过对提示、决策和追踪日志的完全透明化展示,该演示为客户支持或其他企业领域的实际对话式AI系统提供了实用的基础。

  通过发布这个参考实现,OpenAI提供了一个切实的示例,展示了如何将多智能体协调、工具使用和安全检查结合起来,形成强大的服务体验。这对于希望了解智能体系统架构,以及如何构建模块化、可控制且兼具透明性和生产就绪性的AI工作流的开发人员来说,具有特别的价值。

### OpenAI Agents SDK Documentation and Usage Guide OpenAI has announced plans to introduce additional tools and integrations aimed at assisting developers with deploying, evaluating, and optimizing Agent-based applications over the coming months[^1]. These enhancements are expected to provide comprehensive support for leveraging OpenAI’s advanced models within custom workflows. For those interested in exploring or implementing the **Agents SDK**, it is important to note that while detailed official documentation may not yet be fully available publicly, there exist preliminary resources indicating how one might interact programmatically with these services. Below is an illustrative Python function demonstrating interaction via direct API calls: ```python import openai def get_completion(prompt, model="gpt-3.5-turbo"): """ Sends a user-defined prompt to the specified GPT model. Parameters: prompt (str): Input text provided by the user. model (str): Name of the language model being used. Returns: str: Generated content from the model's response. """ messages = [{"role": "user", "content": prompt}] response = openai.ChatCompletion.create( model=model, messages=messages, temperature=0, ) return response.choices[0].message["content"] ``` This snippet exemplifies basic communication between client-side scripts and server-hosted models through structured message exchanges[^3]. Moreover, considerations around enterprise-level privacy policies dictate that business-related information processed under such frameworks will remain confidential unless explicitly consented otherwise; further details regarding this aspect reside here: https://enterprise-privacy/. Lastly, although unrelated specifically to OpenAI agents but still relevant concerning interoperability among diverse platforms—Windows Phone 8 supports mechanisms allowing third-party programs to invoke others depending upon certain conditions like encountered file types or URL schemes[^4], which could serve as inspiration when designing similar behaviors inside agent ecosystems. Additionally, other organizations have made strides towards integrating coding functionalities into their respective infrastructures too—for instance, Together AI acquired CodeSandbox aiming toward enhancing its inference system so that large-scale machine learning projects gain native scripting execution abilities useful across various domains including automated task management pipelines[^5].
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值