pi-dynamic-providers 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-dynamic-providers",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Pi extension to dynamically discover and register models from OpenAI-compatible endpoints",
5
5
  "author": "cybershape",
6
6
  "license": "MIT",
@@ -19,6 +19,8 @@ interface RemoteModelItem {
19
19
  context_length?: number;
20
20
  reasoning_efforts?: Array<{ value: string }>;
21
21
  supported_in_api?: boolean;
22
+ /** Backend used by the upstream gateway, e.g. "responses" or "chat_completions". */
23
+ api_backend?: string;
22
24
  }
23
25
 
24
26
  /**
@@ -83,11 +85,15 @@ async function syncModels(pi: ExtensionAPI): Promise<number> {
83
85
  (m.name ? m.name.toLowerCase().includes("thinking") : false);
84
86
 
85
87
  const contextWindow = m.context_window || m.context_length || defaultContextWindow;
88
+ const useResponsesApi = (m.api_backend || "").toLowerCase() === "responses";
86
89
 
87
90
  return {
88
91
  id: m.id,
89
92
  name: m.name || m.id,
90
93
  reasoning: isReasoning,
94
+ // Model-level override: upstream gateways that are backed by the Responses API
95
+ // must be called via /responses instead of /chat/completions.
96
+ ...(useResponsesApi && { api: "openai-responses" }),
91
97
  ...(isReasoning && {
92
98
  thinkingLevelMap: {
93
99
  xhigh: "xhigh",