mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-16 14:57:15 +00:00
fix(agent): tolerate intent annotations on no-argument platform tools
This commit is contained in:
@@ -573,6 +573,10 @@ def _normalize_platform_params(
|
||||
if not isinstance(parameters, dict):
|
||||
raise ValueError('parameters must be an object')
|
||||
allowed = set((definition.parameters.get('properties') or {}).keys())
|
||||
# Some model responses annotate no-argument calls with a textual intent.
|
||||
# Keep the original trace, but never pass this annotation to the adapter.
|
||||
if not allowed and isinstance(parameters.get('_call'), str):
|
||||
parameters = {key: value for key, value in parameters.items() if key != '_call'}
|
||||
extra = set(parameters) - allowed
|
||||
if extra:
|
||||
raise ValueError(f'Unexpected parameters: {", ".join(sorted(extra))}')
|
||||
|
||||
Reference in New Issue
Block a user