package
Version:
v0.0.0-...-4c5b182
Opens a new window with list of versions in this module.
Published: Jan 17, 2026
License: BSD-3-Clause
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Client represents a Perplexity API client.
New creates a new Perplexity client with the given API key.
Query sends a query to Perplexity and returns the first response.
WithURL returns a new client with a custom API URL.
type CompletionRequest struct {
Model string `json:"model"`
Messages []Message `json:"messages"`
}
type CompletionResponse struct {
ID string `json:"id"`
Model string `json:"model"`
Created int64 `json:"created"`
Choices []struct {
Message struct {
Role string `json:"role"`
Content string `json:"content"`
} `json:"message"`
} `json:"choices"`
}
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.