INNER CODE UNIT · Python
dump_response
speaches-ai/speaches · packages/speaches-cli/src/speaches_cli/main.py:43
def dump_response(response: httpx.Response) -> None:
if response.headers.get("Content-Type") == "application/json":
data = response.json()
print(json.dumps(data, indent=2))
else:
print(response.text)
@registry_app.command("list | ls")
def registry_ls(task: str | None = None) -> None:
params: dict[str, str] = {}
if task is not None:
params["task"] = task
response = client.get(REGISTRY_URL, params=params)
dump_response(response)
@model_app.command("list | ls")