Loading...
Loading...
Visualize and document pplx-sdk system architecture with Mermaid diagrams — layer maps, data flow, dependency graphs, sequence diagrams, and component relationships. Use when designing new features, onboarding, or documenting how the system works.
npx skill4agent add pv-udpv/pplx-sdk architecture| Need | Diagram Type | Mermaid Syntax |
|---|---|---|
| Layer overview | Layered block diagram | |
| Data flow | Flowchart | |
| API call sequence | Sequence diagram | |
| Class relationships | Class diagram | |
| State transitions | State diagram | |
| Component dependencies | Dependency graph | |
| Deployment / infra | C4 or flowchart | |
graph TD
Client["client.py<br/>PerplexityClient, Conversation"]
Domain["domain/<br/>models.py, services"]
Transport["transport/<br/>http.py, sse.py"]
Shared["shared/<br/>auth.py, logging.py, retry.py"]
Core["core/<br/>protocols.py, types.py, exceptions.py"]
Client --> Domain
Client --> Transport
Client --> Shared
Domain --> Transport
Domain --> Shared
Domain --> Core
Transport --> Shared
Transport --> Core
Shared --> Core
style Core fill:#e1f5fe
style Shared fill:#f3e5f5
style Transport fill:#fff3e0
style Domain fill:#e8f5e9
style Client fill:#fce4ecsequenceDiagram
participant App as Application
participant Client as PerplexityClient
participant Transport as SSETransport
participant API as perplexity.ai
App->>Client: ask_stream(query)
Client->>Transport: stream(payload)
Transport->>API: POST /rest/sse/perplexity.ask
loop SSE Events
API-->>Transport: event: query_progress
Transport-->>Client: StreamChunk(progress)
API-->>Transport: event: answer_chunk
Transport-->>Client: StreamChunk(text)
end
API-->>Transport: event: final_response
Transport-->>Client: StreamChunk(final)
API-->>Transport: : [end]
Client-->>App: Entry (complete)classDiagram
class PerplexitySDKError {
+str message
+dict details
}
class TransportError {
+int status_code
+str response_body
}
class AuthenticationError {
401
}
class RateLimitError {
+float retry_after
429
}
class StreamingError
class ValidationError
PerplexitySDKError <|-- TransportError
PerplexitySDKError <|-- StreamingError
PerplexitySDKError <|-- ValidationError
TransportError <|-- AuthenticationError
TransportError <|-- RateLimitErrorstateDiagram-v2
[*] --> Requesting
Requesting --> Success: 2xx response
Requesting --> RetryWait: 429 / 5xx
Requesting --> Failed: 4xx (non-429)
RetryWait --> Requesting: backoff elapsed
RetryWait --> Failed: max_retries exceeded
Success --> [*]
Failed --> [*]README.mddocs/architecture.mdTDLRclient.pycore/exceptions.pycore/protocols.py