Documentation
¶
Index ¶
- Constants
- type AgentAnnotation
- type AgentContent
- type AgentCost
- type AgentOutput
- type AgentRequest
- type AgentResponse
- type AgentTool
- type AgentUsage
- type Client
- type Configuration
- type Model
- type ModelsResponse
- type Perplexity
- func (p *Perplexity) Actions() []core.Action
- func (p *Perplexity) Cleanup(ctx core.IntegrationCleanupContext) error
- func (p *Perplexity) Components() []core.Component
- func (p *Perplexity) Configuration() []configuration.Field
- func (p *Perplexity) Description() string
- func (p *Perplexity) HandleAction(ctx core.IntegrationActionContext) error
- func (p *Perplexity) HandleRequest(ctx core.HTTPRequestContext)
- func (p *Perplexity) Icon() string
- func (p *Perplexity) Instructions() string
- func (p *Perplexity) Label() string
- func (p *Perplexity) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (p *Perplexity) Name() string
- func (p *Perplexity) Sync(ctx core.SyncContext) error
- func (p *Perplexity) Triggers() []core.Trigger
Constants ¶
View Source
const AgentPayloadType = "perplexity.agent.response"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentAnnotation ¶
AgentAnnotation is a citation annotation in the agent response.
type AgentContent ¶
type AgentContent struct {
Type string `json:"type"`
Text string `json:"text"`
Annotations []AgentAnnotation `json:"annotations"`
}
AgentContent is a single content block in an agent output item.
type AgentCost ¶
type AgentCost struct {
TotalCost float64 `json:"total_cost"`
}
AgentCost holds cost information from usage.
type AgentOutput ¶
type AgentOutput struct {
Content []AgentContent `json:"content"`
}
AgentOutput is a single output item in the agent response.
type AgentRequest ¶
type AgentRequest struct {
Preset string `json:"preset,omitempty"`
Model string `json:"model,omitempty"`
Input string `json:"input"`
Instructions string `json:"instructions,omitempty"`
Tools []AgentTool `json:"tools,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
}
AgentRequest represents the request body for POST /v1/responses.
type AgentResponse ¶
type AgentResponse struct {
ID string `json:"id"`
Model string `json:"model"`
Status string `json:"status"`
Output []AgentOutput `json:"output"`
Usage *AgentUsage `json:"usage,omitempty"`
}
AgentResponse represents the response from POST /v1/responses.
type AgentTool ¶
type AgentTool struct {
Type string `json:"type"`
}
AgentTool represents a tool in an agent request.
type AgentUsage ¶
type AgentUsage struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
TotalTokens int `json:"total_tokens"`
Cost AgentCost `json:"cost"`
}
AgentUsage holds token and cost usage from the agent response.
type Client ¶
type Client struct {
APIKey string
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(httpClient core.HTTPContext, ctx core.IntegrationContext) (*Client, error)
func (*Client) CreateAgentResponse ¶
func (c *Client) CreateAgentResponse(req AgentRequest) (*AgentResponse, error)
func (*Client) ListModels ¶
type Configuration ¶
type Configuration struct {
APIKey string `json:"apiKey"`
}
type ModelsResponse ¶
ModelsResponse represents the response from GET /v1/models.
type Perplexity ¶
type Perplexity struct{}
func (*Perplexity) Actions ¶
func (p *Perplexity) Actions() []core.Action
func (*Perplexity) Cleanup ¶
func (p *Perplexity) Cleanup(ctx core.IntegrationCleanupContext) error
func (*Perplexity) Components ¶
func (p *Perplexity) Components() []core.Component
func (*Perplexity) Configuration ¶
func (p *Perplexity) Configuration() []configuration.Field
func (*Perplexity) Description ¶
func (p *Perplexity) Description() string
func (*Perplexity) HandleAction ¶
func (p *Perplexity) HandleAction(ctx core.IntegrationActionContext) error
func (*Perplexity) HandleRequest ¶
func (p *Perplexity) HandleRequest(ctx core.HTTPRequestContext)
func (*Perplexity) Icon ¶
func (p *Perplexity) Icon() string
func (*Perplexity) Instructions ¶
func (p *Perplexity) Instructions() string
func (*Perplexity) Label ¶
func (p *Perplexity) Label() string
func (*Perplexity) ListResources ¶
func (p *Perplexity) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
func (*Perplexity) Name ¶
func (p *Perplexity) Name() string
func (*Perplexity) Sync ¶
func (p *Perplexity) Sync(ctx core.SyncContext) error
func (*Perplexity) Triggers ¶
func (p *Perplexity) Triggers() []core.Trigger
Click to show internal directories.
Click to hide internal directories.