Structured Outputs

Structured Outputs 中介绍了获得结构化输出的三种方式(Function Calling、Structured Outputs、JSON Mode),当使用 JSON Mode 的时候,对提示词有一些要求,即提示词中必须明确包含 JSON 字符串,原始内容如下:

When using JSON mode, you must always instruct the model to produce JSON via some message in the conversation, for example via your system message. If you don't include an explicit instruction to generate JSON, the model may generate an unending stream of whitespace and the request may run continually until it reaches the token limit. To help ensure you don't forget, the API will throw an error if the string "JSON" does not appear somewhere in the context.

Meta Prompting(Prompt Generation and Optimization)

OpenAI 有一个 Playground 可以帮助用户方便快捷地测试各种模型和 API 的能力,其中提供了一些快捷生成功能来帮助用户迅速填充请求参数,他们单独写了一篇文档(Prompt generation)来介绍快捷生成背后的原理。

第一个情景是帮助用户通过简单描述来从零生成系统提示词或对系统提示词进行修改。根据描述生成或修改提示词的工作也是通过调用对话补全模型完成的,其中用到提示词被称为 Meta-prompts,官方声称他们撰写的 meta-prompts 遵循了最佳实践(prompt engineering best practices)和用户真实使用的经验。

其中还提到另外两种用于生成提示词的方法,分别是:DSPy 和 "Gradient Descent"。

第二个情景是帮助用户生成测试 Structured Outputs 所需的 JSON Schema。根据描述生成 JSON Schema 的工作也是通过调用启用了 Structured Outputs 的对话补全模型完成的,其中用到的 JSON Schema 被称为 meta-schema,文中介绍了他们如何从 JSON Mode 开始一步一步在 AI 的帮助下得到了 meta-prompt,并分享了核心的 Prompt。

Enhance your prompts with meta prompting 是 Teodora Musatoiu(OpenAI 官方成员)写的一篇如何在生产中使用 Meta prompting 的博客。

Tool Calls

https://platform.openai.com/docs/guides/text#tool-calls

Diff Generation

https://platform.openai.com/docs/guides/text#diff-generation

Recursively Summarizing