chorus-cli 0.4.8 → 0.4.9
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/index.js +3 -1
- package/package.json +1 -1
- package/tools/coder.py +3 -2
- package/tools/qa.py +11 -4
package/index.js
CHANGED
|
@@ -253,7 +253,7 @@ IMPORTANT: Output ONLY the message above. Do not include any preamble, thinking
|
|
|
253
253
|
const openai = new OpenAI(openaiOpts);
|
|
254
254
|
|
|
255
255
|
const response = await openai.chat.completions.create({
|
|
256
|
-
model: '
|
|
256
|
+
model: 'chorus-default',
|
|
257
257
|
max_tokens: 2000,
|
|
258
258
|
messages: [
|
|
259
259
|
{
|
|
@@ -261,6 +261,8 @@ IMPORTANT: Output ONLY the message above. Do not include any preamble, thinking
|
|
|
261
261
|
content: prompt
|
|
262
262
|
}
|
|
263
263
|
]
|
|
264
|
+
}, {
|
|
265
|
+
headers: { 'X-Chorus-Mode': 'enrich' },
|
|
264
266
|
});
|
|
265
267
|
|
|
266
268
|
if (response.usage) {
|
package/package.json
CHANGED
package/tools/coder.py
CHANGED
|
@@ -9,7 +9,6 @@ Usage:
|
|
|
9
9
|
Environment variables:
|
|
10
10
|
CHORUS_API_KEY — Required. Your Chorus API key.
|
|
11
11
|
CHORUS_API_URL — Optional. Chorus proxy base URL (default: https://chorus-bad0f.web.app/v1)
|
|
12
|
-
CODER_MODEL — Model to use (default: anthropic/claude-sonnet-4)
|
|
13
12
|
CODER_MAX_TOKENS — Max response tokens (default: 16384)
|
|
14
13
|
CODER_SAFE_MODE — Set to 1 to require approval for writes/edits/bash
|
|
15
14
|
"""
|
|
@@ -41,7 +40,9 @@ class C:
|
|
|
41
40
|
|
|
42
41
|
# ── Config ──────────────────────────────────────────────────────────────────
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
# Model is resolved server-side by the proxy based on chorus_mode.
|
|
44
|
+
# This placeholder is sent in the request but overridden by the proxy.
|
|
45
|
+
MODEL = "chorus-default"
|
|
45
46
|
MAX_TOKENS = int(os.environ.get("CODER_MAX_TOKENS", "16384"))
|
|
46
47
|
SAFE_MODE = os.environ.get("CODER_SAFE_MODE", "").lower() in ("1", "true", "yes")
|
|
47
48
|
|
package/tools/qa.py
CHANGED
|
@@ -27,7 +27,9 @@ from abc import ABC, abstractmethod
|
|
|
27
27
|
|
|
28
28
|
# ── Config ──────────────────────────────────────────────────────────────────
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
# Model is resolved server-side by the proxy based on chorus_mode.
|
|
31
|
+
MODEL = "chorus-default"
|
|
32
|
+
QA_CHORUS_MODE = "qa"
|
|
31
33
|
MAX_ROUNDS = int(os.environ.get("QA_MAX_ROUNDS", "5"))
|
|
32
34
|
POLL_INTERVAL = int(os.environ.get("QA_POLL_INTERVAL", "60")) # seconds
|
|
33
35
|
POLL_TIMEOUT = int(os.environ.get("QA_POLL_TIMEOUT", "1800")) # 30 min
|
|
@@ -339,6 +341,7 @@ If NO: set sufficient=false and write a short, friendly follow-up message asking
|
|
|
339
341
|
max_tokens=1024,
|
|
340
342
|
messages=messages,
|
|
341
343
|
response_format={"type": "json_object"},
|
|
344
|
+
extra_body={"chorus_mode": QA_CHORUS_MODE},
|
|
342
345
|
)
|
|
343
346
|
|
|
344
347
|
if hasattr(response, "usage") and response.usage:
|
|
@@ -391,6 +394,7 @@ Write a clear numbered list of requirements. Each requirement should be specific
|
|
|
391
394
|
model=MODEL,
|
|
392
395
|
max_tokens=2048,
|
|
393
396
|
messages=messages,
|
|
397
|
+
extra_body={"chorus_mode": QA_CHORUS_MODE},
|
|
394
398
|
)
|
|
395
399
|
|
|
396
400
|
if hasattr(response, "usage") and response.usage:
|
|
@@ -481,10 +485,13 @@ def main():
|
|
|
481
485
|
parser.add_argument("--super", action="store_true", help="Use Opus 4.6 instead of Sonnet")
|
|
482
486
|
args = parser.parse_args()
|
|
483
487
|
|
|
488
|
+
# chorus_mode tells the proxy which model to use
|
|
489
|
+
global QA_CHORUS_MODE
|
|
484
490
|
if args.super:
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
491
|
+
QA_CHORUS_MODE = "qa_super"
|
|
492
|
+
log("Super mode: proxy will use upgraded model")
|
|
493
|
+
else:
|
|
494
|
+
QA_CHORUS_MODE = "qa"
|
|
488
495
|
|
|
489
496
|
if not os.environ.get("CHORUS_API_KEY"):
|
|
490
497
|
log("Error: CHORUS_API_KEY not set. Run 'chorus setup' to configure.")
|