mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-09 04:40:57 +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'
|
||||
)
|
||||
reasoning_config = modelmgr_reasoning.normalize_reasoning_config({'level': level})
|
||||
return modelmgr_requester.RuntimeLLMModel(
|
||||
execution_context=model.execution_context,
|
||||
model_entity=model.model_entity,
|
||||
provider=model.provider,
|
||||
reasoning_config_override=reasoning_config,
|
||||
)
|
||||
configured_model = copy.copy(model)
|
||||
configured_model.reasoning_config_override = reasoning_config
|
||||
return configured_model
|
||||
|
||||
async def _invoke_with_fallback(
|
||||
self,
|
||||
|
||||
@@ -377,6 +377,10 @@ async def test_local_agent_applies_reasoning_per_fallback_model():
|
||||
{'level': 'low'},
|
||||
{'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():
|
||||
|
||||
@@ -915,9 +915,7 @@ export default function DynamicFormItemComponent({
|
||||
).filter(
|
||||
(entry): entry is [string, ReasoningLevel] =>
|
||||
typeof entry[1] === 'string' &&
|
||||
REASONING_LEVELS.includes(
|
||||
entry[1] as ReasoningLevel,
|
||||
),
|
||||
REASONING_LEVELS.includes(entry[1] as ReasoningLevel),
|
||||
),
|
||||
) as Record<string, ReasoningLevel>)
|
||||
: {},
|
||||
@@ -1108,15 +1106,16 @@ export default function DynamicFormItemComponent({
|
||||
|
||||
const renderReasoningPicker = (modelUuid: string) => {
|
||||
if (!modelUuid) return null;
|
||||
const model = llmModels.find((candidate) => candidate.uuid === modelUuid);
|
||||
const model = llmModels.find(
|
||||
(candidate) => candidate.uuid === modelUuid,
|
||||
);
|
||||
const currentLevel =
|
||||
modelValue.reasoning[modelUuid] || 'provider_default';
|
||||
const availableLevels = model?.reasoning_capabilities?.levels || [
|
||||
'provider_default',
|
||||
];
|
||||
const levels = REASONING_LEVELS.filter(
|
||||
(level) =>
|
||||
availableLevels.includes(level) || level === currentLevel,
|
||||
(level) => availableLevels.includes(level) || level === currentLevel,
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user