@mcowger/pi-plexus 0.7.0 → 0.8.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/README.md +14 -1
- package/dist/extension.js +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -116,10 +116,23 @@ Run inside OpenCode:
|
|
|
116
116
|
|
|
117
117
|
Select **Plexus** and enter your base URL and API key. Models are loaded immediately and cached for fast startup on subsequent sessions.
|
|
118
118
|
|
|
119
|
+
For OpenCode, enter the Plexus API base URL including the trailing `/v1`, for example:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
https://plexus.example.com/v1
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The OpenCode plugin respects each model's `preferred_api` value and routes models through the matching SDK/API shape:
|
|
126
|
+
|
|
127
|
+
- `chat_completions` / `openai-completions` → OpenAI-compatible chat completions
|
|
128
|
+
- `responses` / `openai-responses` → OpenAI Responses API
|
|
129
|
+
- `messages` / `anthropic-messages` → Anthropic Messages API
|
|
130
|
+
- `gemini` / `google-generative-ai` → Google Gemini API
|
|
131
|
+
|
|
119
132
|
You can also pre-configure via environment variables:
|
|
120
133
|
|
|
121
134
|
```sh
|
|
122
|
-
export PLEXUS_BASE_URL=https://plexus.example.com
|
|
135
|
+
export PLEXUS_BASE_URL=https://plexus.example.com/v1
|
|
123
136
|
export PLEXUS_API_KEY=your-api-key
|
|
124
137
|
```
|
|
125
138
|
|
package/dist/extension.js
CHANGED
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
var REASONING_PARAMS = new Set(["reasoning", "include_reasoning", "reasoning_effort"]);
|
|
4
4
|
var API_DIALECT_MAP = {
|
|
5
5
|
chat_completions: "openai-completions",
|
|
6
|
+
"openai-completions": "openai-completions",
|
|
6
7
|
messages: "anthropic-messages",
|
|
8
|
+
"anthropic-messages": "anthropic-messages",
|
|
7
9
|
gemini: "google-generative-ai",
|
|
8
|
-
|
|
10
|
+
"google-generative-ai": "google-generative-ai",
|
|
11
|
+
responses: "openai-responses",
|
|
12
|
+
"openai-responses": "openai-responses"
|
|
9
13
|
};
|
|
10
14
|
function mapPreferredApi(raw) {
|
|
11
15
|
if (raw === undefined)
|
|
@@ -21,8 +25,6 @@ function mapPreferredApi(raw) {
|
|
|
21
25
|
function adjustBaseUrl(baseUrl, preferredApi) {
|
|
22
26
|
const stripped = baseUrl.replace(/\/+$/, "");
|
|
23
27
|
switch (preferredApi) {
|
|
24
|
-
case "anthropic-messages":
|
|
25
|
-
return stripped.endsWith("/v1") ? stripped.slice(0, -3) : stripped;
|
|
26
28
|
case "google-generative-ai":
|
|
27
29
|
return stripped.endsWith("/v1") ? `${stripped.slice(0, -3)}/v1beta` : stripped;
|
|
28
30
|
default:
|