@vincemakes/kiso-provider-openai-responses 0.43.0 → 0.45.0
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/README.md +3 -2
- package/dist/index.js +12 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ new dependency (plain `fetch` plus a hand-rolled SSE reader).
|
|
|
6
6
|
| target | auth | endpoint | what is different |
|
|
7
7
|
|---|---|---|---|
|
|
8
8
|
| OpenAI first-party | API key (`kiso login openai`, or `OPENAI_API_KEY`) | `https://api.openai.com/v1/responses` | the public Responses API |
|
|
9
|
-
| ChatGPT subscription | the stored OAuth credential (`kiso login chatgpt`) | `https://chatgpt.com/backend-api/codex/responses` | `chatgpt-account-id` / `originator` / `OpenAI-Beta` headers; `store: false`, `include: ["reasoning.encrypted_content"]`, `prompt_cache_key` |
|
|
9
|
+
| ChatGPT subscription | the stored OAuth credential (`kiso login chatgpt`) | `https://chatgpt.com/backend-api/codex/responses` | `chatgpt-account-id` / `originator` / `OpenAI-Beta` headers, and `session-id` (the session's cache lane, the same value as `prompt_cache_key`); `store: false`, `include: ["reasoning.encrypted_content"]`, `prompt_cache_key` |
|
|
10
10
|
|
|
11
11
|
The target is inferred from the options the factory is handed — an
|
|
12
12
|
`apiKey` builds the first-party adapter, an `oauth` thunk builds the
|
|
@@ -27,7 +27,8 @@ LOCAL double (`tests/helpers/rig.ts`); no test reaches a vendor.
|
|
|
27
27
|
| streaming | ✓ | ✓ | `or1-stream` — the nine adapter events in order, `usage` before `stop`, both from the same terminal frame |
|
|
28
28
|
| tool call + next turn | ✓ | ✓ | `or1-tool-turn` — the emitted `callId` is the `call_id`, and the next request replays it as `function_call_output` |
|
|
29
29
|
| reasoning effort | ✓ | ✓ | `or1-request-rig` shape 3 — `reasoning.effort` carries the level it was handed |
|
|
30
|
-
| reasoning
|
|
30
|
+
| reasoning summary | ✓ | ✓ | `or1-request-rig` shapes 3 and 4b — with an effort, `reasoning.summary: "auto"`; the summary streams as `thinking` events (`or1-stream`); no effort, no `reasoning` key |
|
|
31
|
+
| reasoning replay (`store: false`) | n/a | ✓ | `or1-continuation` — one `stop.continuation` entry per encrypted reasoning item, replayed verbatim (its summary included) on scope match only |
|
|
31
32
|
| cancel | ✓ | ✓ | `or1-errors` — an abort ends the turn with an `AbortError`, no `stop`, nothing retryable |
|
|
32
33
|
| error mapping | ✓ | ✓ | `or1-errors` — 429/401/400/503 by status, both `Retry-After` forms in milliseconds |
|
|
33
34
|
| retry authority | ✓ | ✓ | `or1-retry-authority` — exactly one request per stream, on every failure class |
|
package/dist/index.js
CHANGED
|
@@ -71,6 +71,12 @@ function resolveTarget(config) {
|
|
|
71
71
|
"chatgpt-account-id": token.accountId,
|
|
72
72
|
originator: "kiso",
|
|
73
73
|
"OpenAI-Beta": "responses=experimental",
|
|
74
|
+
// The backend routes a session's requests to one cache by
|
|
75
|
+
// this header. With the body's prompt_cache_key alone most
|
|
76
|
+
// requests landed elsewhere and missed the cache (measured:
|
|
77
|
+
// about 14% of input cached, 54% with the header). Same
|
|
78
|
+
// value as the key, so a conversation is one lane.
|
|
79
|
+
...(config.promptCacheKey !== undefined ? { "session-id": config.promptCacheKey } : {}),
|
|
74
80
|
};
|
|
75
81
|
},
|
|
76
82
|
// The backend rejects `store: true`; with nothing stored, the
|
|
@@ -122,7 +128,12 @@ function buildBody(options, target, scopeProviderId) {
|
|
|
122
128
|
// dialect parameter for a human reader and never reaches an
|
|
123
129
|
// adapter — the dialect path is this adapter's own knowledge, and
|
|
124
130
|
// the level is transported as handed. Absent adds NO key.
|
|
125
|
-
|
|
131
|
+
// With an effort, the reasoning summary is asked for too: the API
|
|
132
|
+
// streams summaries only on request (they arrive as `thinking`
|
|
133
|
+
// events below), and "auto" takes the most detailed one the model
|
|
134
|
+
// offers. No effort still means no key: whether a model reasons is
|
|
135
|
+
// not this adapter's call.
|
|
136
|
+
...(options.reasoning?.effort !== undefined ? { reasoning: { effort: options.reasoning.effort, summary: "auto" } } : {}),
|
|
126
137
|
...(options.maxTokens !== undefined ? { max_output_tokens: options.maxTokens } : {}),
|
|
127
138
|
...(options.temperature !== undefined ? { temperature: options.temperature } : {}),
|
|
128
139
|
...target.extraBody,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-provider-openai-responses",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"description": "kiso OpenAI Responses adapter \u2014 the first-party Responses API and the ChatGPT subscription backend, one adapter, plain fetch + SSE.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"test": "vitest run"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@vincemakes/kiso-core": "0.
|
|
24
|
+
"@vincemakes/kiso-core": "0.45.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^26.1.2",
|