mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
fix: mark dotted-path callbacks read-only to prevent duplicate display
Configured callbacks loaded from dotted Python paths (e.g. custom_callbacks.my_logger) are never matched against runtime instances by name because the registry uses short canonical names (e.g. langsmith, arize). Mark these rows read-only to prevent the UI from attempting delete operations that would fail at the endpoint level anyway.
This commit is contained in:
parent
85e41aef99
commit
79bffe1a06
1 changed files with 12 additions and 3 deletions
|
|
@ -17113,13 +17113,22 @@ async def get_config(
|
|||
"""
|
||||
|
||||
for _callback in _success_callbacks:
|
||||
_data_to_return.append(process_callback(_callback, "success", environment_variables))
|
||||
row: Final = process_callback(_callback, "success", environment_variables)
|
||||
if isinstance(_callback, str) and "." in _callback:
|
||||
row["read_only"] = True
|
||||
_data_to_return.append(row)
|
||||
|
||||
for _callback in _failure_callbacks:
|
||||
_data_to_return.append(process_callback(_callback, "failure", environment_variables))
|
||||
row: Final = process_callback(_callback, "failure", environment_variables)
|
||||
if isinstance(_callback, str) and "." in _callback:
|
||||
row["read_only"] = True
|
||||
_data_to_return.append(row)
|
||||
|
||||
for _callback in _success_and_failure_callbacks:
|
||||
_data_to_return.append(process_callback(_callback, "success_and_failure", environment_variables))
|
||||
row: Final = process_callback(_callback, "success_and_failure", environment_variables)
|
||||
if isinstance(_callback, str) and "." in _callback:
|
||||
row["read_only"] = True
|
||||
_data_to_return.append(row)
|
||||
|
||||
configured_callback_names: Final = frozenset(
|
||||
_normalize_callback_alias(callback)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue