@code-yeongyu/senpi-ai 2026.10.10-9 → 2026.10.11
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/dist/api/google-shared.js +101 -21
- package/dist/api/openai-codex-responses.js +2 -2
- package/dist/api/openai-responses-allowed-tools.d.ts +33 -0
- package/dist/api/openai-responses-allowed-tools.js +108 -0
- package/dist/api/openai-responses.js +43 -58
- package/dist/openai-responses-compat.d.ts +7 -2
- package/dist/openai-responses-compat.js +15 -2
- package/dist/providers/data/.manifest.json +1 -1
- package/dist/providers/data/baseten.json +1 -1
- package/dist/providers/data/chatgpt-subscription.json +1 -1
- package/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/dist/providers/data/google-vertex.json +1 -1
- package/dist/providers/data/huggingface.json +1 -1
- package/dist/providers/data/opengateway.json +1 -1
- package/dist/providers/data/openrouter.json +1 -1
- package/dist/providers/data/venice.json +1 -1
- package/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/types.d.ts +3 -2
- package/dist/utils/tool-choice-fallback.d.ts +5 -0
- package/dist/utils/tool-choice-fallback.js +1 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -690,8 +690,9 @@ export interface Context {
|
|
|
690
690
|
tools?: Tool[];
|
|
691
691
|
/**
|
|
692
692
|
* Names from `tools` the model may call on this request; absent means every tool is callable.
|
|
693
|
-
* Set only for models
|
|
694
|
-
* byte-stable and restricts callability through `tool_choice`
|
|
693
|
+
* Set only for models that `supportsAllowedToolChoice` accepts (the compat flag on a native OpenAI API
|
|
694
|
+
* host): the adapter keeps `tools` byte-stable and restricts callability through `tool_choice`
|
|
695
|
+
* (senpi#2095, senpi#3080).
|
|
695
696
|
*/
|
|
696
697
|
activeToolNames?: string[];
|
|
697
698
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { Api, Model } from "../types.ts";
|
|
2
2
|
/** The wire identity a forced tool_choice refusal is remembered under. */
|
|
3
3
|
export type ForcedToolChoiceTarget = Pick<Model<Api>, "api" | "provider" | "baseUrl" | "id">;
|
|
4
|
+
/**
|
|
5
|
+
* A request refusal: the HTTP 400 that rejects the request, or the same refusal a gateway that has
|
|
6
|
+
* already answered 200 (a keepalive stream) sends in-band before any content (senpi#2801).
|
|
7
|
+
*/
|
|
8
|
+
export declare function isRequestRefusal(error: unknown): boolean;
|
|
4
9
|
/**
|
|
5
10
|
* Reads `stream` until it has produced content (or ended, or `maxBuffered` contentless events went
|
|
6
11
|
* by), so a refusal a gateway sends in-band after answering 200 is raised while the request can still
|
|
@@ -49,7 +49,7 @@ function markInBandBeforeContent(error) {
|
|
|
49
49
|
* A request refusal: the HTTP 400 that rejects the request, or the same refusal a gateway that has
|
|
50
50
|
* already answered 200 (a keepalive stream) sends in-band before any content (senpi#2801).
|
|
51
51
|
*/
|
|
52
|
-
function isRequestRefusal(error) {
|
|
52
|
+
export function isRequestRefusal(error) {
|
|
53
53
|
const status = extractHttpStatus(error);
|
|
54
54
|
return status === 400 || (status === undefined && isInBandBeforeContent(error));
|
|
55
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi-ai",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.11",
|
|
4
4
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@anthropic-ai/sdk": "0.127.0",
|
|
90
90
|
"@aws-sdk/client-bedrock-runtime": "3.1136.0",
|
|
91
|
-
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.10.
|
|
91
|
+
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.10.11",
|
|
92
92
|
"@google/genai": "2.23.0",
|
|
93
93
|
"@smithy/node-http-handler": "4.12.1",
|
|
94
94
|
"http-proxy-agent": "9.1.0",
|