Print API endpoint information.
(host: str, port: int)
| 232 | |
| 233 | |
| 234 | def print_api_info(host: str, port: int) -> None: |
| 235 | """Print API endpoint information.""" |
| 236 | api_url = f"http://{host}:{port}" |
| 237 | docs_url = f"http://{host}:{port}/docs" |
| 238 | |
| 239 | console.print() |
| 240 | console.print(f" {t('run_api_url', host=host, port=port)}") |
| 241 | console.print(f" {t('run_docs_url', host=host, port=port)}") |
| 242 | console.print() |
| 243 | console.print(f" [muted]Test command:[/muted]") |
| 244 | console.print( |
| 245 | f" [dim]curl {api_url}/v1/chat/completions -H 'Content-Type: application/json' " |
| 246 | f"-d '{{\"model\": \"default\", \"messages\": [{{\"role\": \"user\", \"content\": \"Hello\"}}]}}'[/dim]" |
| 247 | ) |
| 248 | console.print() |
| 249 | console.print(f" [muted]{t('run_stop_hint')}[/muted]") |