aisubs 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/providers/chatgpt.js +19 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.5 - 2026-09-14
|
|
4
|
+
|
|
5
|
+
- Move ChatGPT Responses instructions into the developer input prefix so
|
|
6
|
+
stable subscription prompts participate in prompt caching.
|
|
7
|
+
|
|
3
8
|
## 0.3.4 - 2026-09-13
|
|
4
9
|
|
|
5
10
|
- Refresh account model catalogs on demand and update ChatGPT compatibility so
|
|
@@ -109,6 +109,25 @@ async function normalizeChatGptRequest(request) {
|
|
|
109
109
|
if (!isRecord(raw))
|
|
110
110
|
return request;
|
|
111
111
|
const body = { ...raw };
|
|
112
|
+
// The Codex endpoint places the implicit cache boundary after input
|
|
113
|
+
// messages. Move stable top-level instructions into that prefix so they
|
|
114
|
+
// participate in prompt caching for subscription requests.
|
|
115
|
+
if (typeof body.instructions === "string" && body.instructions.length > 0) {
|
|
116
|
+
const input = Array.isArray(body.input)
|
|
117
|
+
? body.input
|
|
118
|
+
: typeof body.input === "string"
|
|
119
|
+
? [{ type: "message", role: "user", content: body.input }]
|
|
120
|
+
: [];
|
|
121
|
+
body.input = [
|
|
122
|
+
{
|
|
123
|
+
type: "message",
|
|
124
|
+
role: "developer",
|
|
125
|
+
content: [{ type: "input_text", text: body.instructions }],
|
|
126
|
+
},
|
|
127
|
+
...input,
|
|
128
|
+
];
|
|
129
|
+
delete body.instructions;
|
|
130
|
+
}
|
|
112
131
|
delete body.prompt_cache_options;
|
|
113
132
|
delete body.prompt_cache_retention;
|
|
114
133
|
const stripBreakpoints = (value) => Array.isArray(value)
|