AQIT 0.1.0
Loading...
Searching...
No Matches
prompt_display.py
Go to the documentation of this file.
1# Copyright (c) 2025-present Aquin Labs Private Limited. All Rights Reserved.
2"""Quiet surfaces for `aquin prompt`."""
3
4from __future__ import annotations
5
6from typing import Any
7
8
10 *,
11 model: str,
12 prompt: str,
13 response: str,
14 ok: bool = True,
15 error: str | None = None,
16 daemon: bool = False,
17) -> dict[str, Any]:
18 out: dict[str, Any] = {
19 "kind": "prompt",
20 "ok": ok,
21 "model": model,
22 "prompt": prompt,
23 "response": response if ok else "",
24 "daemon": daemon,
25 }
26 if error:
27 out["error"] = error
28 return out
29
30
31def print_prompt_result(*, model: str, prompt: str, response: str) -> None:
32 from aquin.tui.spinners import bullet_mark
33
34 mark = bullet_mark()
35 print(f"{mark} {model}", flush=True)
36 print(flush=True)
37 print(response.rstrip() or "(empty response)", flush=True)
None print_prompt_result(*, str model, str prompt, str response)
dict[str, Any] prompt_payload(*, str model, str prompt, str response, bool ok=True, str|None error=None, bool daemon=False)