mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-29 05:37:14 +00:00
fix(provider): preserve local agent model compatibility
This commit is contained in:
@@ -279,12 +279,9 @@ class LocalAgentRunner(runner.RequestRunner):
|
|||||||
else 'provider_default'
|
else 'provider_default'
|
||||||
)
|
)
|
||||||
reasoning_config = modelmgr_reasoning.normalize_reasoning_config({'level': level})
|
reasoning_config = modelmgr_reasoning.normalize_reasoning_config({'level': level})
|
||||||
return modelmgr_requester.RuntimeLLMModel(
|
configured_model = copy.copy(model)
|
||||||
execution_context=model.execution_context,
|
configured_model.reasoning_config_override = reasoning_config
|
||||||
model_entity=model.model_entity,
|
return configured_model
|
||||||
provider=model.provider,
|
|
||||||
reasoning_config_override=reasoning_config,
|
|
||||||
)
|
|
||||||
|
|
||||||
async def _invoke_with_fallback(
|
async def _invoke_with_fallback(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -377,6 +377,10 @@ async def test_local_agent_applies_reasoning_per_fallback_model():
|
|||||||
{'level': 'low'},
|
{'level': 'low'},
|
||||||
{'level': 'high'},
|
{'level': 'high'},
|
||||||
]
|
]
|
||||||
|
assert candidates[0] is not primary
|
||||||
|
assert candidates[1] is not fallback
|
||||||
|
assert primary.reasoning_config_override is None
|
||||||
|
assert fallback.reasoning_config_override is None
|
||||||
|
|
||||||
|
|
||||||
def test_local_agent_rejects_invalid_pipeline_reasoning_level():
|
def test_local_agent_rejects_invalid_pipeline_reasoning_level():
|
||||||
|
|||||||
@@ -915,9 +915,7 @@ export default function DynamicFormItemComponent({
|
|||||||
).filter(
|
).filter(
|
||||||
(entry): entry is [string, ReasoningLevel] =>
|
(entry): entry is [string, ReasoningLevel] =>
|
||||||
typeof entry[1] === 'string' &&
|
typeof entry[1] === 'string' &&
|
||||||
REASONING_LEVELS.includes(
|
REASONING_LEVELS.includes(entry[1] as ReasoningLevel),
|
||||||
entry[1] as ReasoningLevel,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
) as Record<string, ReasoningLevel>)
|
) as Record<string, ReasoningLevel>)
|
||||||
: {},
|
: {},
|
||||||
@@ -1108,15 +1106,16 @@ export default function DynamicFormItemComponent({
|
|||||||
|
|
||||||
const renderReasoningPicker = (modelUuid: string) => {
|
const renderReasoningPicker = (modelUuid: string) => {
|
||||||
if (!modelUuid) return null;
|
if (!modelUuid) return null;
|
||||||
const model = llmModels.find((candidate) => candidate.uuid === modelUuid);
|
const model = llmModels.find(
|
||||||
|
(candidate) => candidate.uuid === modelUuid,
|
||||||
|
);
|
||||||
const currentLevel =
|
const currentLevel =
|
||||||
modelValue.reasoning[modelUuid] || 'provider_default';
|
modelValue.reasoning[modelUuid] || 'provider_default';
|
||||||
const availableLevels = model?.reasoning_capabilities?.levels || [
|
const availableLevels = model?.reasoning_capabilities?.levels || [
|
||||||
'provider_default',
|
'provider_default',
|
||||||
];
|
];
|
||||||
const levels = REASONING_LEVELS.filter(
|
const levels = REASONING_LEVELS.filter(
|
||||||
(level) =>
|
(level) => availableLevels.includes(level) || level === currentLevel,
|
||||||
availableLevels.includes(level) || level === currentLevel,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user