pi-dynamic-providers 0.0.2 → 0.0.3
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 +1 -1
- package/package.json +1 -1
- package/src/dynamic-models.ts +5 -12
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ A [Pi coding agent](https://pi.dev) extension to automatically discover and regi
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
11
|
- **Dynamic Model Discovery**: Queries the `/models` endpoint at startup and dynamically registers available models with the Pi provider registry.
|
|
12
|
-
- **Reasoning Model Support**:
|
|
12
|
+
- **Reasoning Model Support**: Enables reasoning support for models with configurable thinking levels up to `max`.
|
|
13
13
|
- **Manual Hot-Reload**: Provides a `/refresh-models` command to reload the remote model catalog without restarting Pi.
|
|
14
14
|
- **Flexible Configuration**: Reads configuration from `~/.pi/agent/dynamic-models/config.json`.
|
|
15
15
|
|
package/package.json
CHANGED
package/src/dynamic-models.ts
CHANGED
|
@@ -79,27 +79,20 @@ async function syncModels(pi: ExtensionAPI): Promise<number> {
|
|
|
79
79
|
const models = rawList
|
|
80
80
|
.filter((m) => m.supported_in_api !== false)
|
|
81
81
|
.map((m) => {
|
|
82
|
-
const isReasoning =
|
|
83
|
-
(Array.isArray(m.reasoning_efforts) && m.reasoning_efforts.length > 0) ||
|
|
84
|
-
m.id.toLowerCase().includes("thinking") ||
|
|
85
|
-
(m.name ? m.name.toLowerCase().includes("thinking") : false);
|
|
86
|
-
|
|
87
82
|
const contextWindow = m.context_window || m.context_length || defaultContextWindow;
|
|
88
83
|
const useResponsesApi = (m.api_backend || "").toLowerCase() === "responses";
|
|
89
84
|
|
|
90
85
|
return {
|
|
91
86
|
id: m.id,
|
|
92
87
|
name: m.name || m.id,
|
|
93
|
-
reasoning:
|
|
88
|
+
reasoning: true,
|
|
94
89
|
// Model-level override: upstream gateways that are backed by the Responses API
|
|
95
90
|
// must be called via /responses instead of /chat/completions.
|
|
96
91
|
...(useResponsesApi && { api: "openai-responses" }),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
}),
|
|
92
|
+
thinkingLevelMap: {
|
|
93
|
+
xhigh: "xhigh",
|
|
94
|
+
max: "max",
|
|
95
|
+
},
|
|
103
96
|
input: ["text", "image"] as ("text" | "image")[],
|
|
104
97
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
105
98
|
contextWindow,
|