Conversation
The Conversation class manages a single conversation thread with multi-turn and streaming support. Create instances via client.create_conversation().
perplexity_webui_scraper.core.conversation.Conversation
Conversation(http: HTTPClient, config: ConversationConfig)
Manage a Perplexity conversation thread with multi-turn and streaming support.
Create instances via client.create_conversation() — do not instantiate directly.
Example
| ATTRIBUTE | DESCRIPTION |
|---|---|
answer |
The most recent final answer text.
TYPE:
|
search_results |
Web sources cited in the last response.
TYPE:
|
uuid |
Conversation UUID returned by Perplexity.
TYPE:
|
Source code in src/perplexity_webui_scraper/core/conversation.py
Attributes
search_results
property
search_results: list[SearchResultItem]
Web sources cited in the most recent response.
Functions
ask
ask(query: str, model: str | None = None, files: list[FileInput] | None = None, citation_mode: CitationMode | None = None, stream: bool = False) -> Conversation
Send a query and return self for chaining or streaming iteration.
In non-streaming mode, blocks until the response completes.
In streaming mode, iterate over self to receive chunks.
| PARAMETER | DESCRIPTION |
|---|---|
query
|
The prompt text.
TYPE:
|
model
|
Model ID override. Falls back to config or
TYPE:
|
files
|
Optional list of attachments.
TYPE:
|
citation_mode
|
Per-query citation override.
TYPE:
|
stream
|
If
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Conversation
|
|