| 183 | |
| 184 | |
| 185 | def _print_config( |
| 186 | api_key: str | None, |
| 187 | provider: str, |
| 188 | model: str, |
| 189 | ollama_host: str, |
| 190 | is_pdf_disabled: bool, |
| 191 | ) -> None: |
| 192 | masked = ("*" * 20 + api_key[-6:]) if api_key and len(api_key) > 6 else "not set" |
| 193 | rows = [ |
| 194 | f"[bold]Provider:[/] {provider}", |
| 195 | f"[bold]Model:[/] {model}", |
| 196 | ] |
| 197 | if provider == "anthropic": |
| 198 | rows.append(f"[bold]API Key:[/] {masked}") |
| 199 | else: |
| 200 | rows.append(f"[bold]Ollama:[/] {ollama_host}") |
| 201 | rows += [ |
| 202 | "[bold]Reports:[/] ./reports/", |
| 203 | f"[bold]PDF:[/] {'disabled' if is_pdf_disabled else 'enabled'}", |
| 204 | ] |
| 205 | console.print() |
| 206 | console.print( |
| 207 | Panel( |
| 208 | "\n".join(rows), |
| 209 | title="[bold]Configuration[/]", |
| 210 | border_style="#1e293b", |
| 211 | padding=(0, 2), |
| 212 | ) |
| 213 | ) |
| 214 | console.print() |
| 215 | |
| 216 | |
| 217 | # --------------------------------------------------------------------------- |