docs: mention default model; clarify chat help; improve request error message
This commit is contained in:
parent
59c36403b5
commit
245a7e1f88
3 changed files with 22 additions and 4 deletions
|
|
@ -102,6 +102,12 @@ More details: `docs/guides/configuration.md`.
|
||||||
|
|
||||||
## Usage examples
|
## Usage examples
|
||||||
|
|
||||||
|
- Set a default model (so you don’t pass `-m` each time):
|
||||||
|
```bash
|
||||||
|
openwebui config set defaults.model llama3.2:latest
|
||||||
|
openwebui chat send -p "Hello" # uses the default model
|
||||||
|
```
|
||||||
|
|
||||||
- Non-streaming chat with JSON output:
|
- Non-streaming chat with JSON output:
|
||||||
```bash
|
```bash
|
||||||
openwebui chat send -m my-model -p "Summarize" --no-stream --json
|
openwebui chat send -m my-model -p "Summarize" --no-stream --json
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ def send(
|
||||||
None, "--history-file", help="Load conversation history from JSON file"
|
None, "--history-file", help="Load conversation history from JSON file"
|
||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Send a chat message."""
|
"""Send a chat message (starts a new chat unless --chat-id is provided)."""
|
||||||
obj = ctx.obj or {}
|
obj = ctx.obj or {}
|
||||||
config = load_config()
|
config = load_config()
|
||||||
|
|
||||||
|
|
@ -204,8 +204,11 @@ def list_chats(
|
||||||
limit: int = typer.Option(20, "--limit", "-n", help="Number of chats to show"),
|
limit: int = typer.Option(20, "--limit", "-n", help="Number of chats to show"),
|
||||||
archived: bool = typer.Option(False, "--archived", help="Show archived chats"),
|
archived: bool = typer.Option(False, "--archived", help="Show archived chats"),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""List conversations (v1.1 feature - placeholder)."""
|
"""List conversations (placeholder; server pagination not yet wired)."""
|
||||||
console.print("[yellow]Chat list will be available in v1.1[/yellow]")
|
console.print(
|
||||||
|
"[yellow]Chat list is not implemented yet.[/yellow] "
|
||||||
|
"Pagination will be added in a future release."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command()
|
@app.command()
|
||||||
|
|
|
||||||
|
|
@ -242,8 +242,17 @@ def handle_request_error(error: Exception) -> None:
|
||||||
" - The server might be overloaded"
|
" - The server might be overloaded"
|
||||||
)
|
)
|
||||||
elif isinstance(error, httpx.RequestError):
|
elif isinstance(error, httpx.RequestError):
|
||||||
|
url_msg = ""
|
||||||
|
try:
|
||||||
|
request_url = error.request.url # may raise if request is unset
|
||||||
|
url_msg = f" (URL: {request_url!s})"
|
||||||
|
except Exception:
|
||||||
|
url_msg = ""
|
||||||
raise NetworkError(
|
raise NetworkError(
|
||||||
f"Request failed: {error}\nCheck your network connection and server configuration."
|
f"Request failed: {error}{url_msg}\n"
|
||||||
|
"Check your network connection and server configuration. "
|
||||||
|
"Use --verbose to see more details."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
# Bubble up unknown errors unchanged (e.g., typer.Exit for graceful exits)
|
||||||
raise error
|
raise error
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue