@zhexin/pi-agy 0.0.1 → 0.0.2
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/package.json +1 -1
- package/src/api.ts +1 -9
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
type StreamOptions,
|
|
16
16
|
type TranscriptContext,
|
|
17
17
|
} from "@earendil-works/pi-ai";
|
|
18
|
-
import { clampMaxTokensToContext } from "@earendil-works/pi-ai/api/simple-options";
|
|
19
18
|
import { googleGenerativeAIApi } from "@earendil-works/pi-ai/compat";
|
|
20
19
|
|
|
21
20
|
import { endpointUrl, PROJECT_HEADER, USER_AGENT } from "./ccpa.ts";
|
|
@@ -212,14 +211,7 @@ function stream(
|
|
|
212
211
|
context,
|
|
213
212
|
{
|
|
214
213
|
...innerOptions,
|
|
215
|
-
maxTokens:
|
|
216
|
-
method === "streamSimple"
|
|
217
|
-
? clampMaxTokensToContext(
|
|
218
|
-
model,
|
|
219
|
-
context,
|
|
220
|
-
innerOptions.maxTokens ?? model.maxTokens,
|
|
221
|
-
)
|
|
222
|
-
: (innerOptions.maxTokens ?? model.maxTokens),
|
|
214
|
+
maxTokens: innerOptions.maxTokens ?? model.maxTokens,
|
|
223
215
|
...(backendId ? { thinking: { enabled: true } } : {}),
|
|
224
216
|
apiKey: adapter.key,
|
|
225
217
|
headers: Object.fromEntries(headers),
|