@yeaft/webchat-agent 1.0.117 → 1.0.119
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
|
@@ -93,9 +93,13 @@ export function normalizeKnownProviderForRuntime(provider) {
|
|
|
93
93
|
|
|
94
94
|
export function serializeKnownProviderForPersistence(provider) {
|
|
95
95
|
if (!isGitHubCopilotProvider(provider)) return null;
|
|
96
|
+
const models = Array.isArray(provider.models) && provider.models.length
|
|
97
|
+
? githubCopilotModelEntries(provider.models)
|
|
98
|
+
: [];
|
|
96
99
|
return {
|
|
97
100
|
name: provider.name || GITHUB_COPILOT_PROVIDER_NAME,
|
|
98
101
|
credentialProvider: GITHUB_COPILOT_CREDENTIAL_PROVIDER,
|
|
99
102
|
managed: provider.managed || GITHUB_COPILOT_CREDENTIAL_PROVIDER,
|
|
103
|
+
...(models.length ? { models } : {}),
|
|
100
104
|
};
|
|
101
105
|
}
|
|
@@ -59,7 +59,7 @@ function thinkingV1Enabled() {
|
|
|
59
59
|
/**
|
|
60
60
|
* Translate a normalised effort ('minimal'|'low'|'medium'|'high'|'xhigh'|'max') into the value
|
|
61
61
|
* accepted by the OpenAI Responses `reasoning.effort` field. Responses today
|
|
62
|
-
* accepts 'minimal'|'low'|'medium'|'high'. Unsupported Anthropic-only
|
|
62
|
+
* accepts 'minimal'|'low'|'medium'|'high'|'xhigh'. Unsupported Anthropic-only
|
|
63
63
|
* adaptive efforts must be dropped, not downgraded.
|
|
64
64
|
*/
|
|
65
65
|
function effortForResponses(effort) {
|
package/yeaft/models.js
CHANGED
|
@@ -34,9 +34,9 @@ import { lookupModelLimitSync } from './llm/models-dev.js';
|
|
|
34
34
|
* @property {'anthropic' | 'anthropic-adaptive' | 'openai-reasoning' | 'none'} [thinkingProtocol] — task-327a:
|
|
35
35
|
* 'anthropic' → thinking:{type:'enabled', budget_tokens:N}
|
|
36
36
|
* 'anthropic-adaptive' → thinking:{type:'adaptive'} + output_config:{effort}
|
|
37
|
-
* 'openai-reasoning' → reasoning:{effort:'minimal'|'low'|'medium'|'high'}
|
|
37
|
+
* 'openai-reasoning' → reasoning:{effort:'minimal'|'low'|'medium'|'high'|'xhigh'}
|
|
38
38
|
* 'none' (default) → parameter silently dropped by router
|
|
39
|
-
* @property {'low' | 'medium' | 'high' | 'max' | null} [defaultEffort] —
|
|
39
|
+
* @property {'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null} [defaultEffort] — adapter-level default
|
|
40
40
|
* when caller doesn't specify effort (null = no default / decision-tree decides).
|
|
41
41
|
* @property {number} [maxBudgetTokens] — task-327a: for anthropic protocol, the cap used when
|
|
42
42
|
* effort='max' (e.g. Opus 4 = 64K, Sonnet 4 = 32K). For openai-reasoning this field is unused
|
|
@@ -106,7 +106,7 @@ export const MODEL_REGISTRY = new Map([
|
|
|
106
106
|
adapter: 'openai-responses',
|
|
107
107
|
baseUrl: 'https://api.openai.com/v1',
|
|
108
108
|
displayName: 'GPT-5',
|
|
109
|
-
//
|
|
109
|
+
// GPT-5 supports Responses reasoning.effort, including xhigh on current OpenAI APIs. No 'max'.
|
|
110
110
|
supportsThinking: true,
|
|
111
111
|
thinkingProtocol: 'openai-reasoning',
|
|
112
112
|
defaultEffort: null,
|
|
@@ -405,13 +405,12 @@ export const ANTHROPIC_THINKING_BUDGETS = {
|
|
|
405
405
|
};
|
|
406
406
|
|
|
407
407
|
/**
|
|
408
|
-
* Map a Yeaft effort level to the OpenAI reasoning.effort enum.
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
* but the adapter MUST NOT error.
|
|
408
|
+
* Map a Yeaft effort level to the OpenAI reasoning.effort enum. Current
|
|
409
|
+
* OpenAI APIs expose xhigh, but not Anthropic's 'max'. Unsupported values are
|
|
410
|
+
* dropped by returning null; the adapter MUST NOT error.
|
|
412
411
|
*
|
|
413
412
|
* @param {Effort} effort
|
|
414
|
-
* @returns {'minimal' | 'low' | 'medium' | 'high' | null}
|
|
413
|
+
* @returns {'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null}
|
|
415
414
|
*/
|
|
416
415
|
export function mapEffortToOpenAIReasoning(effort) {
|
|
417
416
|
if (!effort) return null;
|
|
@@ -420,11 +419,12 @@ export function mapEffortToOpenAIReasoning(effort) {
|
|
|
420
419
|
case 'low': return 'low';
|
|
421
420
|
case 'medium': return 'medium';
|
|
422
421
|
case 'high': return 'high';
|
|
422
|
+
case 'xhigh': return 'xhigh';
|
|
423
423
|
default: return null;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
-
export const OPENAI_REASONING_EFFORT_OPTIONS = ['minimal', 'low', 'medium', 'high'];
|
|
427
|
+
export const OPENAI_REASONING_EFFORT_OPTIONS = ['minimal', 'low', 'medium', 'high', 'xhigh'];
|
|
428
428
|
export const ANTHROPIC_MANUAL_EFFORT_OPTIONS = ['low', 'medium', 'high'];
|
|
429
429
|
export const ANTHROPIC_ADAPTIVE_EFFORT_OPTIONS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
430
430
|
export const ANTHROPIC_ADAPTIVE_MAX_EFFORT_OPTIONS = ['low', 'medium', 'high', 'max'];
|