@velocirouter/pi 1.0.0 → 1.0.1
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/index.js +6 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -47,13 +47,18 @@ function toModel(row) {
|
|
|
47
47
|
// reserve the output share or a long session overshoots the input ceiling.
|
|
48
48
|
contextWindow: totalWindow > maxTokens ? totalWindow - maxTokens : totalWindow,
|
|
49
49
|
maxTokens,
|
|
50
|
+
// pi only sends x-session-affinity for OpenRouter by default
|
|
51
|
+
compat: { sendSessionAffinityHeaders: true },
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
// Stored models carry the baseUrl they were fetched from; dropping it lets
|
|
54
56
|
// the provider-level one win when VELOCIROUTER_BASE_URL changes.
|
|
55
57
|
function restore(stored) {
|
|
56
|
-
return stored?.models.filter((model) => model.provider === PROVIDER).map(({ baseUrl, ...model }) =>
|
|
58
|
+
return stored?.models.filter((model) => model.provider === PROVIDER).map(({ baseUrl, ...model }) => ({
|
|
59
|
+
...model,
|
|
60
|
+
compat: { ...model.compat, sendSessionAffinityHeaders: true },
|
|
61
|
+
}))
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
async function refreshModels({ credential, stored, publish, allowNetwork, signal }) {
|