mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-13 03:59:12 +00:00
fix(proxy): restore click decorator chain on run_server
The _value_type_name helper was inserted between the last @click.option decorator and def run_server, which hijacked the entire click decorator stack onto the helper and left run_server as a bare 51-arg function. That broke: - the litellm console entry point (TypeError: run_server() missing 51 args) - python-310-import-smoke, Core checks on all Pythons - proxy-infra-root / All Other Providers tests that access run_server.main/.name - the basedpyright type-check budget (3 extra reportCallIssue) Move the helper above @click.command() so the decorators re-attach to run_server as on main.
This commit is contained in:
parent
8003d5920b
commit
e8162412d1
1 changed files with 10 additions and 10 deletions
|
|
@ -702,6 +702,16 @@ class ProxyInitializationHelpers:
|
|||
return multiproc_dir
|
||||
|
||||
|
||||
def _value_type_name(value: object) -> str:
|
||||
"""Return the runtime class name of an arbitrary config value.
|
||||
|
||||
The value read from YAML is untyped; annotate the parameter as ``object``
|
||||
so ``type()`` receives a known-typed argument and the strict type gate does
|
||||
not count a ``reportUnknownArgumentType`` error on the error path.
|
||||
"""
|
||||
return type(value).__name__
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.argument("cli_args", nargs=-1)
|
||||
@click.option("--host", default="0.0.0.0", help="Host for the server to listen on.", envvar="HOST")
|
||||
|
|
@ -1014,16 +1024,6 @@ class ProxyInitializationHelpers:
|
|||
),
|
||||
envvar="PROMETHEUS_METRICS_PORT",
|
||||
)
|
||||
def _value_type_name(value: object) -> str:
|
||||
"""Return the runtime class name of an arbitrary config value.
|
||||
|
||||
The value read from YAML is untyped; annotate the parameter as ``object``
|
||||
so ``type()`` receives a known-typed argument and the strict type gate does
|
||||
not count a ``reportUnknownArgumentType`` error on the error path.
|
||||
"""
|
||||
return type(value).__name__
|
||||
|
||||
|
||||
def run_server(
|
||||
cli_args,
|
||||
host,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue