Skip to content

API 参考

Apps SDK API 参考文档

工具描述符参数

工具可以包含以下元数据字段:

  • securitySchemes - 定义认证要求
  • outputTemplate - 指定 component HTML 模板
  • readOnlyHint - 标注工具不修改状态
  • toolInvocation/invoking - 工具运行时的状态文本

Component 资源元数据

Component 资源可以定义:

  • widgetDescription - Widget 的可读描述
  • contentSecurityPolicy - CSP 配置
  • preferredRenderingStyle - 首选渲染样式

工具结果结构

工具结果可以包含:

  • structuredContent - 结构化数据供 component 使用
  • content - 可选的自由文本
  • _meta - 仅供 component 使用的额外信息
  • www_authenticate - 用于处理认证错误

客户端提供的元数据

客户端提供的元数据包括:

  • locale - 用户语言环境
  • userAgent - 用户代理字符串
  • approximateLocation - 用户大致位置

这些元数据是建议性的,不应用于授权决策。

该参考提供了在 OpenAI Apps SDK 生态系统中构建交互式工具和 component 的全面指南。