Skip to content

Commit 0ee74b8

Browse files
committed
refactor(BA-5528): default --params to "{}" for chat command
1 parent f8574f1 commit 0ee74b8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • src/ai/backend/client/cli/v2/deployment

src/ai/backend/client/cli/v2/deployment/chat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _run_async(coro_fn: Callable[[], Awaitable[None]]) -> None:
4646
)
4747
@click.option(
4848
"--params",
49-
default=None,
49+
default="{}",
5050
type=JSONParamType(),
5151
help=(
5252
"Extra request-body fields as a JSON object. "
@@ -82,9 +82,9 @@ def chat(
8282
except IncompatibleChatCacheError as e:
8383
raise click.ClickException(str(e)) from e
8484

85-
if params is not None and not isinstance(params, dict):
85+
if not isinstance(params, dict):
8686
raise click.ClickException("--params must be a JSON object.")
87-
extra_body: dict[str, Any] = params or {}
87+
extra_body: dict[str, Any] = params
8888
entry = cache.get(deployment_id)
8989

9090
async def _resolve_endpoint() -> DeploymentChatCacheEntry:

0 commit comments

Comments
 (0)